Skip to content

Varanasi-Software-Junction/springdemo

Repository files navigation

Spring Starter v2

A clean Spring Boot starter project for learning and sharing.

What this project includes

  • A proper Spring Boot entry point
  • A separate controller class
  • A root endpoint for browser testing
  • A /hello endpoint with a query parameter
  • A /ping endpoint for quick checks
  • Basic tests for context loading and endpoint behavior
  • Gradle Wrapper for easier setup

Tech stack

  • Java 17
  • Spring Boot
  • Gradle Wrapper

Project structure

spring-starter-v2/
├── build.gradle
├── settings.gradle
├── gradlew
├── gradlew.bat
├── gradle/wrapper/
├── src/main/java/live/learnwithchampak/demo/
│   ├── DemoApplication.java
│   └── controller/
│       └── HelloController.java
├── src/main/resources/
│   └── application.properties
└── src/test/java/live/learnwithchampak/demo/
    ├── DemoApplicationTests.java
    └── controller/
        └── HelloControllerTest.java

Run the project

Windows

gradlew.bat bootRun

macOS / Linux

./gradlew bootRun

The application starts on:

http://localhost:8080

Try the endpoints

Open these in your browser:

http://localhost:8080/
http://localhost:8080/ping
http://localhost:8080/hello
http://localhost:8080/hello?name=Champak

Example responses

GET /

Spring Starter v2 is running.

GET /ping

pong

GET /hello

Hello World!

GET /hello?name=Champak

Hello Champak!

Run tests

Windows

gradlew.bat test

macOS / Linux

./gradlew test

Notes

  • Use the Gradle Wrapper instead of a system Gradle install when possible.
  • The first run may download dependencies from Maven Central.
  • Java 17 should be installed and available on your system.

Suggested next steps

  • Add a service layer
  • Return JSON instead of plain text
  • Add POST endpoints
  • Connect a database later

License

This project includes the existing license file from the original demo.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors