NiceGUI web application with Google OAuth login, backed by SQLite via SQLModel. Supports English and Portuguese (auto-detected, user-switchable).
- Python 3.14
- uv
- Google Cloud OAuth 2.0 credentials
- Go to Google Cloud Console
- Create a new project (or select an existing one)
- Navigate to APIs & Services > Credentials
- Click Create Credentials > OAuth 2.0 Client ID
- Select Web application
- Add
http://localhost:8080/auth/callbackas an Authorized redirect URI - Copy the Client ID and Client Secret
# Install dependencies
uv sync
# Configure environment
cp .env.example .env
# Edit .env with your Google OAuth credentials and a random storage secret
# Run database migrations
uv run alembic upgrade head
# Start the app
uv run vinhaThe app will be available at http://localhost:8080.
Configured in .env (see .env.example). Required variables:
| Variable | Purpose |
|---|---|
GOOGLE_CLIENT_ID |
OAuth 2.0 Client ID |
GOOGLE_CLIENT_SECRET |
OAuth 2.0 Client Secret |
STORAGE_SECRET |
Session signing key (generate with python -c "import secrets; print(secrets.token_urlsafe(32))") |
Optional (with defaults):
| Variable | Default | Purpose |
|---|---|---|
DATABASE_URL |
sqlite:///vinha.db |
Database URL (use absolute path in production) |
PORT |
8080 |
Server port |
RELOAD |
false |
Hot-reload for development |
# Create a new migration after changing models
uv run alembic revision --autogenerate -m "description of changes"
# Apply migrations
uv run alembic upgrade head
# Roll back one migration
uv run alembic downgrade -1Each server instance is provisioned with scripts/setup-instance.sh, which creates an isolated Linux user, app directory, database directory, and systemd service. The runtime user can only write to the database directory.
# Provision a new instance (run as root)
curl -fsSL https://raw.githubusercontent.com/jassg-to/vinha/main/scripts/setup-instance.sh | sudo bash -s <instance> <port> https://github.com/jassg-to/vinha.git
# Or from a local clone
sudo ./scripts/setup-instance.sh <instance> <port> https://github.com/jassg-to/vinha.git
# Remove an instance
sudo ./scripts/teardown-instance.sh <instance>Prerequisites: uv installed system-wide, a reverse proxy for HTTPS.