- Make sure node version is 16
$ npm install
$ npm run start
$ npm run test
$ npm run start
$ npm run dev
for hot reloading
By default, without any code customization, the app will start with sqlite connection,
but we can customize by creating local.js
module.exports = {
Db: {
// url: 'mysql://user:pass@localhost/dbname',
// dialect: 'mysql',
// url: 'postgres://user:pass@localhost/dbname',
// dialect: 'postgres',
url: 'sqlite:db.sqlite',
dialect: 'sqlite',
}
}
- RESTful products crud with serving product images
- User register/login with JWT
- Validation with Joi
- Refreshing token mechanism
- Architectural designs: "Model-Controller API", "Layered" and "Modular" Architectures
- Single point of app configuration management with
Node Config
that supports different environments - Autoload for app models and controllers (Routers). Check
db-loader.js
androuter-loader.js
- Basic role-based authorization
- App errors
lib/errors
for better error control - App and db loggers
- Consistent response interface
{ status, messages, validationErrors, data }
. Checklib/response/result.js
- Storage provider pattern
lib/storage
to easily implement more providers likeAWS S3
- Unit tests with Jest. Ex: product-service.test.js and user-service.test.js
- Integration test with Jest and Supertest. Ex: product-router.test.js
- Coverage with Codecov
- Linters
- Semantic releasing to manage package versions, releasing, and generate changelog documentation
- CICD Pipeline with GitHub actions. It checks npm audit, lint, run tests, upload to Codecov, deploy, and semantic release
- Conventional commit messages with Git-cz and Husky
- This repository: https://simple-ecommerce-koa-server.herokuapp.com
- Vue Client: https://vue-simple-ecommerce-app.web.app/