Thank you for contributing! This guide will help you set up the project environment.
-
Clone the repository
git clone https://github.com/Co-App-Team/backend.git
-
Open the project
- Open the project in IntelliJ IDEA.
-
Install Java JDK
- Make sure you have Java JDK 21 installed. You can install it from Oracle or via IntelliJ.
- Configure IntelliJ to use JDK 21 for the project.
If set up properly, your Java SDK version in IntelliJ should look as follows:
-
Set up Gradle
-
If Gradle is not set up in IntelliJ, download and configure it.
-
Set the Gradle version for this project:
./gradlew wrapper --gradle-version 9.2.1
-
Verify Gradle version:
./gradlew --version
-
-
Include Keys
For the application to function properly, you need to include keys inside local.properties under the root of the project:
CoApp
├── Dockerfile
├── README.md
├── build
├── build.gradle
├── docs
├── gradle
├── gradlew
├── gradlew.bat
├── local.properties <----- Include keys here
├── settings.gradle
└── srclocal.properties will have the following fields:
SPRING_DATA_MONGODB_URI=<YOUR_MONGO_DB_URI>
NO_REPLY_EMAIL_PASSWORD=<YOUR_NO_REPLY_EMAIL_PASSWORD>
JWT_SECRET_KEY=<YOUR_JWT_SECRET_KEY>
GOOGLE_GENAI_API_KEY=<YOUR_GOOGLE_GENAI_API_KEY>Important
For TA to run and build our project locally, please reach out to any of our team member for local.properties
-
You're ready to go!
or find src/main/java/com/backend/coapp/CoAppApplication.java and run:
We follow a layered architecture, where an application is organized into horizontal layers, and each layer has a clear responsibility. Ensure to follow the structure as described in ARCHITECTURE.md.
We follow Google Java Style Standard for all Java code to ensure consistency and readability across the project.
Tip
Make sure to format your code using ./gradlew spotlessApply before commit.
Each commit should follow the structure below:
Header # A concise summary, no more than 50 characters
Body # Optional. Wrap lines at 72 characters- Create a branch by following the convention:
task/<issue_number>-<IndicatorOfTheTask>. - Merge to
devwhen the task development is completed. devis only merged tomainon the release day.
Important
All tasks branch need to be merged to dev. Please avoid merging task branch directly to main.
For every API call, except from api/auth/*, the application will expect JWT to be included in the header of the request.
To obtain the JWT token, you will need to log in to the application (if you have not yet created an account, please do so).
After log in successfully, you can find JWT in cookie:
Postman will also cache your cookie here:

If you need to clean cookie and login against, please select Cookies and remove Authorization cookie
To run unit tests, you can either run through IntelliJ or through terminal using this command:
./gradlew testImportant
Since we are using testing container, make sure to have Docker running in the background before triggering the unit tests
To run mutation tests, you can use the following command:
./gradlew pitest To run the load test, please follow the instructions shown in loadtest.js.



