This project uses nodejs and is built using version v8.15.0. It is not production ready as it lacks validations, metrics and cicd pipeline.
A deployed version of the app on ec2 can be found below
Install Nodejs and Yarn for your platform/OS
- Clone this repo using git
cd
to the project directory- Execute
yarn install
- Execute
yarn start
- Open
http://localhost:3000/documentation
to view the docs and also test the exposed REST endpoints
Standard.js provides the linting, style & formatting standard for this project.
- REST API (backend) is powered by Fastify module in Nodejs
- The api documentation is constructed and exposed using Swagger
- The database is sqlite and the client used is better-sqlite3
- BDD tests are written using Mocha
- Code coverage is powered by nyc
- The project users nodemon to restart the node process as soon as code changes, which helps in faster development
- Due to time constraints, a minimal front-end is created using Backbonet.js & Require.js and is available at http://localhost:3000/ui/
- Bootstrap is used as the front-end library
- Nodejs event driven model allows asynchronous IO, which is perfect for powering REST APIs (non computative workload).
- Fastify is faster than expressjs & hence, it's used in this project.
- Swagger makes sure the API adheres to a contract and exposes API documentation concisely.
- An order may contain 0 items
- User avatar url is generated dynamically using his name and is saved in db