This is a simple URL Shortener App.
Key Features • Getting Started • Usage • Contributing • License
This is a URL shortener REST API.
- API is built using
- Java 17
- GraalVM native image
- Spring Boot 3.0.0
- Spring Data
- MongoDB is used as the database
- Bucket4j is used for rate limiting
- Alternative using Resilience4j TBD
- Spring Cache is used for caching
- Gradle is used for dependency management
- Swagger UI for API documentation
- Testing
- JUnit 5 tests
- Mockito for mocking
- Testcontainers for integration tests
- Testing URL Redirect TBD
- Quality Assurance
- Jacoco for test coverage
- SonarQube for code quality analysis
- CI/CD
- GitHub Actions
- Security scanning using Snyk
- Containerization & Deployment
- Docker
- Docker Compose
- jib plugin for building Docker images
- Clone the repository
- Make sure pre-requisites are installed
- Java 17+, GraalVM
- MongoDB
- Docker
- Build the application
./gradlew build
- Run the application
./gradlew bootRun
- Build the Docker image
./gradlew jibCustom
- Run the application in Docker
docker-compose up
- This will bring up the application and MongoDB
- Swagger UI
- Sample API calls are provided here. You can import in a tool such as Insomnia or Postman.
Swagger UI is available at http://localhost:8000/api/v1/swagger-ui/index.html
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.