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

https://github.com/ankitkumar910/StudentManagementSystem

Student Management System is a simple project to manage students' data in a college database. This project includes CRUD operations for managing student records.
https://github.com/ankitkumar910/StudentManagementSystem

html5 junit-test lambok maven-pom spring-boot spring-data-jpa

Last synced: about 2 months ago
JSON representation

Student Management System is a simple project to manage students' data in a college database. This project includes CRUD operations for managing student records.

Awesome Lists containing this project

README

          

# Student Management System 📑

> An app to manage students' data in a college database. This project includes **CRUD** operations (Create, Read, Update, Delete) for managing student records. It's built using **Spring Boot**, a powerful framework for creating production-grade applications.

---

### Prerequisites

To set up and run this project, you'll need the following:

1. **Apache Tomcat** 🐅 (embedded in Spring Boot)
2. **MySQL Server** 🦈 (for the database)
3. **IntelliJ IDEA** or **Eclipse** Editor
4. **Java 17** or a higher version
5. **Internet connection** 🛜

---

### Project Setup

Follow these steps to get the project running on your local machine:

1. **Clone the repository:**
```bash
git clone [https://github.com/Ankitk2021/StudentManagementSystem.git](https://github.com/Ankitk2021/StudentManagementSystem.git)
```

2. **Database Configuration:**
* Ensure you have a database named `CollegeDB` set up in your MySQL server.
* Update the database credentials (username and password) in the `application.properties` file located at `src/main/resources/application.properties`.

3. **Import and Run:**
* Open the project in your preferred IDE (IntelliJ or Eclipse). The IDE should automatically recognize it as a Spring Boot project.
* Add any missing dependencies by importing the project with Maven (from the `pom.xml` file).
* Run the project by executing the `main` method in the main Spring Boot application class. 🏃‍♂️‍➡️

---

### API Endpoints

Once the project is running, the application will be accessible at `http://localhost:8080`. Here are the available API endpoints for managing student data:

#### **🟢 `/students`**

This is the base endpoint for all student-related operations.

1. **`GET` Request**
* **Endpoint:** `/students`
* **Description:** Retrieves a list of all students from the database.
* **Response:** A JSON array of student objects.
* **Example JSON Object:**
```json
{
"id": 1,
"rollNo": 56,
"name": "Ankit",
"email": "ankit@email.com",
"course": "BTech",
"branch": "CSE",
"dob": "1878-09-12"
}
```

2. **`POST` Request**
* **Endpoint:** `/students`
* **Description:** Adds a new student record to the database.
* **Request Body:** A JSON object containing the new student's details.
* **Example Request Body:**
```json
{
"name": "Ankit",
"email": "ankit@email.com",
"course": "BTech",
"branch": "CSE",
"rollNo": 56,
"dob": "1878-09-12"
}
```

3. **`PATCH` Request**
* **Endpoint:** `/students/{id}`
* **Description:** Updates one or more specific fields of a student record without replacing the entire object.
* **Request Body:** A JSON object containing only the fields you wish to update.
* **Example:** `http://localhost:8080/students/1` to update the name and email of the student with ID `1`.

4. **`DELETE` Request**
* **Endpoint:** `/students`
* **Description:** Deletes a student record from the database using their unique ID.
* **Example:** `http://localhost:8080/students?id=1` will delete the student with ID `1` . Other fields like ` email ` and `roll-number` can be used to pop the student from the database.

---

### Additional Endpoints

These endpoints provide specific search and retrieval functionality:

1. **`GET` Request: Find by Roll Number**
* **Endpoint:** `/students`
* **Description:** Finds and retrieves a single student by their unique roll number.
* **Example:** `http://localhost:8080/students?rollno=56`

2. **`GET` Request: Find by Name**
* **Endpoint:** `/students`
* **Description:** Searches for and retrieves all students whose name matches the provided name.
* **Example:** `http://localhost:8080/students?name=Ankit`