The application follows a modular architecture with the following components:
- FastAPI for REST API endpoints
- SQLModel/SQLAlchemy for database operations
- Abstract Data Provider interface for different data sources
- Alembic for database migrations
The application supports multiple data providers through the DataProviderFactory. Each provider must implement the
DataProvider interface.
- Telegram channels
- (Additional providers can be added by implementing the DataProvider interface)
/api- FastAPI application endpoints and routingmodels.py- Database models and schemas/providers- Data provider implementations/migrations- Alembic database migrationsconfig.py- Configuration file with settings
main.py- Core application logic and servicesapi/main.py- FastAPI application instance and routes
- Activate your virtual environment:
python -m venv venvsource ./venv/bin/activate - Install test dependencies:
pip install -r requirements.txt - Run migrations:
alembic upgrade head - Run app:
uvicorn api.main:app --host 0.0.0.0 --port 80 --reload - When running for the first time, call manual_init.py
Note: Make sure your database is properly configured in config.py before running migrations.
db_connection_string=sqlite:///flats.db
flip_flat_api_hash=
flip_flat_app_id=
flip_flat_channel_id=1676033482