A high-performance URL shortening service built with Go, featuring rate limiting and authentication.
- URL shortening with base62 encoding
- JWT-based authentication
- Rate limiting using token bucket algorithm
- Redis caching for improved performance
- PostgreSQL database with optimized indexing
- Swagger API documentation
- Docker multi-container setup
- CI/CD pipeline ready
- Backend: Go with Gin framework
- Database: PostgreSQL
- Cache: Redis
- Container: Docker
- API Documentation: Swagger
- Testing: Go testing framework
.
├── cmd/ # Application entry points
├── internal/ # Private application code
├── pkg/ # Public library code
├── docker/ # Docker configuration
├── docs/ # Documentation
├── scripts/ # Build and deployment scripts
└── tests/ # Test files
- Go 1.24 or higher
- Docker and Docker Compose
- PostgreSQL
- Redis
- Clone the repository
git clone https://github.com/yourusername/ushort.git
cd ushort- Copy environment file and configure
cp .env.example .env- Run with Docker Compose
docker-compose up -dOnce the service is running, access the Swagger documentation at:
http://localhost:8080/swagger/index.html
make testmake buildMIT License