A high-performance, asynchronous REST and WebSocket API built with FastAPI. This backend powers the LinkUp ecosystem with real-time matching, secure authentication, and scalable messaging infrastructure.
This project demonstrates expertise in asynchronous Python development, complex database orchestration, and real-time event-driven architecture.
| Feature | Technical Implementation | Engineering Value Demonstrated |
|---|---|---|
| Asynchronous Core | FastAPI + AsyncPG connection pooling | High-concurrency handling, non-blocking I/O, optimized throughput |
| Real-Time Events | WebSockets with polymorphic event validation via TypeAdapter | Robust real-time messaging, typing indicators, and read receipts |
| Low-Latency Caching | Redis integration for state management | Reduced database load, fast access to transient session data |
| Task Orchestration | APScheduler for cron-based background jobs | Reliable execution of periodic events (e.g., "Meet at 8" lobby) |
The backend is structured to handle high-frequency swiping and messaging through a modern, modular design.
- Orchestrates the app lifecycle, managing the database pool and background schedulers.
- Implements versioned routing (
/api/v1) for seamless future updates. - Serves static assets for legal and safety documentation.
- Chat Socket — Manages persistent bi-directional connections for messaging, supporting text content, media metadata, and delivery states.
- Lobby Socket — Powers the synchronous matchmaking lobby with automated waiting periods.
- Security — Implements JWT-based authentication and secure password hashing.
- Data Validation — Leverages Pydantic for strict schema enforcement across all REST and WebSocket payloads.
| Module | Purpose | Key Files |
|---|---|---|
| Auth Service | Multi-stage registration and secure login | auth_endpoints.py, auth_utilities.py |
| Match Engine | Location-based filtering and swipe logic | swipe_endpoint.py, matches_utilities.py |
| Chat Service | Persistence and delivery of real-time interactions | chat_websocket_endpoints.py, chat_utilities.py |
| Controller Layer | Interface for PostgreSQL, Redis, and Cloud Storage | db_controller.py, redis_controller.py |
Requires Python 3.11+.
git clone https://github.com/olildu/linkup-backend.git
cd linkup-backend
pip install -r requirements.txt DB_HOST=localhost
DB_NAME=linkup
REDIS_URL=redis://localhost:6379
SECRET_KEY=your_secret_key uvicorn app.main:app --reloadLinkUp Backend is designed to maintain high availability and data integrity through the following mechanisms:
-
Connection Resilience:
WebSocket connections handle disconnects gracefully, ensuring no messages are lost during network transitions or temporary network failures. -
Automated Maintenance:
APScheduler manages the daily lifecycle of matching events, ensuring consistent engagement and timely updates for the user base. -
Data Protection:
All user interactions are strictly validated using Pydantic models before reaching the persistence layer, preventing malformed or unsafe data from being stored.
