A modern, secure, and scalable URL shortening service built with Spring Boot, React, and PostgreSQL.
- URL Shortening: Create short, memorable URLs from long ones
- Authentication: Secure login with Google and GitHub OAuth2
- Analytics: Track clicks and usage patterns
- API: RESTful API for programmatic access
- Monitoring: Prometheus metrics and Grafana dashboards
- Security: JWT-based authentication, HTTPS, and secure headers
The project consists of several components:
- Frontend: React-based web application
- Backend: Spring Boot REST API
- Database: PostgreSQL for data persistence
- Infrastructure: Docker, Traefik, Prometheus, and Grafana
- Docker and Docker Compose
- Java 21
- Node.js 22+
- Maven
- Git
-
Clone the repository
git clone https://github.com/yourusername/tinyls.git cd tinyls
-
Set up environment variables
cp url-shortener/.env.example url-shortener/.env cp frontend/.env.example frontend/.env
Edit the
.env
files with your configuration. -
Start the development environment
docker compose watch
-
Access the applications
- Frontend: http://localhost:5173
- Backend API: http://localhost:8000
- Swagger UI: http://localhost:8000/swagger-ui.html
- Adminer (Database): http://localhost:8080
To run the staging environment locally:
docker compose -f docker-compose.yml -f docker-compose.staging.yml up -d
tinyls/
├── frontend/ # React frontend application
├── url-shortener/ # Spring Boot backend application
├── infra/ # Infrastructure configurations
│ ├── traefik/ # Traefik reverse proxy configs
│ ├── prometheus/ # Prometheus monitoring configs
│ └── grafana/ # Grafana dashboard configs
└── docs/ # Project documentation
See Environment Variables for detailed configuration options.
- Create OAuth2 applications in Google and GitHub
- Configure the redirect URIs:
- Google:
https://api.staging.tinyls.com/login/oauth2/code/google
- GitHub:
https://api.staging.tinyls.com/login/oauth2/code/github
- Google:
- Add the client IDs and secrets to your environment variables
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
See Contributing Guide for more details.
The project uses GitHub Actions for continuous integration and deployment:
- Dependency Updates: Weekly automated dependency checks
- Code Formatting: Automated code formatting with Spotless and Prettier
- Testing: Automated testing for backend, frontend, and E2E tests
- Code Review: Automated code quality checks with SonarQube, CodeQL, and Code Climate
- Staging Deployment: Automated deployment to staging environment
- Production Deployment: Automated deployment to production environment
- Development: Local development environment
- Staging: Pre-production testing environment
- Production: Live production environment
- Code coverage requirements
- Security scan results
- Performance benchmarks
- Accessibility standards
This project is licensed under the MIT License - see the LICENSE file for details.