How fiqqar/url-shortener-platform works
This repository implements a FastAPI URL-shortening service. Clients create short links, follow redirects, and retrieve link information or click analytics; Redis stores URL mappings, a sequence counter, and click counts. The graph follows the documented route-to-service workflow and sampled calls. The README is brief, and unsampled files are not treated as evidence for additional product capabilities.
Main entry points: main.py FastAPI app · urls.py URL endpoints · url_service.py URL operations · redis.py Redis connection
Components 15
Application Runtime
- FastAPI app
backend/app/main.py - Request middleware
backend/app/core/middleware.py - Logging setup
backend/app/core/logging.py - Settings
backend/app/core/config.py
HTTP Interface
- URL endpoints
backend/app/api/urls.py - Health endpoint
backend/app/api/health.py - Redis dependency
backend/app/api/dependencies.py - URL schemas
backend/app/schemas/urls.py
URL Domain
- Input validation
backend/app/services/validation.py - URL operations
backend/app/services/url_service.py - Code encoding
backend/app/core/base62.py
Redis Storage
- URL repository
backend/app/repositories/url_repository.py - Redis connection
backend/app/core/redis.py
Other components
- API clients
- Redis
Connections 20
- API clients → FastAPI app: sends requests
backend/app/main.py - FastAPI app → URL endpoints: mounts routers
backend/app/main.py - FastAPI app → Health endpoint: mounts router
backend/app/main.py - FastAPI app → Settings: reads settings
backend/app/main.py - FastAPI app → Redis connection: starts and closes
backend/app/main.py - FastAPI app → Request middleware: registers middleware
backend/app/main.py - FastAPI app → Logging setup: configures logging
backend/app/main.py - Request middleware → Logging setup: logs requests
backend/app/core/middleware.py - URL endpoints → Redis dependency: injects client
backend/app/api/urls.py - URL endpoints → URL schemas: validates and responds
backend/app/api/urls.py - URL endpoints → Input validation: checks codes
backend/app/api/urls.py - URL endpoints → URL operations: calls operations
backend/app/api/urls.py - URL endpoints → Settings: reads base URL
backend/app/api/urls.py - Redis dependency → Redis connection: gets client
backend/app/api/dependencies.py - Health endpoint → Redis connection: checks Redis
backend/app/api/health.py - URL operations → Input validation: validates URLs
backend/app/services/url_service.py - URL operations → Code encoding: encodes IDs
backend/app/services/url_service.py - URL operations → URL repository: reads and writes
backend/app/services/url_service.py - URL repository → Redis: stores mappings and counts
backend/app/repositories/url_repository.py - Redis connection → Redis: connects and pings
backend/app/core/redis.py