Skip to content

Latest commit

 

History

History
137 lines (97 loc) · 2.45 KB

File metadata and controls

137 lines (97 loc) · 2.45 KB

Deploy Memory Pool Frontend to Cloudflare Pages

Frontend is prepped and ready to deploy.


What Was Done

✓ Installed @sveltejs/adapter-cloudflare ✓ Updated svelte.config.js to use Cloudflare adapter ✓ Tested build (successful) ✓ Created deployment script ✓ Added Cloudflare MCP servers to Claude config


Deploy Now

Option 1: One Command (Recommended)

cd frontend
./deploy.sh

This will:

  1. Build the app for Cloudflare Pages
  2. Deploy to memory-pool.pages.dev
  3. Give you the live URL

Option 2: Manual Steps

cd frontend

# Build
npm run build

# Deploy
npx wrangler pages deploy .svelte-kit/cloudflare --project-name=memory-pool

First-Time Setup

If this is your first Cloudflare deployment:

  1. Login to Cloudflare:

    npx wrangler login

    This opens a browser for authentication.

  2. Deploy:

    ./deploy.sh

After Deployment

Your frontend will be live at:

  • Production: https://memory-pool.pages.dev
  • Custom domain: Set up in Cloudflare dashboard

Next Steps

  1. Test the live site - Visit the URL
  2. Note: Backend API calls will fail (expected - no backend yet)
  3. Set up Workers backend - Connect D1 database and API routes

Custom Domain (Optional)

To use your own domain:

  1. Go to Cloudflare Dashboard
  2. Navigate to Pages → memory-pool
  3. Click "Custom domains"
  4. Add your domain (e.g., memory.ariaverse.com)
  5. Update DNS as instructed

Environment Variables

For the frontend to connect to the backend (once deployed):

  1. Go to Pages → memory-pool → Settings
  2. Add environment variable:
    PUBLIC_API_URL=https://memory-pool-api.your-workers.dev
    
  3. Redeploy frontend

Troubleshooting

"Not logged in"

npx wrangler login

"Project already exists"

The project name memory-pool is taken. Either:

  • Use a different name: --project-name=memory-pool-aria
  • Or delete the existing project in Cloudflare dashboard

Build fails

# Clean and rebuild
rm -rf .svelte-kit node_modules
npm install
npm run build

What's Next

Once frontend is deployed, we'll:

  1. Create Workers backend (Hono API)
  2. Set up D1 database (SQLite)
  3. Connect frontend to backend
  4. Add full memory-pool features

Status

  • Frontend prepped
  • Frontend deployed (run ./deploy.sh)
  • Backend created
  • Backend deployed
  • Frontend ↔ Backend connected