mathdio / delivery-app-project

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

🚧 ⚠️ Project style under construction ⚠️ 🚧

The stylization is under construction, thus the front-end user experience must not be the ideal one.

🛵 Delivery App

A delivery-app webpage developed as a Trybe Project.

💻 About this 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.

🛠️ Built with

Chai.js Express.js Jest JSON Web Tokens MySQL Node.js React Router React Testing Library Sequelize Sinon.js

🎯 Used skills

  • REST API building
  • CRUD using ORM.
  • MySQL data modeling using Sequelize
  • Tables creation and association using Sequelize models
  • Integration tests
  • Mocked tests

👥 Developed in group with

🏁 Getting started

🐳 Installing Docker

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.

⬇️ Installing the dependencies

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

🌱 Defining back-end enviroment variables

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

🏃‍♀ Running the application

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.

🧪 Testing

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

About


Languages

Language:JavaScript 80.5%Language:CSS 15.7%Language:Shell 2.4%Language:HTML 1.4%