API Service a modular service that obtains LeetCode problems and study plans from the database.
- API Endpoints: Provides endpoints to obtain LeetCode problems and study plans.
- Database Integration: Connects to a PostgreSQL database to obtain data.
- Docker Support: Can be run in a Docker container.
- Logging: Logs information to the console.
- Testing: Includes unit tests for the service.
- GitHub Actions: Includes a workflow to test the service.
- GDPR Compliance: Ensures data protection and privacy for all individuals.
- Security: Protects against security threats and vulnerabilities.
Before you begin, ensure you have met the following requirements:
- Docker and Docker Compose installed on your machine.
- Java 22 or higher installed on your machine.
- Maven installed on your machine.
- PostgreSQL database.
Clone the Repository
git clone https://github.com/daily-coding-problem/api-service.git
cd api-service
Install Dependencies
mvn -ntp dependency:go-offline
Setup Docker
If you would like to use Docker, ensure Docker and Docker Compose are installed on your machine. If not, follow the installation guides for Docker and Docker Compose.
Build Docker Images
docker compose build api-service
Create the Network
docker network create dcp
Environment Variables
Create a .env
file in the project root with the content found in the .env.example
file.
Start the service with Docker:
docker compose up -d api-service && docker compose logs -f api-service
Or without Docker:
mvn spring-boot:run
Run the tests with the following command:
mvn test -Dspring.profiles.active=test
To test the GitHub Actions via Docker, execute the following:
docker compose down -v && docker compose up --build db github-action-maven-test
This project is licensed under the MIT License - see the LICENSE file for details.