docs: update documentation with Celery/Redis and Makefile changes
- Update Makefile help sections with correct target names (platform-install) - Add Celery infrastructure section to background-tasks.md - Update installation.md with Celery setup instructions and environment vars - Update index.md with comprehensive development commands including Celery - Add Flower monitoring and task queue commands to docs Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -6,8 +6,8 @@ This guide will help you set up the Wizamart Platform for development or product
|
||||
|
||||
Before you begin, ensure you have the following installed:
|
||||
|
||||
- **Python 3.10 or higher**
|
||||
- **Docker and Docker Compose** (required for database)
|
||||
- **Python 3.11 or higher**
|
||||
- **Docker and Docker Compose** (required for database and Redis)
|
||||
- **Git**
|
||||
- **PostgreSQL client tools** (optional, for debugging)
|
||||
|
||||
@@ -97,27 +97,53 @@ docker run --name wizamart-postgres \
|
||||
-d postgres:15
|
||||
```
|
||||
|
||||
### 5. Initialize Database
|
||||
### 5. Initialize Platform
|
||||
|
||||
```bash
|
||||
# Run database migrations
|
||||
python -m alembic upgrade head
|
||||
# Option A: Full installation wizard (recommended)
|
||||
make platform-install
|
||||
|
||||
# Create initial admin user (optional)
|
||||
python scripts/create_admin.py
|
||||
# Option B: Manual steps
|
||||
make migrate-up # Run database migrations
|
||||
make init-prod # Initialize admin, CMS, email templates
|
||||
```
|
||||
|
||||
### 6. Run the Application
|
||||
### 6. Start Background Task Queue (Optional)
|
||||
|
||||
For production or to test background tasks:
|
||||
|
||||
```bash
|
||||
# Start Redis (required for Celery)
|
||||
docker compose up -d redis
|
||||
|
||||
# Start Celery worker (in separate terminal)
|
||||
make celery-worker
|
||||
|
||||
# Start Celery beat scheduler (in separate terminal, for scheduled tasks)
|
||||
make celery-beat
|
||||
|
||||
# Or start both together for development
|
||||
make celery-dev
|
||||
```
|
||||
|
||||
!!! tip "Development without Celery"
|
||||
Set `USE_CELERY=false` in `.env` to use FastAPI BackgroundTasks instead.
|
||||
This is the default and doesn't require Redis.
|
||||
|
||||
### 7. Run the Application
|
||||
|
||||
```bash
|
||||
# Start development server
|
||||
uvicorn main:app --reload --host 0.0.0.0 --port 8000 # or make dev
|
||||
make dev
|
||||
```
|
||||
|
||||
The application will be available at:
|
||||
|
||||
- **API**: http://localhost:8000
|
||||
- **Interactive API Docs**: http://localhost:8000/docs
|
||||
- **Alternative API Docs**: http://localhost:8000/redoc
|
||||
- **Admin Panel**: http://localhost:8000/admin
|
||||
- **Flower** (if Celery enabled): http://localhost:5555
|
||||
|
||||
## Docker Setup
|
||||
|
||||
@@ -192,15 +218,31 @@ pytest -m integration
|
||||
|
||||
## Environment Variables
|
||||
|
||||
### Core Settings
|
||||
|
||||
| Variable | Description | Default | Required |
|
||||
|----------|-------------|---------|----------|
|
||||
| `DATABASE_URL` | PostgreSQL connection string | - | ✅ |
|
||||
| `SECRET_KEY` | Application secret key | - | ✅ |
|
||||
| `JWT_SECRET_KEY` | JWT token secret | - | ✅ |
|
||||
| `ENVIRONMENT` | Environment (dev/staging/prod) | `development` | ❌ |
|
||||
| `DEBUG` | Enable debug mode | `False` | ❌ |
|
||||
| `LOG_LEVEL` | Logging level | `INFO` | ❌ |
|
||||
| `CORS_ORIGINS` | Allowed CORS origins | `["*"]` | ❌ |
|
||||
|
||||
### Celery / Redis
|
||||
|
||||
| Variable | Description | Default | Required |
|
||||
|----------|-------------|---------|----------|
|
||||
| `REDIS_URL` | Redis connection string | `redis://localhost:6379/0` | ❌ |
|
||||
| `USE_CELERY` | Enable Celery task queue | `false` | ❌ |
|
||||
| `FLOWER_URL` | Flower dashboard URL | `http://localhost:5555` | ❌ |
|
||||
| `FLOWER_PASSWORD` | Flower authentication password | `changeme` | ❌ |
|
||||
|
||||
### Stripe Billing
|
||||
|
||||
| Variable | Description | Default | Required |
|
||||
|----------|-------------|---------|----------|
|
||||
| `STRIPE_SECRET_KEY` | Stripe secret key | - | ❌ |
|
||||
| `STRIPE_PUBLISHABLE_KEY` | Stripe publishable key | - | ❌ |
|
||||
| `STRIPE_WEBHOOK_SECRET` | Stripe webhook secret | - | ❌ |
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
|
||||
Reference in New Issue
Block a user