m0uneer / simple-ecommerce-koa-server

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CI/CD Pipeline codecov

simple-ecommerce-koa-server

Project setup

  • Make sure node version is 16
  • $ npm install

Run

  • $ npm run start

Tests

  • $ npm run test

Development

  • $ npm run start
  • $ npm run dev for hot reloading

Config

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',
    }
  }

What is included

  • 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 and router-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 }. Check lib/response/result.js
  • Storage provider pattern lib/storage to easily implement more providers like AWS 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

Live

Frontend Vue repository

https://github.com/m0uneer/vue-simple-ecommerce-app

About


Languages

Language:JavaScript 100.0%Language:Procfile 0.0%