- Java Development Kit (JDK) version 21 or more (I preferred version 21)
- Gradle 8 (or more)
- IntelliJ IDEA (or any preferred IDE)
- Kotlin Plugin: (for IntelliJ IDEA’s user)
- Docker (and Docker Compose)
See API_DOC.md and Task MGMT API | Postman
Note:
Import Task MGMT API Collection on Postman
and setup environment variablebase-url
=http://«hostname»:«port»
(e.g.http://localhost:8080
)
Prepare
To build containerized database:
docker-compose -f docker/compose.dev.yml up --build -d
Build
To install packages:
./gradlew clean build
To run application on local machine:
Run
./gradlew bootRun
Create Docker Image
docker build -t «tag_name» .
# Example
docker build -t app-task-mgmt .
Create Container by Docker Command
docker run -d --name «container_name» \
--network «network_name» \
-e POSTGRES_URL=r2dbc:postgresql://«postgres_container_name»:5432/«database_name» \
-p «target_port»/8080 \
«app_image_name»
# For example
docker run -d --name app-task-mgmt \
--network taskmgmt-dev \
-e POSTGRES_URL=r2dbc:postgresql://taskmgmt-db:5432/task-mgmt \
-p 8088:8080 \
app-task-mgmt
Data Table change
- Change Table definition in the
/src/main/resources/schemas.sql
file to relate with the Entity data classes - Access to the containerized database (Postgresql)
docker exec -it taskmgmt-db bash # In the container psql -U postgres -d task-mgmt -W
- Delete tables
\dt+; -- To see every tables DROP TABLE «table_name»; exit; -- When finish dropping tables
- Run project again
./gradlew bootRun # Data table will be re-created follow the `schemas.sql` file
- Validate body request to response 400 Bad Request
- Create DTO for Tasks by UserId
- Create GET
/tasks
API route to retrieve tasks that match specific due dates, statuses, or created/updated users. - Create API Document with Open API or Swagger
- Add the source method in the Logger to (right now we know only source class)
- Actual Result - 2023-11-28T15:35:56.540+07:00 ERROR 39490 --- [actor-tcp-nio-2] d.fresult.taskmgmt.handlers.UserHandler [«METHOD_NAME»] : [User] with ID [222] does not exist)
- Expected Result - 2023-11-28T15:35:56.540+07:00 ERROR 39490 --- [actor-tcp-nio-2] d.fresult.taskmgmt.handlers.UserHandler [byId] : [User] with ID [222] does not exist)
- Make
status
accept only possible 3 values in enum - Hash Password
- Do authorization for most of API routes
- Make
createdBy
andupdatedBy
refer to authentication (token) automatic update by data auditing