Skip to content

Provision production MySQL and configure DATABASE_URL on Vercel #15

Description

@Cbiux

Summary

Production blocker: configure managed MySQL and wire DATABASE_URL on Vercel so the API can persist users, credit events, and platforms.

Without this, /health/ready returns 503 and all Prisma routes fail.


Current state

Check Result
GET https://zcore-api.vercel.app/health 503 degraded — DATABASE_URL missing
Vercel env (zcore-api) ADMIN_SECRET, STELLAR_NETWORK only
Local npm run setup Works with Docker MySQL

Steps

1. Provision MySQL 8.x

Options: PlanetScale, Railway, Aiven, Neon (MySQL mode), or RDS.

Requirements: SSL, reachable from Vercel serverless.

2. Set Vercel env vars (project zcore-api)

Variable Required Notes
DATABASE_URL Yes mysql://user:pass@host:3306/zcore?sslaccept=strict
JWT_SECRET Yes Random secret for wallet sessions (#35 merged)
ADMIN_SECRET Yes Rotate from dev default
STELLAR_NETWORK Yes testnet for now

Optional: UPSTASH_REDIS_REST_URL, UPSTASH_REDIS_REST_TOKEN, METRICS_SECRET.

3. Run migrations

cd Server
DATABASE_URL="mysql://..." npx prisma migrate deploy
npm run prisma:seed   # optional: demo lenders/platforms

4. Verify production

curl https://zcore-api.vercel.app/health/ready        # 200
curl -X POST https://zcore-api.vercel.app/api/auth/challenge \
  -H "Content-Type: application/json" \
  -d '{"walletAddress":"G..."}'

Acceptance criteria

  • /health/ready returns connected: true
  • Register/login with signed auth creates a User row
  • Dashboard profile loads from production dapp
  • Migrations applied; schema matches Server/prisma/migrations/
  • Secrets documented in Docs/vercel-deploy.md (no values committed)

Related

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    GrantFox OSSPart of the GrantFox OSS programMaybe RewardedThis issue may receive a reward or bountyOfficial CampaignPart of an official ZCore campaignenhancementNew feature or requesthelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions