# Development and Test Pipeline

## Environments

### 1. Dev (Local Development)

- Run the app on your local machine for active development.
- Default port: 5000
- Use SQLite for local DB.
- Start with: `python run_dev.py` or `python server.py`
- Environment variables: copy `env.example` to `.env` and fill in values.
- Initialize DB: `python init_db.py`

### 2. Test (Render)

- Deploy to Render for cloud-based testing.
- Set Render root directory to `.` (not a subfolder).
- Use the `Procfile` or Render's web service settings to start the app (e.g., `gunicorn server:app --bind 0.0.0.0:$PORT`).
- Set environment variables in Render dashboard.
- Initialize DB on first deploy: open Render shell and run `python init_db.py`.

## Workflow

1. Develop and test locally (Dev).
2. Commit and push changes to GitHub.
3. Deploy to Render (Test) for cloud testing.
4. Once stable, promote to Production (future step).

## What else to document?

- Production deployment steps (when ready).
- How to roll back a deployment.
- How to update environment variables and secrets.
- Database migration process.
- Backup and restore procedures.
- User management and permissions.
- API endpoints and usage.
- Troubleshooting common errors.

Update this document as your workflow evolves!