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.
- Features
- Technologies Used
- Prerequisites
- Project Structure
- Installation
- Configuration
- Live Server
- Running the Application
- API Endpoints
- Also checkout PMBIA-Client
- Contributing
- License
- CRUD operations for users and items.
- Database interactions using MongoDb.
- Environment-based configuration.
- Search and sort functionality for instructors and courses
- Node.js
- Express.js
- MongoDB
- JSON Web Token (JWT)
- Node.js and npm installed.
- MongoDB installed and running.
├── .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
-
Clone the repository:
git clone https://github.com/Tanzeebul-Tamim/PMBIA-Server cd PMBIA-Server
-
Install dependencies:
npm install
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
The server is deployed on this following URL
- Start the server:
npm start
- PUT
users/:email
: Save user in db - GET
users/:email
: Get a single user by email
- 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
- GET
/classes
: Get all classes - GET
/classes/total
: Get the total number of classes - GET
/classes/top
: Get top 6 classes
- 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
- POST
/create-payment-intent
: Create payment intent
Visit the client-side repository of the PMBIA website
Feel free to contribute by submitting a pull request. Please ensure that your code follows the project's coding standards and includes relevant tests.
This project is licensed under the MIT License - see the LICENSE file for details.