Skip to content

rosesonfire/ReactExpressRedisBoilerplate

Repository files navigation

ReactExpressRedisBoilerplate

First time installation

npm install

To migrate database

npm run migrate

To start application

npm start

To test application

npm test
This will also generate html test coverage reports under coverage and open the reports on browser.

Notes

  • Servers will automatically reload on changes.
  • Browsers will automatically reload on changes in frontEnd folder.
  • Code inside dist is auto-generated, DO NOT make any change in it.
  • Edit code inside src is for development purpose.
  • Database used is mongoDB.

Mode

  • Development mode - set NODE_ENV to development.
  • Production mode - set NODE_ENV to production.

Configuration files

All the necessary configurations like back end server, front end server, database, etc are stored in the configuration folder. A README is available for it.

Database migration

  • To create a new migration run npm run create-migration <name>. This will create a new migration in src/main/db/migrations with the given name.
  • To migrate up run npm run migrate. This will migrate up all the migrations into the database.
  • To migrate down run npm run migrate down <name>. This will migrate down the migration with the given name from the database.
  • To list migrations run npm run list-migrations. This will list all the migrations with their statuses.
  • To prun migrations run npm run prune-migrations. This will remove all the deleted migrations from the database.

Files

  1. .babelrc - the babel configuration file, for configuring es6 traspilation configuration.
  2. config.README.md - describes the configurations.
  3. .eslintrc.json - eslint configuration file.
  4. package.json - npm package configuration. Contains list of dependencies and scripts. A README is available for it.
  5. package.json.README.md - describes the dependencies and scripts in package.json.
  6. README.md - this file, contains necessary documentations.
  7. src - the folder that contains the development code. Edit files in this folder for development purpose.
    1. backEnd - contains the back end code.
      1. main - the back end dev code.
        1. app - contains the mvc application.
          1. controllers - contains the mvc controllers.
          2. services - contains the business logic.
        2. config - configurations of the back-end app like routers, middlewares, etc.
          1. Middlewares - contains the middleware configurations.
          2. Router - HTTP router.
        3. index.js - the code that is run by nodemon for starting the back end server.
        4. ioc - contains inversion of control configurations.
        5. lib - contains customized libraries.
      2. test - the back end tests.
    2. config - contains different configurations.
      1. dev.conf.js - configuration file for devlopment mode.
      2. index.js - configuration resolved based on mode.
      3. prod.conf.js - configuration file production mode.
    3. dataAccess - contains the database schemas.
    4. db - contains the database migration configurations.
      1. migrations - contains the database migration files.
      2. migrate.conf.js - contains the database migration configurations.
      3. MigrationHelper - contains helper functionality for migration.
    5. frontEnd - contains the front end code.
      1. main - the front end dev code.
        1. app - contains the react application.
          1. actions - contains the redux actions.
          2. components - contains the react components.
            1. App - react entry component.
            2. pages - contains the client side routed pages.
          3. middlewares - contains the custom redux middlewares.
          4. reducers - contains the redux reducers.
          5. services - contains the async services.
          6. template.html - landing template for react application.
        2. img - folder for storing custom images.
        3. index.js - the code that is run by webpack dev server for starting the front end server.
        4. registry - contain registered stuff (needs to be improved).
        5. scripts - folder for storing custom js.
        6. styles - folder for storing custom css.
        7. webpack.config.js - contains the webpack configurations.
      2. test - the front end tests.
  8. tsconfig.json - type script configuration. Needed for decorators in vscode.

Generated folders and files

  1. .nyc_output - the folder in which the test coverage data is saved in.
  2. coverage - the folder in which the test covergage reports are generated into.
  3. dist - the folder in which the es6 code is transpiled into and the servers runs on.
  4. node_modules - the folder in which the node modules are installed.
  5. package-lock.json - the compiled npm package configuration file.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published