Skip to content

Full stack beverage ecommerce web application developed in React and Node.

Notifications You must be signed in to change notification settings

marllomartin/delivery-app

Repository files navigation

Project Delivery App

Summary

About

Full stack web application of a beverage ecommerce platform developed in a team during my time studying at Trybe.


Features

In this project, the user is capable of:

  • Register on the platform;

  • Log in, if already registered;

    • The user is authenticated when logging in;

    • Each user sensible credentials are hashed when saved in the database;

  • Visualize every product available to purchase;

  • Add the desired product to the cart and checkout;

  • Follow their purchase status (Pending, In Transit, Delivered);

    • Update their purchase status according to their permissions;
  • If the user is an admin, they can register new sellers, visualize and delete existing users;


Technologies Used

Front-End

Back-End

Team

During the development of this project, we had an agile approach using the Kanban method and divided the group into two teams, one for the front-end and the other for the back-end, the Trello platform was used to organize the tasks as well. In addition, a fixed time was defined for holding daily meetings to discuss the progress of the project.


Front-End Back-End
Miguel Santana
Miguel Santana
Yang Vieira
Yang Vieira
Marllon Martins
Marllon Martins
Giovanna Eliz
Giovanna Eliz
Ronny Velárdez
Ronny Velárdez

Running project

Attention!

The Back-End of this project has environment variables. Rename the .env.example file to .env and set its values accordingly to your own settings.

Cloning repository:

git clone git@github.com:marllomartin/delivery-app.git

cd delivery-app

cd app

Installing Front-End dependencies:

cd frontend

npm install

Installing Back-End dependencies:

cd ..

cd backend

npm install

Creating database with Sequelize:

npm run db:reset

Running Back-End:

In the backend directory:

npm run dev

Running Front-End:

In the frontend directory:

npm start

API Documentation

User Registering

  POST /register
Name Description
name The name of the user to be registered
email The email of the user to be registered
password The password of the user to be registered
Body Example

body:

{
  "name": "Cool User",
  "email": "user@user.com",
  "password": "us3R321"
}

Login

  POST /login
Name Description
email The email of an already registered user
password The password of an already registered user
Body Example

body:

{
  "email": "user@user.com",
  "password": "us3R321"
}

Products

Get every available product

  GET /products

Get a specific product by id

  GET /products/${id}
Parameter Description
id The id of the product to be returned

Orders

Get every order by a specific user

  GET /orders/user/${id}
Parâmetro Descrição
id The id of the user to have their orders returned

Get every order by a specific seller

  GET /orders/seller/${id}
Parameter Description
id The id of the seller to have their orders returned

Get a specific order by id

  GET /orders/${id}
Parameter Description
id The id of the order to be returned

Register a new order

  POST /orders
Name Description
sellerId The seller id
totalPrice The total price of the order
deliveryAddress The address which the order will be sent to
deliveryNumber The address number which the order will be sent to
products An array containing all the purchased products
Body Example

body:

{
  "sellerId": 3,
  "totalPrice": "20.50",
  "deliveryAddress": "Rua Teste",
  "deliveryNumber": "20",
  "products": [
    {
      "id": 2,
      "itemTotal": 7.5,
      "name": "Heineken 600ml",
      "price": "7.50",
      "quantity": 1,
      "urlImage": "http://localhost:3001/images/heineken_600ml.jpg"
    }
  ]
}

Update an order status

  PATCH /orders/${id}
Parameter Description
id The id of the order to have its status updated
Name Description
status The new order status
Body Example

body:

{
  "status": "Entregue"
}

Admin

Register a new user

  POST /admin/register
Name Description
name The name of the user to be registered
email The email of the user to be registered
password The password of the user to be registered
role The role of the user to be registered
Body Example

body:

{
  "name": "Cool Seller",
  "email": "cool_seller@email.net",
  "password": "ilovesellingstuff123",
  "role": "seller"
}

Get every non-admin users

  GET /admin/users

Delete an user

  DELETE /admin/users/${id}
Parameter Description
id The id of the user to be deleted