This project is the Java backend api scaffold for Code4Community. It is meant to demonstrate API routing and database connection techniques that should be utilized in all C4C Java back ends.
- See https://docs.c4cneu.com/getting-started/setup-local-dev/ for a complete setup guide for:
- Installing, creating, and running a local PostgreSQL database (
backend-scaffold) - Configuring IntelliJ
- Installing Maven
- Installing Java 8
- Configuring project properties files
- Compiling and running the API
- Installing, creating, and running a local PostgreSQL database (
- If
mvn clean installfails because ofspotless:check, then runmvn spotless:applyto apply code formatting corrections before re-runningmvn clean install.
- The
ServiceMain.javaclass has the main method for running the code, this can be run directly in IntelliJ. - Alternatively:
mvn installcreates a jar file at:service/target/service-1.0-SNAPSHOT-jar-with-dependencies.jar.- This can be run from the command line with the command
java -jar service-1.0-SNA.....
- This can be run from the command line with the command
- By default the API is accessible at
http://localhost:8081. - All routes have the
/api/v1prefix to them. - Example: the HTTP request to get all notes would be be:
GET http://localhost:8081/api/v1/notes.