Coder Social home page Coder Social logo

irongenerator's People

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

irongenerator's Issues

Route-guard uses strict mode by default

  • The route-guars.js file is missing additional extension for templating .ejs

    • Solution: add .ejs so we would have route-guars.js.ejs
  • In advanced mode, whether we choose or not to use the 'use strict' mode, it comes by default with it.

    • Solution: remove the dependency so it adds use strict only when requested.

Cookie not being set on production app deployed to heroku

Should be investigated.

Behavior doesn't seem to be entirely consistent.

It might be related to having one of the following properties in the cookie options:

{
  // ...
  sameSite: 'lax',
  httpOnly: true,
  secure: process.env.NODE_ENV === 'production'
  // ...
}

Solution might involve setting the option "trust proxy" to true on the express app with app.set('trust proxy', true).

Add server "refresh" flags to development script

The relevant flags should be added to development scripts using nodemon to ensure that it is refreshed whenever there's a file change in the directory.

For example:

{
  // ...
  "scripts": "nodemon server.js -e js,json,hbs,scss"
  // ...
}

Add Code of conduct

Add contribution guidelines to CODE-OF-CONDUCT.md. The most used open-source code of conduct is the one from Contributor Covenant (latest version 2.0); it can be found here.

Document usage instructions, configuration options

Usage of the package might not be immediately clear from the information displayed in the README.md file.

Should add information regarding the possible options for bootstrapping process, explain the usage of "beginner"/"intermediate"/"advanced" configuration options, quick overview of what each option does, especially the options regarding authentication.

Include explanation on the requirements to run the bootstrapped app, compatible version of node, inclusion of environment variables.

Update folder and file names according to naming convention

  • Routes files should be named with: name.routes.js

    • should we name authentication routes:
      [ ] a) authentication.routes.js or
      [ ] b) auth.routes.js?
  • Model files should be named with: name.model.js

    • should we name model routes:
      • a) Name.routes.js (User.model.js) or
      • b) name.routes.js (user.model.js)?
  • Auth views should be

    • named:
    • a) login.hbs & signup.hbs
    • b) log-in.hbs & sign-up.hbs
    • separated into sub-folder: views > auth > login.hbs & signup.hbs:
    • a) yes
    • b) no
  • Should user.hbs be

    • profile.hbs or
    • user-profile?
  • Should middleware > route-guard.js be plural middleware > route-guards.js?

Add "MongoDB starting" message before trying connection

At the moment, the server tries to connect to MongoDB without informing the user beforehand. If MongoDB is not running, it takes 30s for the error message to be displayed.

A message should be logged using the debug package, in order to ensure that the user is aware that the server is starting up, before connecting to MongoDB.

Standardize folder structure for all available options

The folder structure needs to be standardized. The proposal can be found on the miro working area.

  1. Option: Beginner
├── app.js
├── package.json
├── public
│   ├── images
│   │   └── favicon.ico
│   ├── scripts
│   │   └── script.js
│   └── styles
│       └── style.css
├── routes
│   └── index.js ===> should this be index.routes.js?
├── server.js
└── views
    ├── error.html
    ├── index.html
    └── user.html
  1. Option: Medium (shall it be renamed to Intermediate?)
  • When actually do we use this option during the course?
├── app.js
├── models
│   └── user.js ===> to be renamed to user.model.js (or: User.model.js?)
├── package.json
├── public
│   ├── images
│   │   └── favicon.ico
│   ├── scripts
│   │   └── script.js
│   └── styles
│       └── style.css
├── routes
│   └── index.js ===> should this be index.routes.js?
├── server.js
└── views
    ├── error.html ===> do we need html files still?
    ├── index.html
    └── user.html

3.1) Option: Advanced -> MVC (no authentication)

├── app.js
├── models
│   └── user.js ===> to be renamed to user.model.js (or: User.model.js?)cd adv
├── package.json
├── public
│   ├── images
│   │   └── favicon.ico
│   ├── scripts
│   │   └── script.js
│   └── styles
│       └── style.css
├── routes
│   └── index.js ===> should this be index.routes.js?
├── server.js
└── views
    ├── error.hbs
    ├── index.hbs
    ├── layout.hbs
    ├── private.hbs
    ├── sign-in.hbs ===> should this be login.hbs or log-in.hbs? should we have subfolder for auth (signup and login) views?
    ├── sign-up.hbs
    └── user.hbs ===> should this be profile.hbs?

3.2) Option: Advanced -> MVC -> with AUTH -> basic session and cookies

├── app.js
├── middleware
│   ├── basic-authentication-deserializer.js
│   ├── bind-user-to-view-locals.js
│   └── route-guard.js ===> should this be plural - guards?
├── models
│   └── user.js ===> the same as above - user.model.js or User.model.js?
├── package.json
├── public
│   ├── images
│   │   └── favicon.ico
│   ├── scripts
│   │   └── script.js
│   └── styles
│       └── style.css
├── routes
│   ├── authentication.js ===> should this be authentication.routes.js? or auth.routes.js?
│   └── index.js ===> should this be index.routes.js?
├── server.js
└── views
    ├── error.hbs
    ├── index.hbs
    ├── layout.hbs
    ├── private.hbs
    ├── sign-in.hbs ===> the same as above? naming and subfolder?
    ├── sign-up.hbs
    └── user.hbs ===> should this be profile.hbs?

3.3) Option: Advanced -> MVC -> with AUTH -> passport

├── app.js
├── middleware
│   ├── bind-user-to-view-locals.js
│   └── route-guard.js ===> the same as above, should this be guards?
├── models
│   └── user.js ===> user.model.js or User.model.js?
├── package.json
├── passport-configuration.js ===> should this be in middlewares or configs? should we have 4 separate files for all 4 strategies (local, twitter, github, facebook)?
├── public
│   ├── images
│   │   └── favicon.ico
│   ├── scripts
│   │   └── script.js
│   └── styles
│       └── style.css
├── routes
│   ├── authentication.js ===> naming with .routes.js
│   └── index.js ===> naming with .routes.js
├── server.js
└── views
    ├── error.hbs
    ├── index.hbs
    ├── layout.hbs
    ├── private.hbs
    ├── sign-in.hbs ===> the same as above - login or log-in? should we have auth-views subfolder?
    ├── sign-up.hbs
    └── user.hbs

3.4) Option: Advanced -> REST API -> no AUTH

├── app.js
├── models
│   └── user.js ===> naming with .model.js?
├── package.json
├── public
│   └── images
│       └── favicon.ico
├── routes
│   └── index.js ===> naming with .routes.js?
└── server.js

3.5) Option: Advanced -> REST API -> with AUTH -> basic session and cookies

├── app.js
├── middleware
│   ├── basic-authentication-deserializer.js 
│   ├── bind-user-to-view-locals.js
│   └── route-guard.js
├── models
│   └── user.js
├── package.json
├── public
│   └── images
│       └── favicon.ico
├── routes
│   ├── authentication.js
│   └── index.js
└── server.js

3.5) Option: Advanced -> REST API -> with AUTH -> passport

├── app.js
├── middleware
│   ├── bind-user-to-view-locals.js
│   └── route-guard.js ===> guards?
├── models
│   └── user.js ===> user.model.js or User.model.js
├── package.json
├── passport-configuration.js ===> configs and subfolders and files*
├── public
│   └── images
│       └── favicon.ico
├── routes
│   ├── authentication.js ===> authentication.routes.js or auth.routes.js
│   └── index.js ==> index.routes.js
└── server.js
  • Linking here an issue related to passport files and folders structure:

  • Linking here an issue related to pointed naming conventions: issue #9

Add automated testing of the bootstrapping process

We should add automated tests that check if the app is being correctly bootstrapped with the multiple possible configurations.

This will ensure that any changes or enhancements will not break the bootstrapping process.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.