GithubHelp home page GithubHelp logo

livraison-marhaba-api's Introduction

Livraison-Marhaba

This is the backend API for Livraison Marhaba, a restaurant delivery application. It powers the core functionality of order processing, user management, and delivery tracking.

Table of Contents

Getting Started

These instructions will help you set up and run the Livraison Marhaba API on your local machine for development and testing purposes.

1. Installation

1.1. Clone the repository

[email protected]:Ielmarzouqy/Livraison-Marhaba-api.git

1.2. Navigate to the project directory

cd Livraison-Marhaba-api

1.3. Install dependencies

npm install

2. Configuration

2.1. Create copy of .env.example file and rename it to .env

cp .env.example .env

2.2. Update environment variables

Update the environment variables in the .env file as needed for your local setup.

3. Seed the roles and admin user

3.1. Run the seed command

npm run db:seed

4. Run the application

npm run dev

By default, the application will run on port 8080. If you need to change the port, you can do so in the .env file.

File Structure

The project structure follows the Clean Architecture pattern recommended by Uncle Bob. The Clean Architecture separates the concerns of software into layers, where each layer is independent of the other layers.

1. Main Directories

  • src: This directory contains all the source code of the application.
  • test: This directory contains all the tests for the application.

2. Clean Architecture Layers

All the layers in the Clean Architecture are represented in the src directory.

  • Domain: This layer contains the business logic of the application. It is independent of every other layer.
    • Entities: This directory contains all the entities of the application. An entity is a representation of a real-world object in the application. For example, a User entity can represent a real-world user in the application.
  • Application: This layer contains the application-specific business logic of the application. It is dependent on the Domain layer.
    • Use Cases: This directory contains all the use cases of the application. A use case is a specific action that a user can perform in the application. For example, a Login use case can represent the action of a user logging into the application.
    • Interfaces: This directory contains all the interfaces of the application. An interface is a contract that defines how the application interacts with the outside world. For example, a Controller interface can define how the application handles incoming HTTP requests.
  • Adapters: This layer contains all the implementations of the interfaces defined in the Application layer. It is dependent on the Application layer.
    • Controllers: This directory contains all the controllers of the application. A controller is responsible for handling incoming HTTP requests and returning the appropriate HTTP response.
    • Services: This directory contains all the services of the application. A service is responsible for handling the business logic of the application.
  • infrastucture: This layer contains all the external dependencies of the application. It is dependent on the Adapters layer.
    • config: This directory contains all the configuration files of the application.
    • databases: This directory contains all the database-related files of the application.
    • errors: This directory contains all the error classes of the application.
    • gateways: This directory contains all the gateway classes of the application. A gateway is responsible for communicating with an external system.
    • helpers: This directory contains all the helper functions of the application.
    • packages: This directory contains the packages related files of the application. For example, the jwt package contains all the files related to the JSON Web Token (JWT) package.
    • repositories: This directory contains all the repository classes of the application. A repository is responsible for communicating with the database.
    • webserver: This directory contains all the web server related files of the application.
  • scripts: This directory contains all the scripts of the application. A script is a utility that can be run from the command line.

API Documentation

The API documentation is available at https://documenter.getpostman.com/view/25895747/2s9YXpVeAj.

livraison-marhaba-api's People

Contributors

mez901 avatar abrache01 avatar ielmarzouqy 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.