Step 5: Determine Services
Phase: plan
Context
You have the confirmed app_spec. Now determine which run402 services the app needs.
What to do
Based on the app spec, determine which run402 services are required. Every app uses at least database + static hosting.
run402 services checklist
| Service | When needed | run402 feature |
|---|---|---|
| Database | Always — every app stores data | Postgres via PostgREST API. Tables created via SQL migration endpoint. |
| REST API | Always — how the frontend reads/writes data | Auto-generated from database schema. CRUD + filters at /rest/v1/{table}. |
| Authentication | When app_spec.features.auth is true |
Email/password signup + login at /auth/v1/signup and /auth/v1/token. |
| Row-Level Security | When users should only see their own data, or when some data is public and some private | RLS templates: user_owns_rows, public_read, public_read_write. |
| File Storage | When app_spec.features.file_uploads is true |
S3-backed storage at /storage/v1/object/{bucket}/{path}. |
| Static Hosting | Always — how the app is deployed | Deploy via POST /v1/deployments. Returns a shareable URL. |
Database table planning
For each data type in app_spec.features.data_types, plan a database table. Consider:
- What columns does each table need?
- Which tables reference each other (foreign keys)?
- Which RLS template applies to each table?
- Does any table need seed data (e.g., default categories, sample content)?
Do NOT tell the user about tables, columns, or SQL. Just note this internally for the build.
Expected output
required_services— List of run402 services needed with details:{ "database": true, "tables": [ {"name": "todos", "columns": ["id", "task", "done", "user_id", "created_at"], "rls": "user_owns_rows"} ], "auth": true, "file_storage": false, "static_hosting": true, "seed_data": false }