Before running the application, make sure the following software is installed on your machine:
- Java Development Kit (JDK) 17
- Gradle (Wrapper included in the project)
Download and install Java 17 from the official website:
https://www.oracle.com/java/technologies/javase/jdk17-archive-downloads.html
Verify the installation:
java -versionExpected output:
openjdk version "17"Navigate to the root directory of the project and run:
./gradlew buildFor Windows:
gradlew.bat buildStart the Spring Boot application using:
./gradlew bootRunFor Windows:
gradlew.bat bootRunApplication configurations can be modified in the following file:
src/main/resources/application.yml
Configure the datasource connection:
spring:
datasource:
url: jdbc:mysql://{ip}:{port}/{database_name}
username: {username}
password: {password}spring:
datasource:
url: jdbc:mysql://127.0.0.1:3306/app_db
username: root
password: passwordConfigure multipart upload limits:
spring:
servlet:
multipart:
max-file-size: 5MB
max-request-size: 30MB| Property | Description |
|---|---|
max-file-size |
Maximum allowed file size per upload |
max-request-size |
Maximum total request size |
Configure JWT authentication settings:
jwt:
secret: "custom_secret_64_characters"
access_token_duration: 120000
refresh_token_duration: 7776000| Property | Description |
|---|---|
secret |
Secret key used for JWT signing |
access_token_duration |
Access token expiration time (seconds) |
refresh_token_duration |
Refresh token expiration time (seconds) |
Configure upload directories:
file:
upload-dir: "/var/www/uploads/"
expenses-dir: "expense_receipts"
activity-dir: "activity_receipts"| Property | Description |
|---|---|
upload-dir |
Base directory for uploaded files |
expenses-dir |
Folder for expense receipt uploads |
activity-dir |
Folder for activity receipt uploads |
| Note : Need to have necessary permission to access the directories double check the directory before production |
Configure notification endpoint security:
notification:
endpoint-key: "secret"| Property | Description |
|---|---|
endpoint-key |
Secret key required to send notifications |
Configure the application server port:
server:
port: 4009POST /notifications/send| Header | Description |
|---|---|
X-TENANT-ID |
Tenant identifier of the target user |
Example:
X-TENANT-ID: 0{
"title": "Title Sample",
"body": "Testing notification message",
"userId": 1,
"providerType": "activity_provider",
"endpointKey": "secret_key"
}| Field | Type | Description |
|---|---|---|
title |
String | Notification title |
body |
String | Notification message body |
userId |
Integer | Target user ID |
providerType |
String | Notification provider type |
endpointKey |
String | Secret key required for authentication |
curl --location --request POST 'http://localhost:4009/notifications/send' \
--header 'Content-Type: application/json' \
--header 'X-TENANT-ID: 0' \
--data '{
"title": "Title Sample",
"body": "Testing notification message",
"userId": 1,
"providerType": "activity_provider",
"endpointKey": "secret_key"
}'project-root/
├── src/
├── build.gradle
├── gradlew
├── gradlew.bat
└── src/main/resources/application.yml
If you receive a permission error while running ./gradlew:
chmod +x gradlewIf port 4009 is already occupied, update the following configuration:
server:
port: <new_port>- Use strong JWT secret keys in production.
- Never commit credentials to version control.
- Store sensitive values using environment variables or secret managers.
- Restrict access to the notification endpoint using firewall or API gateway rules.
| Component | Version |
|---|---|
| Java | 17 |
| Spring Boot | Compatible with Java 17 |
| Database | MySQL |
| Build Tool | Gradle |