This is a RESTful API built using Node.js, Express.js, and MongoDB for managing student and course records. It supports CRUD operations to add, retrieve, update, and delete data.
π Overview
- Master Branch: The production-ready code is on the master branch.
- Required Environment Variables: To run the project, you'll need to create a
.envfile with the following keys:- MONGO_URL: Your MongoDB connection string. π
- PORT: The port number on which the server will run. (Set this to 5000) π
- JWT_SECRET_KEY: A secret key used for authentication with JSON Web Tokens. π
π Features
π¨βπ Student Management
- Register a New Student: Easily add new student records. βοΈ
- Retrieve All Students: Fetch a list of all registered students. π
π Course Management
- Add a New Course: Create new course records. β
- Get All Courses: Retrieve a list of all courses. π
- Get a Course by ID: Fetch details of a specific course. π
- Update Course Details: Modify information for an existing course. βοΈ
- Delete a Course: Remove a course from the system. ποΈ
π οΈ Technology Used
- Node.js: The runtime environment. βοΈ
- Express.js: The web framework for building RESTful APIs. π
- MongoDB: The NoSQL database for storing records. πΎ
- Mongoose: An ODM for MongoDB that simplifies data manipulation. π§
π API Endpoints
| Endpoint | Method | Description |
|---|---|---|
| /api/students/register | POST | Register a new student |
| /api/students | GET | Retrieve all students |
| /api/courses | POST | Add a new course |
| /api/courses | GET | Get all courses |
| /api/courses/:id | GET | Get a course by its ID |
| /api/courses/:id | PUT | Update course information |
| /api/courses/:id | DELETE | Delete a course |
π§ Getting Started
- Clone the Repository
git clone https://github.com/SaadRimeh/-Student-Course-Management-API.git cd your-repo-name
- Install Dependencies
npm install
- Configure the Environment
Create a .env file in the root directory and add the following:
env MONGO_URL=your-mongodb-connection-string PORT=5000 JWT_SECRET_KEY=your-secret-key
- Run the Application
npm start
The server will start on http://localhost:5000. π
π€ Contributing
Contributions are welcome! To get started:
- Fork the repository. π΄
- Create a new branch for your feature or bug fix. π±
- Commit your changes. πΎ
- Open a pull request to merge your changes into the master branch. π
Contact
For questions or suggestions, reach out via:
GitHub: SaadRimeh
Email: [email protected]