{"id":23035161,"url":"https://github.com/ashishpathak2/school-management-system","last_synced_at":"2026-04-09T12:02:55.052Z","repository":{"id":264124934,"uuid":"892440638","full_name":"ashishpathak2/school-management-system","owner":"ashishpathak2","description":"Developed a backend API to manage a school system with features for managing students,  teachers, and classes, along with Cloudinary for storing student and teacher profile pictures. ","archived":false,"fork":false,"pushed_at":"2024-11-22T11:13:31.000Z","size":3792,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-08T12:46:30.653Z","etag":null,"topics":["cloudinary","express-js","jwt-authentication","mongodb","node-js"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ashishpathak2.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-22T05:42:12.000Z","updated_at":"2024-11-22T11:50:18.000Z","dependencies_parsed_at":null,"dependency_job_id":"daf2c15d-33b0-4c76-934a-802ab2b2ad5a","html_url":"https://github.com/ashishpathak2/school-management-system","commit_stats":null,"previous_names":["ashishpathak2/school-management-system"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ashishpathak2%2Fschool-management-system","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ashishpathak2%2Fschool-management-system/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ashishpathak2%2Fschool-management-system/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ashishpathak2%2Fschool-management-system/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ashishpathak2","download_url":"https://codeload.github.com/ashishpathak2/school-management-system/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246900688,"owners_count":20852089,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cloudinary","express-js","jwt-authentication","mongodb","node-js"],"created_at":"2024-12-15T16:38:56.992Z","updated_at":"2025-12-30T20:09:58.939Z","avatar_url":"https://github.com/ashishpathak2.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SETUP PROCESS :\n\n## Prerequisites :\n\n1.  Install Node.js. ( Link : https://nodejs.org/en/download/prebuilt-installer )\n\n2.  Set up a MongoDB Community Server and MongoDB Compass in your system.\n    **_BELOW LINKS WILL AUTOMATICALLY STARTS DOWNLOADING THE REQUIRED SOFTWARE , JUST CLICK ON IT_**\n    1) MongoDB Community Server Link : https://fastdl.mongodb.org/windows/mongodb-windows-x86_64-8.0.3-signed.msi\n    2) MongoDB Compass Link : https://downloads.mongodb.com/compass/mongodb-compass-1.44.7-win32-x64.exe\n\n3.  Create a Cloudinary account. ( Link : https://cloudinary.com/users/register_free )\n\n4.  Install POSTMAN. ( Link : https://www.postman.com/downloads/ )\n\n## STEPS :\n\n1.  Clone the repository\n\n2.  Install dependencies - ```npm install```\n\n3.  Edit the config.env file in the root directory, configure the following variables:\n\n    1. DATABASE_URL=YOUR_DATABASE_URL_HERE\n    2. CLOUDINARY_CLOUD_NAME=YOUR_CLOUDINARY_CLOUD_NAME_HERE\n    3. CLOUDINARY_API_KEY=YOUR_CLOUDINARY_API_KEY_HERE\n    4. CLOUDINARY_API_SECRET=YOUR_CLOUDINARY_API_SECRET_HERE\n\n4.  Run the Server with Command : ```npx nodemon```\n\n5.  Access the application:\n    1. Open POSTMAN and go to localhost:3000\n\n---\n\n# API ENDPOINTS:\n\n## 1. ADMIN API DOCUMENTATION:\n\n**Note:** The first admin will be created automatically.Check your console.\n\n1. **Login**  \n   **Endpoint:** `/admin/login` (POST)  \n   **Request Body:**\n\n   ```json\n   {\n     \"email\": \"admin@example.com\",\n     \"password\": \"admin123\"\n   }\n   ```\n\n2. **Logout**  \n   **Endpoint:** `/admin/logout` (GET)\n\n-----------------------------------------------------\n\n## 2. TEACHER API DOCUMENTATION:\n\n### **Note:**\n\nFor **ADD**, **UPDATE**, and **DELETE** operations, **ADMIN authentication** is required.\n\n---\n\n### 1. GET ALL TEACHERS WITH PAGINATION\n\n**Endpoint:**  \n`/teacher/allteacher/:page` (GET)\n\n- **Description:** Retrieves all teachers with pagination.\n- **Parameters:**\n  - `:page` (optional): Page number. If left blank, defaults to `1`.\n- **Example:**  \n  `/teacher/allteacher/1`\n\n---\n\n### 2. GET TEACHER BY ID\n\n**Endpoint:**  \n`/teacher/getteacherbyid/:id` (GET)\n\n- **Description:** Retrieves teacher details by their unique ID.\n- **Parameters:**\n  - `:id` (mandatory): The unique identifier of the teacher.\n- **Example:**  \n  `/teacher/getteacherbyid/12345`\n\n---\n\n### 3. ADD TEACHER\n\n**Endpoint:**  \n`/teacher/addteacher/` (POST)\n\n- **Description:** Adds a new teacher to the system.\n- **Request Body (form-data):**\n  ```json\n  {\n    \"name\": \"\", // Teacher's name\n    \"email\": \"\", // Teacher's email\n    \"subject\": \"\", // Teacher's subject expertise\n    \"file\": \"\" // Teacher's image (type: file)\n  }\n\n---\n\n### 4. UPDATE TEACHER BY ID\n\n**Endpoint:**  \n`/teacher/updateteacherbyid/:id/` (PUT)\n\n- **Description:** Updates the details of an existing teacher.\n- **Parameters:**\n  - `:id` (mandatory): The unique identifier of the teacher.\n- **Request Body (form-data):**\n  ```json\n  {\n    \"name\": \"\", // Updated name of the teacher\n    \"email\": \"\", // Updated email of the teacher\n    \"subject\": \"\", // Updated subject expertise\n    \"file\": \"\" // Updated image of the teacher (type: file)\n  }\n\n---\n\n### 5. SOFT DELETE TEACHER BY ID\n\n**Endpoint:**  \n`/teacher/deleteteacherbyid/:id` (DELETE)\n\n- **Description:** Soft deletes a teacher by marking them inactive instead of permanently removing them from the system.\n- **Parameters:**\n  - `:id` (mandatory): The unique identifier of the teacher.\n- **Example:**  \n  `/teacher/deleteteacherbyid/12345`\n\n--------------------------------------------------------------------\n\n## 2. CLASS API DOCUMENTATION:\n\n### **Note:**\n\nFor **ADD**, **UPDATE**, and **DELETE** operations, **ADMIN authentication** is required.\n\n---\n\n### 1. GET ALL CLASSES \n\n**Endpoint:**\n`/class/allclass/` (GET)\n\n- **Description:** Retrieves all classes.\n\n---\n\n### 2. GET CLASS BY ID\n\n**Endpoint:**  \n`/class/getclassbyid/:id` (GET)\n\n- **Description:** Retrieves class details by their unique ID.\n- **Parameters:**\n  - `:id` (mandatory): The unique identifier of the class.\n- **Example:**  \n  `/class/getclassbyid/12345`\n\n---\n\n### 3. ADD CLASS\n\n**Endpoint:**  \n`/class/addclass/` (POST)\n\n- **Description:** Adds a new class to the system.\n- **Request Body:**\n  ```json\n  {\n    \"name\": \"\", // Class name\n    \"teacherId\": \"\", // Referencing teacher Id \n    \"studentCount\": \"\", // Class student count\n  }\n\n---\n\n### 4. UPDATE CLASS BY ID\n\n**Endpoint:**  \n`/class/updateclassbyid/:id/` (PUT)\n\n- **Description:** Updates the details of an existing class.\n- **Parameters:**\n  - `:id` (mandatory): The unique identifier of the class.\n- **Request Body:**\n  ```json\n  {\n    \"name\": \"\", // Class name\n    \"teacherId\": \"\", // Referencing teacher Id \n    \"studentCount\": \"\", // Class student count\n  }\n\n---\n\n### 5. DELETE CLASS BY ID\n\n**Endpoint:**  \n`/class/deleteclassbyid/:id` (DELETE)\n\n- **Description:** Deletes a class permanently.\n- **Parameters:**\n  - `:id` (mandatory): The unique identifier of the class.\n- **Example:**  \n  `/class/deleteclassbyid/12345`\n\n-----------------------------------------------------\n\n## 2. STUDENT API DOCUMENTATION:\n\n### **Note:**\n\nFor **ADD**, **UPDATE**, and **DELETE** operations, **ADMIN authentication** is required.\n\n---\n\n### 1. GET ALL STUDENTS WITH PAGINATION AND FILTER\n\n**Endpoint:**  \n`student/allstudent/:classId/:page` (GET)\n\n- **Description:** Retrieves all student with pagination and class filteration.\n- **Parameters:**\n  - `:classId` (mandatory pass- \"all\"): Class Id for filtering students. If filtering not required just pass \"all\" (mandatory)\n  - `:page` : Page number. If left blank, defaults to `1`.\n- **Example:**  \n  - `student/allstudent/all/1` - Display all students.\n  - `student/allstudent/12345/1` - Display the filtered student only.\n\n---\n\n### 2. GET STUDENT BY ID\n\n**Endpoint:**  \n`/student/getstudentbyid/:id` (GET)\n\n- **Description:** Retrieves student details by their unique ID.\n- **Parameters:**\n  - `:id` (mandatory): The unique identifier of the student.\n- **Example:**  \n  `/student/getstudentbyid/12345`\n\n---\n\n### 3. ADD STUDENT\n\n**Endpoint:**  \n`/student/addstudent/` (POST)\n\n- **Description:** Adds a new student to the system.\n- **Request Body (form-data):**\n  ```json\n  {\n    \"name\": \"\", // student's name\n    \"email\": \"\", // student's email\n    \"classId\": \"\", // Refering class's Id\n    \"file\": \"\" // student's image (type: file)\n  }\n\n---\n\n### 4. UPDATE STUDENT BY ID\n\n**Endpoint:**  \n`/student/updatestudentbyid/:id/` (PUT)\n\n- **Description:** Updates the details of an existing student.\n- **Parameters:**\n  - `:id` (mandatory): The unique identifier of the student.\n- **Request Body (form-data):**\n  ```json\n  {\n    \"name\": \"\", // Updated name of the student\n    \"email\": \"\", // Updated email of the student\n    \"subject\": \"\", // Updated Refering class's Id\n    \"file\": \"\" // Updated image of the student (type: file)\n  }\n\n---\n\n### 5. SOFT DELETE STUDENT BY ID\n\n**Endpoint:**  \n`/student/deletestudentbyid/:id` (DELETE)\n\n- **Description:** Soft deletes a student by marking them inactive instead of permanently removing them from the system.\n- **Parameters:**\n  - `:id` (mandatory): The unique identifier of the student.\n- **Example:**  \n  `/student/deletestudentbyid/12345`\n\n--------------------------------------------------------------------\n\n# ADDITIONAL FEATURES :\n\n1) JWT-based authentication for admin access.\n   - Implemented secure authentication for admin access.\n\n2) Protect routes to ensure only authorized users can perform operations.\n   - Restricted ADD, UPDATE, and DELETE operations to authorized admins for all models.\n\n3)  Allow uploading and updating profile images for students and teachers using Cloudinary. \n    - Enabled profile image upload and updates for students and teachers via Cloudinary, managed by admins.\n    - Optimized image URLs stored in the database for efficient retrieval\n    - Automatically deletes old images from Cloudinary when updating profiles of students/teachers.\n\n4) Handle common errors like duplicate entries, invalid data, etc. \n   - Implemented validations to handle duplicate entries, invalid data, and common errors.\n   - Acknowledges room for further improvements in error handling. \n\n--------------------------------------------------------------------------------------------------------------------------------------------------\n\nContributions, issues, and feature requests are welcome!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fashishpathak2%2Fschool-management-system","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fashishpathak2%2Fschool-management-system","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fashishpathak2%2Fschool-management-system/lists"}