RealWorld spec and API.Spincast Framework codebase containing real world examples (CRUD, auth, advanced patterns, etc) that adheres to the
This codebase was created to demonstrate a fully fledged fullstack application built with Spincast Framework including CRUD operations, authentication, routing, pagination, and more. Spincast is a Java framework based on Guice.
We've gone to great lengths to adhere to the Spincast Framework community styleguides & best practices.
For more information on how to this works with other frontends/backends, head over to the RealWorld repo.
How it works
An embedded PostgreSQL instance is provided and is used as the data source. You do not need to install/configure
anything else than the application itself... Everything is included in the application
If at some point you want to reset the data of the application, simply delete the "
dbData" directory which is going to be
Important!: The application uses a self-signed certificate to accept HTTPS requests. In production, you would of course
use a real certificate (for example a Let's Encrypt one). Because of this, the clients you use to
make requests need to accept self-signed certificates! In Postman, you do this by turning OFF :
Settings / SSL certificate verification.
We preferred this little annoyance over serving plain HTTP.
Starting the application
From the root of the project:
mvn clean package -DskipTests
java -jar target/spincast-realworld-1.0.0.jar
You can now start sending requests to the API, for example using Postman.
The application starts on port
12345, using SSL, and its root is: https://localhost:12345/api.
Modifying the configurations
If you want to change the default configurations (which are provided in "
src/main/resources/app-config.yaml", you can create a new "
file, next to "
target/spincast-realworld-1.0.0.jar", and restart the application.
You can run tests using:
You can also run the Postman tests provided by the specs by executing:
But, of course, the best way to run the tests is by opening the project in your favorite IDE and launch them manually... You can then see exactly how they were written:
Analyzing the code
- Import the project as a Maven project in your IDE.
mainmethod is located in the
org.spincast.realworld.Appclass. Add a breakpoint and start a debug configuration to understand how a Spincast application is bootstrapped.
- Add breakpoints in the controllers (
org.spincast.realworld.controllers.*) and start sending requests using Postman or your favorite tool.