Git Product home page Git Product logo

vinisbs / jojos-burger Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jhschier/jojos-burger

0.0 0.0 0.0 15.79 MB

Robust backend for Jojo's Burger restaurant order system. Developed using Node.js, Express, Sequelize (PostgreSQL), and MongoDB (Mongoose), it provides JWT authentication, efficient product and category management, along with order tracking. Note: The frontend (React) is developed in a separate repository.

JavaScript 100.00%

jojos-burger's Introduction

JoJo's Burger - Backend

Overview

The JoJo's Burger Backend serves as the backbone for a comprehensive restaurant order management application. This system encompasses user authentication, efficient product and category management, seamless order tracking, and leverages both PostgreSQL and MongoDB databases. Developed with Node.js and Express, it follows the MVC (Model-View-Controller) pattern, with an emphasis on the Model and Controller components. Additionally, MongoDB is used for order storage through Mongoose.

Table of Contents


Technologies Used

  • Node.js: A robust JavaScript runtime for scalable server-side applications.
  • Express: A minimal and flexible Node.js web application framework.
  • Sequelize: A promise-based Node.js ORM for PostgreSQL, facilitating relational database model management and migrations.
  • PostgreSQL: A powerful open-source relational database system.
  • MongoDB: A NoSQL database employed for storing order-related data, with Mongoose as the ODM (Object-Document Mapper).
  • JWT (JSON Web Tokens): Ensures secure user authentication and authorization.
  • Yup: A JavaScript schema builder aiding in value parsing and validation.
  • Multer: A middleware proficient in handling file uploads.
  • Docker: Utilized for containerization and efficient management of PostgreSQL database instances.
  • Postman: A popular API testing tool instrumental for validating requests and responses.
  • Postbird: A PostgreSQL client for seamless database management and inspection.
  • MongoDB Compass: A MongoDB client offering a visual interface for exploration and interaction with MongoDB databases.
  • Yarn: A fast, reliable, and secure dependency manager for Node.js.

Getting Started

  1. Clone the repository: git clone https://github.com/jhschier/JoJos-Burger.git
  2. Install dependencies: yarn install
  3. Set up a PostgreSQL database: Configure the connection in the database.js file.
  4. Create necessary tables and migrations using Sequelize: yarn sequelize db:migrate
  5. Set up a MongoDB database: Configure the connection in the Order.js schema file.
  6. Run the application: yarn dev

API Endpoints

  • /users:
    • POST: Create a new user.
  • /sessions:
    • POST: Authenticate and log in a user.
  • /products:
    • POST: Create a new product.
    • GET: Retrieve all products.
    • PUT: Update a product.
    • DELETE: Delete a product.
  • /categories:
    • POST: Create a new category.
    • GET: Retrieve all categories.
    • PUT: Update a category.
    • DELETE: Delete a category.
  • /orders:
    • POST: Place a new order.
    • GET: Retrieve all orders.
    • PUT: Update an order.

Authentication

The system employs JWT for user authentication. Users are categorized as admins or normal users. Admins have authority over product and category management, while normal users can place orders. The JWT token is included in most routes (products, categories, and orders) to prevent third parties from accessing information about purchases and orders from other users.


File Uploads

Multer is utilized to manage file uploads. Product and category images are stored in the uploads directory.


Middleware

The application incorporates middleware for JWT-based authentication, ensuring secure access to routes requiring authorization.


Note

  • The current repository focuses on the backend (Model and Controller) aspects. The frontend (View) is being developed separately using React.
  • This README provides a high-level overview. Follow the setup steps in the "Getting Started" section and configure the necessary databases and dependencies accordingly.

jojos-burger's People

Contributors

jhschier avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.