Comments microservice for BasicVids.
- Gunicorn
- FastAPI
- SQLModel
- Redis
Use a virtual environment:
virtualenv venv
source venv/bin/activate
pip install -r requirements.txtRun tests:
pytestRun locally:
uvicorn basicvids_comments.main:app --reloadmkdir -p data
cp .env.example data/.env
docker compose up -d --buildThe service is available through the shared gateway at:
http://localhost:8080/api/v1/comments/
Project environment is loaded from:
./data/.env
Start from:
./.env.example
Database examples:
# SQLite default
# DATABASE_URL=sqlite:///./data/database.db
# PostgreSQL example
DATABASE_URL=postgresql://basicvids_comments_user:change_me@host.docker.internal:5432/basicvids_commentsImportant variables:
| Variable | Default | Description |
|---|---|---|
DATA_PATH |
./data |
Data directory mounted in container |
DATABASE_URL |
sqlite:///./data/database.db |
Metadata database URL |
REDIS_URL |
redis://localhost:6379/2 |
Redis connection |
AUTH_CURRENT_USER_URL |
http://basicvids_auth:8000/api/v1/users/detail/ |
Auth service current-user endpoint |
http://localhost:8080/comments/health