An open API service indexing awesome lists of open source software.

https://github.com/huythanh0x/udemy_coupon_server_java_spring

100% off Udemy coupons. Access paid courses for free at my site
https://github.com/huythanh0x/udemy_coupon_server_java_spring

free java spring udemy

Last synced: 2 months ago
JSON representation

100% off Udemy coupons. Access paid courses for free at my site

Awesome Lists containing this project

README

          

# Spring Boot: 100% Off Udemy Coupon Server

![Java](https://img.shields.io/badge/Java-17-blue)
![Spring Boot](https://img.shields.io/badge/Spring%20Boot-3.1.1-brightgreen)
![License](https://img.shields.io/badge/License-MIT-yellow)

Spring Boot Coupon Server

The Spring Boot Coupon Server is a robust application designed to crawl 100% off coupons from various websites and validate them using the official Udemy API. It provides several API endpoints for fetching, searching, and filtering these free coupons, with built-in authentication and authorization.
## Features

- **Coupon Crawling**: Automatically fetch coupons from multiple sources.
- **Coupon Validation**: Validate coupons using the Udemy API then filter 100% off coupon only
- **Search Functionality**: Search for coupons by query.
- **Filter Functionality**: Filter coupons based on various criteria.
- **Authentication & Authorization**: Secure access to API endpoints.

## Architecture
- `modules/coupon-domain`: entities, repositories, shared DTOs, Flyway migrations.
- `modules/coupon-api-service`: REST APIs, security/auth, Swagger UI (port 8080).
- `modules/coupon-crawler-service`: crawler workers + schedulers (port 8081).

## Prerequisites
- [Java 17](https://jdk.java.net/17/) or higher (JDK)
- with [Docker](https://www.docker.com/) (for MySQL container)
- or [Docker Compose](https://docs.docker.com/compose/)

## Getting Started

### Clone the Repository

```shell
git clone https://github.com/huythanh0x/udemy_coupon_server_java_spring
cd udemy_coupon_server_java_spring
```

### Start the Services
1. Full stack via Docker Compose (published images - CI parity) - recommended:

```shell
docker compose -f docker-compose.prod.yml up
```

This pulls the API/crawler images built by GitHub Actions (and starts MySQL/Redis plus the observability stack).

2. Local development (run services from source, MySQL via local compose):

```shell
docker compose -f docker-compose.local.yml up -d
./gradlew :modules:coupon-api-service:bootRun --args='--spring.profiles.active=local'
# optional crawler worker
./gradlew :modules:coupon-crawler-service:bootRun --args='--spring.profiles.active=local'
```

## Database migrations

- Schema changes and seed data are managed by [Flyway](https://flywaydb.org/).
- Migration scripts live under `modules/coupon-domain/src/main/resources/db/migration` (e.g., `V1__init_schema.sql`).
- When the Spring Boot app starts it automatically runs pending migrations; no manual SQL is required.
- For local verification you can run `./gradlew :modules:coupon-api-service:flywayMigrate` (or the crawler equivalent) once MySQL is up.

## API Documentation
Once the server is running, navigate to [Swagger UI](http://localhost:8080/swagger-ui/index.html) for interactive docs or fetch the OpenAPI JSON at `/v3/api-docs`. See `docs/getting-started.md` for setup instructions and `docs/business-logic.md` for flow details.

You can also view the live Swagger API documentation at [swagger-ui/index.html](https://coupons-api.thanh0x.com/swagger-ui/index.html).

## Contributing
We welcome contributions! Please see our [Contributing Guidelines](CONTRIBUTING.md) for more details.

## License
This project is licensed under the MIT License. See the [LICENSE](LICENSE.md) file for details.

## Contact
For any inquiries or issues, please open an issue on GitHub or contact us at huythanh0x@gmail.com