Skip to content

Latest commit

 

History

19 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

First Spring Boot Project 🚀

This is my first project using Spring Boot. The main objective of this repository is to establish a Spring Boot application, explore its foundational structure, and develop a simple Student Management API. The project demonstrates how to implement basic CRUD operations for managing student data. Additionally, it provides a step-by-step guide for setting up a development environment in VS Code for Spring Boot development.

📌 Project Overview

  • This project demonstrates how to create a basic Spring Boot application.
  • It includes a simple controller (AppController) that defines various endpoints for student management.
  • The application supports CRUD operations for students, such as adding, updating, retrieving, and deleting students.
  • Helps others learn how to set up VS Code for Spring Boot projects.

Features:

  1. GET /app/student - Returns a single hardcoded student (Bob).
  2. GET /app/all-students - Returns a list of all students.
  3. GET /app/student/{regno} - Returns a student by their registration number.
  4. GET /app/student/by-age - Returns students whose age is between 20 and 23.
  5. GET /app/order/all-students - Returns all students sorted by GPA in descending order.
  6. POST /app/student/add - Adds a new student.
  7. PUT /app/student/update/{regno} - Updates an existing student's information by registration number.
  8. DELETE /app/student/delete/{regno} - Deletes a student by registration number.

🛠️ Technologies Used

  • Spring Boot
  • Java
  • VS Code
  • Maven for build automation

📂 Project Structure

src/
├── main/
│   ├── java/lk/ac/vau/fas/ict/first/Controller/AppController.java  # Main controller with all endpoints
│   ├── java/lk/ac/vau/fas/ict/first/Model/Student.java           # Model class for student data
│   ├── resources/
│   │   ├── application.properties
├── pom.xml                                                       # Maven project configuration file
├── README.md                                                     # Project documentation

🚀 How to Run the Project

  1. Clone the Repository

    git clone https://github.com/LayuruLK/IT3232---SpringBoot-First-Project
    cd first-springboot-project
  2. Open the Project in VS Code

    • Install the Spring Boot Extension Pack from the VS Code Marketplace.
    • Ensure you have Java and Maven installed.
  3. Run the Application

    mvn spring-boot:run
  4. Access the Endpoints Open your browser and visit the following endpoints:

📸 Output Screenshots

1️⃣ Message Endpoint (/app/msg)

Hello SpringBoot

2️⃣ Name Endpoint (/app/name)

Hello SpringBoot

3️⃣ Display Age (/app/age)

Age

4️⃣ Multi-variable Passing Endpoint (/app/course/{uni}/{crs})

University and Course

5️⃣ Get Student Endpoint (/app/student)

Get Bob

6️⃣ Get All Students Endpoint (/app/all-students)

All Students

7️⃣ Get Student by Registration Number (/app/student/{regno})

Student by Registration number

8️⃣ Get Student by Age (/app/student/by-age)

Student By Age

9️⃣ Get All Students by Order of GPA (/app/order/all-students)

Descending order of GPA

🔟 Add New Student (/app/student/add)

New Student

1️⃣1️⃣ Update Existing Student by Registration Number (/app/student/update/{regno})

Update Student

1️⃣2️⃣ Delete Student by Registration Number (/app/student/delete/{regno})

Delete Student

📌 Conclusion

This project serves as an excellent foundation for anyone getting started with Spring Boot. It provides a clear and hands-on approach to understanding key concepts such as setting up a Spring Boot application, creating RESTful APIs, and performing basic CRUD (Create, Read, Update, Delete) operations. With a simple student database, this project demonstrates how to manage data, handle HTTP requests, and implement dynamic endpoints. Whether you're new to Spring Boot or looking to reinforce your skills, this project offers valuable insights into building efficient, maintainable backend applications.

📜 License

This project is open-source and available for learning purposes.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages