Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/md-sayeedalam/sports-equipments-server-repo

it is Sports Equipment server side repo.Which is a small and simple backend project.
https://github.com/md-sayeedalam/sports-equipments-server-repo

cors expersjs jwt mongodb nodejs

Last synced: 1 day ago
JSON representation

it is Sports Equipment server side repo.Which is a small and simple backend project.

Awesome Lists containing this project

README

        

# Project Name is : Sports Equipments Store

## Technologies:

- node js
- Mongodb
- Express.js
- jwt

## Models:

### User Model:

- \_id (Object ID): A distinctive identifier generated by MongoDB.
- username (string): The username of the user. This field holds a unique identifier for the user.
- email (string): The email address of the user. This field stores the user's email, ensuring it is unique.
- password (string): The password linked to the user's account, securely hashed. Strong password validation is checked. If the password doesn't match the requirements, custom message is sent as response explaining the requirements.
- role ('user' | 'admin'): The role of the user, which can be either 'user' or 'admin'. This field determines the user's level of access or permissions. The default role is set to 'user'.

### Course Model:

- \_id (Object ID): A distinctive identifier generated by MongoDB.
- title (String): A unique title of the course.
- instructor (String): The instructor of the course.
- categoryId (Object ID): A reference to the category collection.
- price (Number): The price of the course.
- tags(Array of Object): The "tags" field is an array of objects, each having a "name" (string) and "isDeleted" (boolean) property.
- startDate (String): The start date of the course.
- endDate (String): The end date of the course.
- language (String): The language in which the course is conducted.
- provider (String): The provider of the course.
- durationInWeeks (Integer): It is the duration of the course. It is automatically calculated in weeks.
- details (Object):
- level (string): e.g., Beginner, Intermediate, Advanced.
- description (string): Detailed description of the course
- createdBy (Object ID): A reference to the user collection.

### Category Model:

- \_id (Object ID): A distinctive identifier generated by MongoDB.
- name (String): A unique name of the category.
- createdBy (Object ID): A reference to the user collection.

### Review Model:

- \_id (Object ID): A distinctive identifier generated by MongoDB.
- courseId (Object ID): A reference to the course collection.
- rating (Number): Rating, which falls within the range of 1 to 5.
- review (String): The comment or review text provided by the user.
- createdBy (Object ID): A reference to the user collection.

## Validation:

- For validations of the input data, `zwt` was used.

## Endpoints:

### 1.Get All Equipments

- Route: `/equipments`
- Method: GET

### 2.Get Equipment By Id

- Route: `/equipments/:id`
- Method: GET

### 3.Get equipment by email

- Route: `/api/equipments`
- Method: GET

### 4.Update a Specific equipment

- Route: `/equipments/:id`
- Method: PUT

### 5.Delete a Specific equipment

- Route: `/equipments/:id`
- Method: DELETE

### 6.Post a equipment Item

- Route: `/equipments`
- Method: POST

## Dependencies

- "cors": "^2.8.5",
- "dotenv": "^16.4.6",
- "express": "^4.21.1",
- "mongodb": "^6.11.0"

## 1.Installation

Run `npm install` to install project dependencies.

## 2.Environment setup

Create a `.env` file and put your environment variable there. Save the following variable:

NODE_ENV=development
PORT=Your port
DB_USER=Your Mongo Db user name
DB_PASS=Your Mongo Db user password

## Usage

Run `nodemon index.js` to run the project locally.

## GITHUB REPOSITORY LINK (CLIENT SIDE) : https://github.com/programming-hero-web-course2/b10-a10-client-side-Md-SayeedAlam

## GITHUB REPOSITORY LINK (SERVER SIDE) : https://github.com/programming-hero-web-course2/b10-a10-server-side-Md-SayeedAlam

## SERVER SIDE LINK : https://sports-equipments-server-omega.vercel.app/

## LIVE LINK : FIREBASE : https://sports-equipments-client.web.app/

## LIVE lINK: NETLIFY: https://sports-equipments-sayeed.netlify.app/

## LIVE LINK : surge : https://sayeed-sports-equipments.surge.sh/