Skip to content

Latest commit

 

History

History
155 lines (107 loc) · 3.33 KB

File metadata and controls

155 lines (107 loc) · 3.33 KB

Quick Start Guide - WineBRT

You're at Step 0: Docker isn't running yet!

Here's what we need to do:

✅ Step 1: Start Docker Desktop

Docker Desktop should be starting now. Wait ~30 seconds for it to fully start.

You'll know it's ready when you see the Docker icon in your menu bar (top right) show as running.

Step 2: Start Infrastructure Services

Once Docker is ready, run:

cd /Users/daniel.yeam/repos/_yeam-app-winebrt
docker-compose up -d

This starts:

  • PostgreSQL (database)
  • OpenFGA (authorization server)
  • MinIO (image storage)

Wait ~10 seconds for services to initialize.

Step 3: Setup OpenFGA Store

Run these commands to create the OpenFGA store and model:

# Create store
STORE_RESPONSE=$(curl -X POST http://localhost:8080/stores \
  -H "Content-Type: application/json" \
  -d '{"name": "winebrt"}')

echo $STORE_RESPONSE

# Extract store ID (you'll see output like: "id":"01JB...")
STORE_ID="PASTE_STORE_ID_HERE"

# Upload authorization model
MODEL_RESPONSE=$(curl -X POST "http://localhost:8080/stores/$STORE_ID/authorization-models" \
  -H "Content-Type: application/json" \
  -d @model.fga)

echo $MODEL_RESPONSE

# Extract model ID (you'll see output like: "authorization_model_id":"01JB...")
MODEL_ID="PASTE_MODEL_ID_HERE"

Step 4: Create .env File

Create backend/.env with these values (replace STORE_ID and MODEL_ID):

cd backend
cat > .env << 'EOF'
DATABASE_URL=postgresql://winebrt:winebrt_dev@localhost:5432/winebrt
FGA_API_URL=http://localhost:8080
FGA_STORE_ID=YOUR_STORE_ID_FROM_STEP_3
FGA_MODEL_ID=YOUR_MODEL_ID_FROM_STEP_3
S3_ENDPOINT_URL=http://localhost:9000
S3_ACCESS_KEY=winebrt
S3_SECRET_KEY=winebrt_dev
S3_BUCKET_NAME=winebrt-images
SECRET_KEY=dev-secret-key-change-in-production-abc123
ALGORITHM=HS256
ACCESS_TOKEN_EXPIRE_MINUTES=30
CORS_ORIGINS=http://localhost:5173,http://localhost:3000
EOF

Step 5: Setup Python Environment

# Still in backend directory
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt

Step 6: Run Database Migrations

# Still in backend directory with venv activated
alembic upgrade head

Step 7: Create MinIO Bucket

# Using Docker to run MinIO client
docker run --rm --network host \
  minio/mc alias set local http://localhost:9000 winebrt winebrt_dev

docker run --rm --network host \
  minio/mc mb local/winebrt-images

Step 8: Start Backend Server

# Still in backend directory with venv activated
uvicorn app.main:app --reload

You should see:

INFO:     Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit)
INFO:     Started reloader process
INFO:     Started server process
INFO:     Waiting for application startup.
INFO:     Application startup complete.

Step 9: Test the API

Open browser to: http://localhost:8000/docs

You should see the Swagger UI with all the API endpoints!


Where You Are Now

✅ Docker Desktop is starting...

⏳ Waiting for Docker to be ready

⬜ Haven't started services yet

⬜ Haven't setup OpenFGA yet

⬜ Haven't created .env yet

⬜ Haven't setup Python yet

⬜ Haven't run migrations yet

⬜ Haven't started backend yet


Let me know when Docker Desktop is running and we'll continue!

You can check by running:

docker ps

If you see a table (even if empty), Docker is ready!