Backend for a crowd-sourced mobile issue reporting application (Java + Spring Boot).
- Purpose: report nearby issues (with location and optional image), track their lifecycle and comments.
- Backend: Java + Spring Boot (JPA / Hibernate)
- Database: PostgreSQL with PostGIS for location geometry
- Mobile client: Flutter (mobile app not included in this repository)
- Create and view geolocated issues (PostGIS
Pointcolumn) - Issue lifecycle tracked via an enum (
IssueStatus) - JPA entities, Spring Data JPA repositories and REST endpoints
src/main/java/...— backend Java sources (entities, controllers, services)src/main/resources/application.properties— runtime configurationpom.xml— Maven project filecompose.yaml— local development compose (if present)
- Java JDK 17 (recommended LTS) — confirm
java -versionon your machine.- The project
pom.xmlexposes ajava.versionproperty; adjust or confirm it if you need to compile with a different JDK.
- The project
- Maven 3.8+ (or latest). Verify with
mvn -version. - PostgreSQL (13+) with PostGIS extension (geometry column used in
Issueentity). - pgAdmin (optional, for GUI DB management).
- Install PostgreSQL and PostGIS. On Windows you can use the Postgres installer that includes Stack Builder to add PostGIS, or use the distro of your choice.
- Create the database and a user (replace password values):
# run in PowerShell or psql shell (adjust paths/usernames accordingly)
psql -U postgres -c "CREATE DATABASE issue_tracker;"
psql -U postgres -c "CREATE USER tracker_user WITH ENCRYPTED PASSWORD 'tracker_pass';"
psql -U postgres -c "GRANT ALL PRIVILEGES ON DATABASE issue_tracker TO tracker_user;"- Enable PostGIS in the new database (run from
psql -d issue_trackeror pgAdmin query tool):
CREATE EXTENSION IF NOT EXISTS postgis;- Configure connection in
src/main/resources/application.properties(defaults included in the repo):
spring.datasource.url=jdbc:postgresql://localhost:5432/issue_tracker
spring.datasource.username=tracker_user
spring.datasource.password=tracker_pass
spring.jpa.hibernate.ddl-auto=update
- This project uses
spring.jpa.hibernate.ddl-auto=updateby default. That setting lets Hibernate add new columns and tables but it does not remove or rename existing columns. - To remove stale/unused columns manually (recommended for production only after reviewing data), use pgAdmin or psql:
ALTER TABLE issue DROP COLUMN IF EXISTS status;- Alternatively, use a destructive reset in development (DESTROYS DATA):
# in application.properties (temporary)
spring.jpa.hibernate.ddl-auto=createThen restart the app and switch ddl-auto back to update.
- Build with Maven (from project root):
mvn clean install- Run the application (from project root):
mvn spring-boot:run- Confirm the app is running (defaults):
- The server typically starts on
http://localhost:8080unless overridden inapplication.properties.
- Use pgAdmin to connect to
localhost:5432and theissue_trackerdatabase. - Use the Query Tool to run the DDL statements above (PostGIS extension, ALTER TABLE to remove old columns).
- The
Issueentity declares the location column asgeometry(Point,4326); make sure PostGIS is installed and the extension is enabled in the database before the app attempts to persist geometry values.
- If connection gets refused on pgAdmin, then do windows + R and check if Postgres service is running. If not, click on Run.