Skip to content
This repository was archived by the owner on Apr 5, 2022. It is now read-only.

Alpha-Archives/cms-nodejs-practise

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

57 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cool Nodejs App

Version Documentation Maintenance License: MIT

Production-ready RESTful APIs using Node.js, Express, and Mongoose.

Built-in features, such as authentication using JWT, request validation, unit and integration tests, continuous integration, docker support, etc. For more details about the features, check the list below.

Features

  • ES9: latest ECMAScript features
  • NoSQL database: MongoDB object data modeling using Mongoose
  • Authentication and authorization: using passport
  • Validation: request data validation using Joi
  • Logging: using winston and morgan
  • Testing: unit and integration tests using Jest
  • Error handling: centralized error handling mechanism
  • Process management: advanced production process management using PM2
  • Dependency management: with Yarn
  • Environment variables: using dotenv and cross-env
  • Security: set security HTTP headers using helmet
  • Santizing: sanitize request data against xss and query injection
  • CORS: Cross-Origin Resource-Sharing enabled using cors
  • Compression: gzip compression with compression
  • CI: continuous integration with Travis CI
  • Linting: with ESLint and Prettier
  • Editor config: consistent editor configuration using EditorConfig

Development

Installation

Clone the repo:

Install dependencies:

cd cms
yarn install

Environment variables:

using .env.example

update environment variables

Commands

Running locally:

yarn dev

Running in production:

yarn start

Testing:

# run all tests
yarn test

# run all tests in watch mode
yarn test:watch

# run test coverage
yarn coverage

Docker:

# run docker container in development mode
yarn docker:dev

# run docker container in production mode
yarn docker:prod

# run all tests in a docker container
yarn docker:test

Linting:

# run ESLint
yarn lint

# fix ESLint errors
yarn lint:fix

# run prettier
yarn prettier

# fix prettier errors
yarn prettier:fix

Author

👤 Alpha Olomi alphaolomi@gmail.com (http://alphaolomi.me)

🤝 Contributing

Contributions, issues and feature requests are welcome!
Feel free to check issues page. You can also take a look at the contributing guide.

Show your support

Give a ⭐️ if this project helped you!

📝 License

Copyright © 2020 Alpha Olomi alphaolomi@gmail.com (http://alphaolomi.me).
This project is MIT licensed.