This codebase demonstrates a fully fledged backend application built with Litestar including CRUD operations, authentication, routing, pagination, and more.
For more information on how this works with other frontends/backends, head over to the RealWorld repo.
Stack:
- Litestar - ASGI framework for routing and server
- msgspec - Fast serialization for request/response schemas
- SQLAlchemy - ORM with PostgreSQL
- pytest - Testing framework
- ruff - Linting and formatting
- ty - Type checking
Project structure:
Conduit/
├── auth/ # Authentication logic
├── db/ # Database models and configuration
├── routes/ # API endpoints
├── schemas/ # Request/response schemas
├── exception_handlers.py # Exception handlers
├── main.py # Server startup logic
└── settings.py # Auth, server, and database settings
The test suite covers unhappy paths for each endpoint. Happy path testing uses the official RealWorld Postman collection.
Prerequisites: Docker and Make
- Set up environment variables:
cp .env.example .env- Run tests:
make test- Start the server:
make up- Verify it's running:
make logsThe API will be available at http://localhost:8000 (or check your .env for the configured port).
