Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Business Management API

This is a RESTful API for managing a small business, built with Node.js, Express, and MongoDB.

Features

  • User authentication and authorization
  • CRUD operations for businesses and products
  • JWT-based authentication
  • Middleware for protecting routes
  • Global error handling
  • Environment variables support
  • Logging with log4js
  • Unit tests with Jest and Supertest

Installation

  1. Clone the repository:
git clone https://github.com/Efrat6821/node-project.git
cd node-project
  1. Install dependencies:
npm install
  1. Create a .env file and add the following variables:
JWT_SECRET=br!mfc6^GFDSChgvHGF95$%^^&
  1. Start the server:
node app.js
  1. Run tests:
npm test

Endpoints

Auth

  • POST /user/signUp - Sign up a new user
  • POST user/signIn - Sign in an existing user

Business

  • POST /business - Create a new business (Admin only)
  • PUT /business/:id - Update an existing business (Admin only)
  • GET /business - Get all business (Admin only)
  • GET /business/:id - Get business By id(Admin only)

Services

  • POST /service - Create a new service (Admin only)
  • PUT /service/:id - Update an existing service (Admin only)
  • GET /service - Get all services
  • GET /service/:id - Get service by id
  • DELETE /service/:id - Delete service by id(Admin only)

Meetings

  • POST /meeting - Create a new meeting

  • PUT /meeting/:id - Update an existing meeting (Admin only)

  • GET /meeting - Get all meetings

  • GET /meeting/:id - Get meeting by id

  • DELETE /meeting/:id - Delete meeting by id (Admin only)

    Users

  • GET /user - Get all users (Admin only)

License

This project is licensed under the MIT License.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages