|
| 1 | +# GitHub Codespaces ♥️ Java |
| 2 | + |
| 3 | +Want to try out Java for web development? |
| 4 | + |
| 5 | +This repo builds a Weather App with a REST API (with OpenAPI/Swagger UI) and a web frontend, all in a single Spring Boot application using Thymeleaf. |
| 6 | + |
| 7 | +Everything you do here is contained within this one codespace. There is no repository on GitHub yet. If and when you're ready you can click "Publish Branch" and we'll create your repository and push up your project. If you were just exploring then and have no further need for this code then you can simply delete your codespace and it's gone forever. |
| 8 | + |
| 9 | +### Run Options |
| 10 | + |
| 11 | +[](https://codespaces.new/github/java-codespaces) |
| 12 | +[](https://vscode.dev/redirect?url=vscode://ms-vscode-remote.remote-containers/cloneInVolume?url=https://github.com/github/java-codespaces) |
| 13 | + |
| 14 | +You can also run this repository locally by following these instructions: |
| 15 | +1. Clone the repo to your local machine `git clone https://github.com/github/java-codespaces` |
| 16 | +1. Open repo in VS Code |
| 17 | + |
| 18 | +## Getting started |
| 19 | + |
| 20 | +1. **📤 One-click setup**: [Open a new Codespace](https://codespaces.new/github/java-codespaces), giving you a fully configured cloud developer environment. |
| 21 | +2. **▶️ Run all, one-click again**: Use VS Code's built-in *Run* command and open the forwarded port *8080* in your browser. |
| 22 | + |
| 23 | +3. The web app will be available on port **8080**. Navigate to **/swagger-ui** for interactive API documentation. |
| 24 | + |
| 25 | +4. **🔄 Iterate quickly:** Codespaces updates the server on each save, and VS Code's debugger lets you dig into the code execution. |
| 26 | + |
| 27 | +5. To stop running, return to VS Code, and click Stop in the debug toolbar. |
| 28 | + |
| 29 | +## Project Structure |
| 30 | + |
| 31 | +``` |
| 32 | +sample-app/ |
| 33 | +├── pom.xml # Maven project |
| 34 | +└── src/main/ |
| 35 | + ├── java/com/example/app/ |
| 36 | + │ ├── Application.java |
| 37 | + │ ├── WeatherForecast.java |
| 38 | + │ ├── WeatherForecastController.java |
| 39 | + │ └── WeatherController.java |
| 40 | + └── resources/ |
| 41 | + ├── application.properties |
| 42 | + ├── templates/ |
| 43 | + │ ├── index.html |
| 44 | + │ └── error.html |
| 45 | + └── static/css/site.css |
| 46 | +``` |
| 47 | + |
| 48 | +## Tech Stack |
| 49 | + |
| 50 | +- **Java 25** with Spring Boot 3.5 |
| 51 | +- **API**: Spring Web + springdoc-openapi (Swagger UI) |
| 52 | +- **Web UI**: Thymeleaf + Bootstrap 5 |
| 53 | +- **Build**: Maven |
0 commit comments