eb643ad3d2e39f5c02680b9e5f63a8dddc615fc3
Suppress the safe notification permission lint after explicit runtime gating. Opt ChatScreen into Media3 unstable APIs at the file level for the shared media pipeline.
Benya Messenger
Backend foundation for a Telegram-like real-time messaging platform.
Run
- Create and activate Python 3.12 virtualenv.
- Install dependencies: pip install -r requirements.txt
- Configure environment from
.env.example. - Start API: uvicorn app.main:app --reload --port 8000
Celery Worker
Run worker for async notification jobs:
celery -A app.celery_app:celery_app worker --loglevel=info
Quality Gates
- Compile check: python -m compileall app main.py
- Tests: pytest -q
Web Client
- cd web
- copy
.env.exampleto.env - npm install
- npm run dev
Docker Quick Start
Run full stack (web + api + worker + postgres + redis + minio + mailpit):
- cp .env.docker.example .env
- edit
.env(SECRET_KEY, passwords, domain,S3_PUBLIC_ENDPOINT_URL) - docker compose up -d --build
- check backend readiness:
http://localhost:8000/health/livehttp://localhost:8000/health/ready
- Open:
- Web: http://localhost
- API docs: http://localhost:8000/docs
- Mailpit UI: http://localhost:8025
- MinIO console: http://localhost:9001
RUN_MIGRATIONS_ON_STARTUP=true (default in compose) runs alembic upgrade head before backend start.
Production Mode
Use production override to close internal ports (postgres/redis/minio/mailpit/backend):
docker compose -f docker-compose.yml -f docker-compose.prod.yml up -d --build
For media uploads from browser, S3_PUBLIC_ENDPOINT_URL must be reachable by users (for example https://storage.example.com or http://SERVER_IP:9000).
Description
Languages
Kotlin
55%
TypeScript
22.9%
Python
21.3%
CSS
0.6%