Skip to content
Java Spring API to perform CRUD operations through RESTful principles
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


API to perform CRUD operations through RESTful principles. This project began as a side project, evolved into my senior capstone project, and (possibly) will evolve into a SaaS side business.

API Docs:

Why am I releasing the source code?

Most of my software engineering work is found in proprietary code bases at my current job, thus before this project I didn't have much to show in the form of source code I've developed. My previous projects on my repo were either school projects, or side projects from when I was in high school (or earlier)

Entity Relationship Diagram

ER Diagram


First, ensure you have Java 1.8 and Maven installed

Next, run mvn package, which will download the dependencies from the pom.xml file, and package the application to a .jar file.

You can run the .jar file created using java -jar <jar_file_name>, or if you want to have the file external to the compiled jar file (recommended), then run java -Dspring.config.location=<> -jar <jar_file_name>

Note for database setup, provide the correct parameters in, and the tables and needed constraints will be created automatically. Thus, there is no need to run the createTables.sql script.

If you want to run the application as a service, here's an example of what I've done to run the application server using systemd:

  1. Create a .service file in the systemd directory (typically /etc/systemd/system) for our example, we'll name the service agm-api.service

  2. Create a file similar to the one below (change properties where appropriate)

Description=AGM API Server (RESTful Spring Application)

ExecStart=/usr/bin/java -Dspring.config.location=/home/<your_application_server_user>/agm-api/config/ -jar /home/<your_application_server_user>/agm-api/agm-api.jar


Note: <your_application_server_user> is expected to have the minimum permissions required to run the server. If you want to run the server off of port 80 or 443 (which would require root privileges), use either Nginx or Apache to create a reverse proxy by having the application server listen to a local port (such as 8080), and have the web server tunnel requests to the desired elevated port. This way, the application server sits behind a web server, and the user running the application server does not have elevated privileges.

Obviously the settings will vary depending on the requirements of your deployment. This will at least get the server running for testing.


#Only display JSON fields in response bodies that are non-null

# Details for our datasource
spring.datasource.url = jdbc:postgresql://<db_host>/<database>?<ssl_parameters>
spring.datasource.username = <username>
spring.datasource.password = <password>

spring.datasource.testWhileIdle = true
spring.datasource.validationQuery = SELECT 1

# Naming strategy
spring.jpa.hibernate.naming-strategy = org.hibernate.cfg.ImprovedNamingStrategy

# Hibernate properties
spring.jpa.database-platform = org.hibernate.dialect.PostgreSQL94Dialect = true

#spring.jpa.hibernate.ddl-auto = update | create-drop
spring.jpa.hibernate.ddl-auto = update
You can’t perform that action at this time.