A high-performance URL shortener service built with Python's Starlette framework, designed for asynchronous operations.
- Fast URL shortening using async operations
- RESTful API endpoints
- Docker container support
- PostgreSQL database integration
- Comprehensive test coverage
- Start PostgreSQL container:
docker run -d --name postgres -e POSTGRES_PASSWORD=postgres -p 5432:5432 postgres:alpine
- Pull and run the application container:
docker run -d \
--name url-shortener \
-p 8000:8000 \
-e DATABASE_URL=postgresql://postgres:postgres@host.docker.internal:5432/postgres \
ghcr.io/jakub3628800/shortener:latest
- Create and activate virtual environment:
python -m venv venv
source venv/bin/activate
- Install dependencies:
pip install pip-tools
make install
- Set up environment variables:
cp env.example .env
- Run the application:
make run
The API documentation will be available at http://localhost:8000/docs
when the application is running.
Run the test suite:
make test
The application is containerized and can be deployed using Docker. The latest image is available at:
ghcr.io/jakub3628800/shortener:latest