Spring Boot - Fundamentals - Guided Exercise - CampusBoard – Backend Brains for a Web App #186
akash-coded
started this conversation in
Tasks
Replies: 2 comments
-
**_
_** |
Beta Was this translation helpful? Give feedback.
0 replies
-
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
🧪 Guided Exercise: CampusBoard – Backend Brains for a Web App
🎯 Scenario
You’re building CampusBoard, an internal backend system for a university portal. While the frontend isn’t ready yet, your job is to:
Build backend logic layers (model → service → CLI interface)
Simulate incoming user actions (like
register,enroll,list)Store and retrieve data using Java collections
Prepare it all inside a Spring Boot CLI app (no
@RestControlleryet)This will act as the internal engine for future APIs.
📦 Features to Simulate (CLI Only)
Register new students
List all students
Enroll student to a course
Show course-wise enrolled students
Show enrollment summary (total students per course)
Remove student
🛠 Project Setup
Step 1: Go to https://start.spring.io
Generate a project with:
Group:
com.campusboardArtifact:
campusboardName:
campusboardDependencies:
Spring Boot DevTools(optional)Import into Eclipse.
🔧 Implementation Steps
✅ Step 2: Create Model Classes
📄
Student.java📄
Course.java✅ Step 3: Create Services
📄
StudentService.java📄
CourseService.java📄
EnrollmentService.java✅ Step 4: Main CLI App –
CampusBoardApp.java🧪 Guided Practice Tasks
✅ Add
removeCourse(String code)inCourseService✅ Prevent duplicate student IDs
✅ Prevent enrolling to non-existent course
✅ Add confirmation before deleting student
✅ Count total students overall
✅ Add
updateEmail(int id, String newEmail)method✅ Add simple login (student ID + password map)
📘 What They'll Internalize
Let me know if you want:
-
-
-
Got it. Since you’ve only introduced:.docxor.pdfprintable versionStarter repo / ZIP for students
Auto-testing script to validate output of commands
GET,POST, etc.)reqres.inYou haven’t yet taught them how to build APIs using
@RestController.So let’s design a compelling, creative, multi-part CLI-based Spring Boot exercise that:
🧪 Guided Exercise: CampusBoard – Backend Brains for a Web App
🎯 Scenario
You’re building CampusBoard, an internal backend system for a university portal. While the frontend isn’t ready yet, your job is to:
register,enroll,list)@RestControlleryet)This will act as the internal engine for future APIs.
📦 Features to Simulate (CLI Only)
🛠 Project Setup
Step 1: Go to https://start.spring.io/
Generate a project with:
com.campusboardcampusboardcampusboardSpring Boot DevTools(optional)Import into Eclipse.
🔧 Implementation Steps
✅ Step 2: Create Model Classes
📄
Student.java📄
Course.java✅ Step 3: Create Services
📄
StudentService.java📄
CourseService.java📄
EnrollmentService.java✅ Step 4: Main CLI App –
CampusBoardApp.java🧪 Guided Practice Tasks
removeCourse(String code)inCourseServiceupdateEmail(int id, String newEmail)method📘 What They'll Internalize
Student,Course,Servicelayers@Autowiredservices inCommandLineRunnerList,Map,SetusageBeta Was this translation helpful? Give feedback.
All reactions