Skip to content

This repository hosts the server-side codebase for the PMBIA website. Serving as the backend component of the project, it encompasses the logic, APIs, user authentication and database interactions necessary to power the website's functionality.

License

Notifications You must be signed in to change notification settings

Tanzeebul-Tamim/PMBIA-Server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Logo PMBIA - Server Side

Welcome to the server-side repository of the PMBIA (Professional Mountain Biking Instructors' Association) website. It is responsible for handling API requests and managing the database functionalities.

Table of Contents

Features

  • CRUD operations for users and items.
  • Database interactions using MongoDb.
  • Environment-based configuration.
  • Search and sort functionality for instructors and courses

Technologies Used

  • Node.js
  • Express.js
  • MongoDB
  • JSON Web Token (JWT)

Prerequisites

  • Node.js and npm installed.
  • MongoDB installed and running.

Project Structure

├── .gitignore          # Lists files for Git to ignore
├── README.md           # Project documentation
├── index.js            # Main entry point of the application
├── package.lock.json   # Exact dependency tree
├── package.json        # Project metadata and dependencies
├── vercel.json         # Vercel deployment settings

Installation

  1. Clone the repository:

    git clone https://github.com/Tanzeebul-Tamim/PMBIA-Server
    cd PMBIA-Server
  2. Install dependencies:

    npm install

Configuration

Create a .env file in the root of the server directory and add the following environment variables:

PORT=5000
DB_USER=your_db_user
DB_PASS=your_db_password
MONGODB_URI=your_mongodb_connection_string

Live Server

The server is deployed on this following URL

Running the Application

  • Start the server:
    npm start

API Endpoints

Users

  • PUT users/:email: Save user in db
  • GET users/:email: Get a single user by email

Instructors

  • GET /instructors: Get all instructors
  • GET /instructors/total: Get how many instructor accounts have been registered
  • GET /instructors/top: Get top 6 instructors & the number of their total students
  • GET /instructors/:id: Get a single instructor by ID
  • PUT /instructor/updateStudentCount: Update instructors available seat

Classes

  • GET /classes: Get all classes
  • GET /classes/total: Get the total number of classes
  • GET /classes/top: Get top 6 classes

Bookings

  • PUT /book-class: Post a booking
  • GET /book-class/:studentId: Get user bookings
  • GET /book-class/:studentId/:itemId: Get a booking
  • DELETE /book-class/:studentId/:itemId: Delete a booking
  • DELETE /booking/:studentId: Delete all bookings of a user

Payment

  • POST /create-payment-intent: Create payment intent

Also checkout PMBIA-Client

Visit the client-side repository of the PMBIA website

Contributing

Feel free to contribute by submitting a pull request. Please ensure that your code follows the project's coding standards and includes relevant tests.

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

This repository hosts the server-side codebase for the PMBIA website. Serving as the backend component of the project, it encompasses the logic, APIs, user authentication and database interactions necessary to power the website's functionality.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published