Skip to content

Latest commit

 

History

History
373 lines (342 loc) · 14.8 KB

readme-en.md

File metadata and controls

373 lines (342 loc) · 14.8 KB
🇺🇸 English
🇧🇷 Português

luk4x-repo-status luk4x-repo-license

🍔 CodeBurger v2


Video   |    Technologies   |    About   |    Pages   |    Routes   |    Cloning   |    Contact


📹 Project Video Presentation

Click to check out the presentation video on Youtube!

🚀 Technologies Used

Below are the 19 main technologies used in the development of the project, and their reasons

Vite.js icon
Vite.js
React icon
React.js
React Hook Form icon
React Hook
Form
Styled Components icon
Styled
Components
npm icon
Yup
React Toastify icon
React Toastify
Axios icon
Axios
npm icon
React Elastic
Carousel
HeadlessUI icon
React Router
DOM
Material UI icon
Material UI
Sequelize icon
Sequelize ORM
PostgreSQL icon
PostgreSQL
Mongoose icon
Mongoose ODM
MongoDB icon
MongoDB
Express.js icon
Express.js
Insomnia icon
Insomnia
npm icon
Multer
Javascript icon
Javascript
CSS3 icon
CSS3
HTML5 icon
HTML5

📝 About

Watching the video above will help you understand the explanation!

notepad icon

The application consists of a FullStack project for a web platform for a burger restaurant.

As a Customer, you can create an account (or log in if you already have one), view the registered products and place orders. Does not have access to functionality and administrator pages.
As an Administrator, in addition to being able to do everything a user can, he can manage the platform: adding, removing or editing orders and accessing the order history and controlling the status of each order.

📄 Pages (Frontend)

  • pages/SignUp (/cadastrar): Through this page the user can create an account;
  • pages/Login (/entrar): Through this page the user can log in to their account;
  • pages/Home (/): Page that the user is redirected to after creating or logging into their account. Basically, the user can see the product categories and go to the /produtos page with the clicked category already selected, and can also see the products on offer and easily place an order by going to the /carrinho with the clicked product already added to the cart;
  • pages/Products (/produtos): On this page the user can see all the products registered on the platform, filter them by category, and add them to the shopping cart if they wish;
  • pages/Cart (/carrinho): On this page the user can see pertinent information about the purchase, such as all the products in their cart, the total price and purchase fee, and can also increase the quantity of a product, and place the order if you wish;
  • pages/Admin (/gestao): On this page, the administrator can manage the platform, adding, removing or editing orders and accessing the order history and controlling the status of each order;

All pages have their proper validations and treatment of possible errors.
The logic used in the private routes was: /register and /enter are only available to users who are not logged in, the others are only available to logged in users, and /gestao is only available to administrators.
I developed from scratch the components that are used on almost all pages, except /gestao, where I chose to use MUI.

📄 Routes (Backend)

  • controllers/UserController (POST: /users): Waits to receive the data necessary to create a user (name, email, password, admin), creates a user and returns the new created user;
  • controllers/SessionController (POST: /sessions): Waits to receive the data necessary to log in to the user (email, password), and returns the user information (and a token);
  • controllers/ProductController:
    • (POST: /products): Waits to receive the data necessary to create a product (name, price, category_id, offer, file)), creates a product, and returns the new product created, and the list updated with all the products;
    • (PUT: /products/:id): Waits to receive the data necessary to edit a product (name, price, category_id, offer, file), edits the product with id received, and returns the updated product, and the updated list with all products;
    • (DELETE: /products/:id): Waits to receive the id of the product to be deleted, deletes that product, and returns the deleted product;
    • (GET: /products): Returns the list of registered products;
  • controllers/CategoryController:
    • (POST: /categories): Waits to receive the data necessary to create a category (name, file), creates a category, and returns the new created category;
    • (PUT: /categories/:id): Waits to receive the data necessary to edit a category (name, file), edits the category of id received, and returns the updated category;
    • (GET: /categories): Returns the list of registered categories;
  • controllers/OrderController:
    • (POST: /orders): Waits to receive the data necessary to create an order (a list of objects with id, quantity), formats the list of objects, populating each object with the product data of each id, creates the order, containing the purchased products, the user who purchased it and the initial status of order-placed, and returns the order;
    • (PUT: /orders/:id): Waits to receive the new status of the order, updates the order id received, and returns the updated order;
    • (GET: /orders): Returns the list of orders placed;

All routes have their proper validations and treatment of possible errors.
Middleware to assist with authentication is used in almost all routes except /users and /sessions.

📖 Cloning the Project

To clone and run this project on your computer you will need Git and Node.js v20.10.0 or higher and previously installed.
After that, in the terminal:

# Clone this repository with:
> git clone https://github.com/Luk4x/codeburger-v2.git

# Enter the repository with:
> cd codeburger-v2

# Now being at the root of the project, create a `.env` file, following the `.env.example` of each project as a base.

# Run the Backend in another terminal:
> cd backend
> yarn install
> yarn dev

# Run the Frontend in another terminal:
> cd frontend
> yarn install
> yarn dev

# Once this is done, you will be able to access the project at: http://localhost:5173/

📞 Contributor Contact

Vitrine.Dev 🪟
Luk4x Github Photo
Lucas Maciel
🪧 Vitrine.Dev Lucas Maciel
✨ Nome 🍔 CodeBurger v2
🏷️ Tecnologias vite.js, react.js, react hook form, styled-components, yup, react-toastify, axios, react-elastic-carousel, react-router-dom, material ui, sequelize orm, mongoose odm, postgres sql, mongo db, express.js, insomnia, multer, javascript, css, html
📷 Img vitrine.dev thumb

Back to Top