Backend Local Setup
Set up the MeetEasy backend for local development.
Prerequisites
- Python 3.10+
- MongoDB 6.0+ (local or Docker)
- Redis 7.0+ (local or Docker)
- Git
Environment Setup
1. Clone and Install
bash
cd meeteasy/src/backend
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -r requirements.txt2. Configure Environment
bash
cp .env.example .envEdit .env with your local settings:
| Variable | Description | Example |
|---|---|---|
MONGODB_URL | MongoDB connection string | mongodb://localhost:27017/meeteasy |
REDIS_URL | Redis connection string | redis://localhost:6379/0 |
JWT_SECRET | Token signing secret | Random string (dev only) |
WECHAT_APP_ID | WeChat mini program AppID | [TBD] |
WECHAT_APP_SECRET | WeChat mini program secret | [TBD] |
3. Initialize Database
bash
python scripts/init_mongodb.pyThis creates indexes and optionally seeds initial data (admin user, sample tenant).
Run Services
API Server
bash
# From src/backend/
uvicorn meeteasy.main:app --reload --host 0.0.0.0 --port 8000API available at http://localhost:8000. OpenAPI docs at http://localhost:8000/docs.
Worker (FastStream)
In a separate terminal:
bash
# From src/backend/
faststream run meeteasy.worker:appThe worker processes async tasks: analytics batching, notifications, file conversion, AI generation.
Socket.IO
Socket.IO runs embedded in the API server process. No separate startup needed.
Verify Setup
bash
# Health check
curl http://localhost:8000/health
# Run tests
pytest tests/ -vDocker Compose (Alternative)
For containerized local development:
bash
# From repository root
docker compose up -d mongodb redis
# Then start API and worker as aboveCommon Issues
| Issue | Solution |
|---|---|
| MongoDB connection refused | Ensure MongoDB is running; check MONGODB_URL |
| Redis connection refused | Ensure Redis is running; check REDIS_URL |
| Import errors | Activate virtualenv; reinstall requirements |
| Port 8000 in use | Change port: --port 8001 |
Development Workflow
- Create a feature branch from
main - Make changes following backend conventions
- Run tests:
pytest tests/ - Format code:
black . && isort . - Type check:
basedpyright - Submit PR with description and test evidence
Next Steps
- Frontend Overview — Set up frontend applications
- Dev Commands — Run Admin, Console, MeetApp locally
- Deployment — Production deployment guide
