Issue Tracker API in 5 minutes
2 min readSep 15, 2024
In this article, I show you how you can create a Spring Boot CRUD API for an issue tracker application.
This is a simple example you can take in other directions as you please.
The steps
- First, clone the template-spring-boot-crud repository into its own directory
- Then, install ProJor if you haven’t already
- Now we’ll create the entities for the issue tracker
Defining the User Entity
Open the .projor/.entities
file in your favorite text editor and add the following:
// A user in the issue tracking system
entity UserAccount {
// The loginname of the user
String loginname
// The email of the user
String email
// The display name of the user
String displayName
}
Defining the Issue Entity
Next, define the Issue
entity:
// An issue reported in the system
entity Issue {
// The title of the issue
String title
// A detailed description of the issue
String description
// The status of the issue (e.g., Open, In Progress, Closed)
String status
// The user who reported the issue
@Join UserAccount reporter
// The user assigned to the issue
@Join UserAccount assignee
}
Defining the Comment Entity
Finally, define the Comment
entity:
// A comment on an issue
entity Comment {
// The content of the comment
String content
// The issue the comment belongs to
@Join Issue issue
// The user who made the comment
@Join UserAccount author
}
- Now open up a terminal in the repo, and run:
projor generate
- Now you can start the API:
gradlew bootRun
Test the API
Let’s test the API by creating some data. We’ll use Postman to send HTTP requests to our API.