A delivery-app webpage developed as a Trybe Project.
This is a full-stack project in which front-end, back-end and database were build from scratch.
Through front-end layer, the user can use all back-end layer services. The services include to log in, register new customer, manage sellers, make beverage orders, list orders, check order details, and change order status. Front-end is a Single Page Application and back-end is a RESTful API built in Model-Service-Controller architecture.
The application has 4 user flows:
- Common Flow: comprehends login and register pages.
- Customer Flow: comprehends products, checkout, orders and order details pages.
- Seller Flow: comprehends orders and order details/management pages.
- Administrator Flow: comprehends users management page.
Both front-end and back-end layers have some tests implemented.
- REST API building
- CRUD using ORM.
- MySQL data modeling using Sequelize
- Tables creation and association using Sequelize models
- Integration tests
- Mocked tests
You can use Docker to containerizing the MySQL database. You can see here or in the docs how to install it. MySQL Docker images available here.
Node.js version must be 16 or higher, otherwise the isntallation will fail to prevent version conflict. You can use nvm to Node.js version management. In project root, back-end folder and front-end folder terminals, run:
npm install
In back-end folder, create a .env
file with the following content:
NODE_ENV=development
API_PORT=3001
MYSQL_HOST=localhost
MYSQL_PORT=3306
MYSQL_USER=root
MYSQL_PASSWORD=senha-mysql
MYSQL_DB_NAME=delivery-app
EVAL_ALWAYS_RESTORE_DEV_DB=true
You database must be settled. If using Docker, the container must be running. In back-end folder terminal, run:
npm run dev
In front-end folder terminal, run:
npm start
In this point, a new tab must open in your default web browser and you can use the application.
You must run the testing commands in back-end or front-end folders terminals. To simply test the application, run:
npm run test:coverage:json
To additionally get a coverage report, run:
npm run test:coverage