This is the backend for Kodemy project (SKNI Kod), written in Spring Boot and Gradle.
Before you can run the project, you will need the following applications:
- Java JDK 17
- Docker / Docker Compose
- IntelliJ IDEA (IDE)
-
Clone the repository to your local machine.
-
To run the project, you have two options:
a. To run the project without any profile, use the following command:
docker-compose up -d
b. To run the project with the
test
profile and skip steps 3, 4, use the following command:docker-compose --profile=test up -d
This command will run the project with profile
test
which will run Database (PostgreSQL) and API (Spring Boot) at the same time. -
To run the project in development mode, set the active profiles in IntelliJ to
dev,local
. -
Run the project in IntelliJ IDEA.
-
Once the project is running, you can access the API documentation (OpenAPI v3):
a. in JSON format, go to
http://localhost:8181/api/docs
,b. in HTML format, go to
http://localhost:8181/api/docs.html
.
- Copy
db.sql
tosql
directory. - To migrate database, use the following commands:
docker exec -it kodemy_postgres_dev /bin/bash psql -U root -W -d kodemy < sql/db.sql