managarten/apps-archived/maerchenzauber/apps/backend/README.md
Till-JS 61d181fbc2 chore: archive inactive projects to apps-archived/
Move inactive projects out of active workspace:
- bauntown (community website)
- maerchenzauber (AI story generation)
- memoro (voice memo app)
- news (news aggregation)
- nutriphi (nutrition tracking)
- reader (reading app)
- uload (URL shortener)
- wisekeep (AI wisdom extraction)

Update CLAUDE.md documentation:
- Add presi to active projects
- Document archived projects section
- Update workspace configuration

Archived apps can be re-activated by moving back to apps/

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-29 07:03:59 +01:00

63 lines
2 KiB
Markdown

# storyteller-backend
## Authentication
This application uses Supabase for authentication, following a multi-Supabase architecture:
1. A central auth Supabase instance ("mana") handles user authentication
2. An application-specific Supabase instance ("maerchenzauber") handles application data
3. The NestJS backend serves as a token exchange middleware and application server
### Setup Requirements
You need to set up two Supabase instances:
1. **mana** - Central authentication service
2. **maerchenzauber** - Application-specific database
See `auth.md` for detailed setup instructions and database schema.
### Environment Variables
Configure the following environment variables (see `.env.example`):
- `MANA_SUPABASE_URL` - URL of the central auth Supabase instance
- `MANA_SUPABASE_ANON_KEY` - Anon key for the central auth Supabase
- `MANA_JWT_SECRET` - JWT secret for verifying tokens from the central auth
- `MAERCHENZAUBER_SUPABASE_URL` - URL of the application Supabase instance
- `MAERCHENZAUBER_SUPABASE_ANON_KEY` - Anon key for the application Supabase
- `MAERCHENZAUBER_JWT_SECRET` - JWT secret for signing tokens for the application Supabase
- `APP_ID` - Application identifier (default: "8d2f5ddb-e251-4b3b-8802-84022a7ac77f")
## Build and Deploy
gcloud config set project storyteller-a1fde
build it and deploy it to cloud run
gcloud builds submit --tag gcr.io/storyteller-a1fde/storyteller-api:v1.5.7
after sucesfull build it shows something like this
gcr.io/storyteller-a1fde/storyteller-api:v1.5.7
then run
gcloud run deploy storyteller-api \
--image gcr.io/storyteller-a1fde/storyteller-api:v1.5.7 \
--region=us-central1 \
--platform=managed \
--allow-unauthenticated
currently deployed: gcr.io/storyteller-a1fde/storyteller-api:v1.5.7
## Testing Request
curl -X POST http://localhost:3000/story \
-H "Content-Type: application/json" \
-d '{
"characters": ["7d800d18-dcb4-4a48-addf-c6a6a88dd7ed"],
"storyDescription": "A fun adventure story about friendship and courage",
"illustratorId": "QsqH9Cyds24rRbAYf6zT",
"authorId": "fKMNQsgKojozOHTnjAbs"
}'