Skip to content

As a new car manufacturer on the market, NamX aims to bring new perspectives to the automotive world. So, as developers, we decide to build this company a brand-new, stylish website to showcase their products and services to users and include a back office for administrators to manage pre-orders.

Notifications You must be signed in to change notification settings

abdelhaq-laachari/NamX

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 

Repository files navigation

Logo

README-Template

This is Awsome Project

HUV_VEHICULES

du NAMX HUV la plus grand SUV à pile à combustible. Annonçant jusqu’à 800 km d’autonomie d'une façon futuriste pour entamer sa commercialisation à horizon 2025.

la demande du CEO & Founder at NamX c'est de partage l'expérience immersive de la plus grand HUV .

Table of Contents

Table of Contents
  1. certifications
  2. commandeline
  3. built

HUV_VEHICULES Social Banner

Introduction

Créez une API REST Node.js maintenable et évolutive avec Express et Mongoose.

The project structure is based on MVC and follows it's basic principles but is a little bit different in which instead of having the entities logic spread out into specific folders (models folder containing all models, controllers folder containing all controllers etc...).

Each entity has it's own folder containing all it's core logic . Let's take the User entity as an example:

backend
└── entities
    └── controllers
        ├── userController.js
    └── models
        ├── userModel.js 
    └── routes
         └── userRouter.js

Grâce à cette structure, il est plus facile de maintenir et de faire évoluer plusieurs entités (vous aurez rarement à passer d'un dossier à l'autre pour gérer une entité).

Le projet est livré avec de nombreuses fonctionnalités intégrées, telles que :

  • Authentification avec JWT : fournissant à la fois un jeton d'accès et un jeton de rafraîchissement (envoyé sous forme de cookie http sécurisé uniquement et enregistré dans la base de données).
  • Système de connexion unifié pour la prise en charge de plusieurs rôles d'utilisateurs.
  • Validation utilisant nodemailer.
  • Gestion des erreurs et méthode personnalisée de capture des erreurs.
  • Population optionnelle, sélection des champs à remplir et des champs à renvoyer par les requêtes GET.
  • Plus de détails ci-dessous...

Certifications

Built With

Cette section doit énumérer tous les principaux frameworks/bibliothèques utilisés pour lancer votre projet. Laissez les add-ons/plugins pour la section remerciements. Voici quelques exemples.

  • [![express][express.js]][express-url]

Commande line

npm init

Setup

Usage

*By default, it uses npm to install dependencies.

  • If you prefer another package manager you can pass it as an argument yarn

Then open the project folder and install the required dependencies:

npm init
npm install express

Back to table of Contents

Configuration

Setup your environment variables. In your root directory, you will find a .env:

 .env

Then:

npm  start

La base de données doit être connectée et votre serveur doit être en cours d'exécution. Vous pouvez commencer à tester et à interroger l'API.

npm run start

Back to top

Directory Structure

backend/
├──controllers/                 # Contains mostly global and reusable logic (such as auth and crud)
├── db/                         # Database, routes and server configurations
├── middlewares/                # Express middlewares
├── routes                      # Contains entity templates (default and user type)
├── models/                     # Custom/global type definitions
└── index.ts                    # App entry point (initializes database connection and express server)

Back to table of Contents

Features

API Endpoints

List of available routes:

Auth routes (public):
POST /api/register - register
POST /api/login - login\

User routes (private):
GET /api/users - get all users
GET /api/users/:id - get user by id
PATCH /api/users/:id - update user
DELETE /api/users/:id - delete user

Admin routes:
GET /api/admins - get all admins
GET /api/admins/:id - get admin by id
PATCH /api/admins/:id - update admin
DELETE /api/admins/:id - delete admin

Back to table of Contents

📜 Credits

ZOUHAIR BEGDAR

GitHub Badge LinkedIn Badge

ABDELHAQ LAACHARI

GitHub Badge LinkedIn Badge

ZINEB ABOUMAJED

GitHub Badge LinkedIn Badge

About

As a new car manufacturer on the market, NamX aims to bring new perspectives to the automotive world. So, as developers, we decide to build this company a brand-new, stylish website to showcase their products and services to users and include a back office for administrators to manage pre-orders.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published