Java + Spring Boot Setup Guide
Categories: GitHub PagesLearn how to build a backend using Spring Boot with simple database integration.
1. Clone the Starter Repository
git clone https://github.com/Open-Coding-Society/spring.git
cd spring
./mvnw spring-boot:run
2. Explore the Codebase
Application.java
: app entry pointmodels/
: Java classes for your datacontrollers/
: handle HTTP routesresources/application.properties
: DB configuration
3. Database Options
- Use H2 (in-memory DB) for quick setup
- Switch to PostgreSQL for production
Example H2 config:
spring.datasource.url=jdbc:h2:mem:testdb
spring.jpa.hibernate.ddl-auto=update
4. Test Locally
App runs at http://localhost:8080
.
Test endpoints using Postman or a frontend.
5. Next Steps
- Add RESTful endpoints
- Connect to a cloud-hosted PostgreSQL DB
- Deploy to platforms like Heroku, Render, or AWS