Skip to content

Repository files navigation

BasicVids Comments

Comments microservice for BasicVids.

Stack

  • Gunicorn
  • FastAPI
  • SQLModel
  • Redis

Development

Use a virtual environment:

virtualenv venv
source venv/bin/activate
pip install -r requirements.txt

Run tests:

pytest

Run locally:

uvicorn basicvids_comments.main:app --reload

Container

mkdir -p data
cp .env.example data/.env
docker compose up -d --build

The service is available through the shared gateway at:

http://localhost:8080/api/v1/comments/

Configuration

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_comments

Important 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

Healthcheck

http://localhost:8080/comments/health

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages