Disclosure: we built CloudHike, so keep that in mind.

Most AI coding sessions end the same way: the agent has a DATABASE_URL, and it does not ask whether that URL is production. If you only have one backend, that backend is production.

A cleaner setup is one project with two environments — development for your laptop, production for the live app — and an agent that is told which one to use. This post walks through that with Claude Code or Cursor, then builds a small public feedback board. Every prompt is below.

What we're building

A feedback board: anyone can read the ideas, signed-in users can post and upvote, Redis rate-limits votes, and the author gets an email when you mark an idea as shipped.

Both backends live in one CloudHike project. Development has its own Postgres, Auth, Redis, Email and .env — that is what your agent and localhost talk to. Production has a separate set of the same services and keys for the live app. Nothing is shared, so a leaked development key opens nothing in production.

What you need

  • A CloudHike account. New accounts get $10 in free credits (eligible accounts, valid for 90 days), plus $5 with the code TUBEGURUJI5, no card needed. The Free plan allows 2 projects; this tutorial uses one.
  • Cursor or Claude Code.
  • Node.js, for a Next.js app.

Step 1: Connect CloudHike to your agent (once)

In the dashboard, open Connect MCP, pick your editor and click Copy with key. That creates your workspace API key and fills it into a snippet. The server is remote (Streamable HTTP), so there is nothing to install.

Claude Code

claude mcp add --transport http --scope user cloudhike https://cloudhike.dev/api/mcp \ --header "Authorization: Bearer icu_your_api_key" 

Run /mcp inside Claude Code to check that it is connected.

Cursor (~/.cursor/mcp.json)

{ "mcpServers": { "cloudhike": { "url": "https://cloudhike.dev/api/mcp", "headers": { "Authorization": "Bearer icu_your_api_key" } } } } 

Open Cursor Settings → MCP and look for the green dot. Snippets for other editors are in the MCP docs.

Treat that key like a password. Keep it in your home folder, not the repo, and revoke it from the same page if it leaks. Nothing can be deleted through MCP: that stays in the dashboard.

Step 2: Scaffold the app

npx create-next-app@latest feedback-board cd feedback-board 

Open the folder in Cursor, or run claude in it. Git-ignore .env.local and .env.production before the first commit.

Step 3: Add a development environment, then let the agent deploy it

Every CloudHike project starts with production. Create a project called feedback-board (or let the agent create it), open the switcher under the project name, and add a development environment. It starts empty, with a banner and a -dev URL.

The MCP tools use production unless you pass an environment argument, so the prompt has to be explicit:

Use the cloudhike MCP tools to set up this feedback board in the development environment. Pass environment: "development" on every tool call.

If the "feedback-board" project does not exist, create it. I already added the development environment from the dashboard. Deploy postgres, auth, redis and email in development only, wait until they are ready, put the .env into .env.local, git-ignore it, and don't show me any secrets. Read the docs with get_docs. Don't write app code yet — just tell me which services are running and which variable names are in .env.local.

The agent will use create_project if needed, then deploy_services, wait_for_services, get_environment and get_docs. Email is transactional only; if the deploy fails, accept the email acceptable use policy on the development Email card and refetch .env.local.

Step 4: Create the tables with a migration

Prefer a migration in git over ad-hoc SQL. query_database is read-only on every plan, so schema changes stay reviewable and can be replayed on production later.

Read https://cloudhike.dev/docs/md/postgres. Using node-postgres, add a migration for ideas (id uuid, title, body, author_id, status: open / planned / shipped, created_at) and votes (idea_id, user_id, created_at, primary key on both). Create the pool once in lib/db.ts, keep it on globalThis so hot reloads reuse it, and use max 5 connections. Run the migration against .env.local only, then describe_table with environment: "development". Do not touch production.

Step 5: Build the board

On the development Auth service, add http://localhost:3000 under Sites users can return to. Then paste:

Build a simple feedback board with the development credentials in .env.local. Public page lists ideas with vote counts. Signed-in users can submit and upvote (one vote per user per idea). Rate-limit votes in Redis (more than 10 a minute returns 429). An admin page can set status to planned or shipped; on shipped, email the author. Read Auth, Redis and Email docs with get_docs first. Only AUTH_URL and AUTH_PUBLISHABLE_KEY may go in browser code, as NEXT_PUBLIC_*. Don't print secrets or change production.

Run it locally, post an idea, vote, and mark one as shipped so you can see the email. If the data looks wrong, explore it with query_database, still with environment: "development".

Step 6: Stand up production, without touching .env.local

When the board works on your machine, switch the dashboard back to production:

Deploy postgres, auth, redis and email on production for "feedback-board" (the MCP default — do not pass environment: "development"). Wait until they are ready. Write the .env into .env.production, git-ignore it, and don't show me the values. Do not overwrite .env.local, run migrations, or write app code yet.

Run the same migration against production yourself when you are ready — do not ask the agent to "just apply it everywhere." Put production variables in your host's dashboard (Vercel or similar). CloudHike App Hosting is coming soon, not live, so the frontend still deploys to your usual host. Add your live URL to Sites users can return to on the production Auth service.

To download an environment by hand, use the project's agent token from the Overview tab. Production is the default; development takes a query parameter. Each download is audit-logged.

curl -fsS -H "Authorization: Bearer <access token>" \ "https://cloudhike.dev/api/projects/<project id>/env" > .env.production curl -fsS -H "Authorization: Bearer <access token>" \ "https://cloudhike.dev/api/projects/<project id>/env?environment=development" > .env.local 

Step 7: Keep the agent on development

A short note in CLAUDE.md or your Cursor rules keeps new sessions in the right place:

This app uses CloudHike as the backend. For local work, always pass environment: "development" to CloudHike MCP tools, and keep keys in .env.local. Never write production secrets into .env.local, and never run migrations against production unless I explicitly ask. 

Guardrails already in the MCP server: production is the default and development is opt-in; query_database is read-only (on Pro, execute_sql can change data, but editors ask first); nothing can be deleted over MCP; .env fetches are audit-logged.

What CloudHike handled

Postgres, Auth, Redis and transactional Email, twice, each with its own keys. One MCP connection, with an environment argument so the agent can stay on development. Import database can also copy Neon or Supabase, and takes a backup first.

Services in both environments come out of one credit balance. If you outgrow Free, Pro is $10/month with $10 of usage credits included and 10 projects, and Scale is $29.99/month with unlimited projects. Details are on the plans and billing page. Payments and App Hosting are coming soon; neither is live yet.

Your turn

Build the board, keep .env.local on development, and ship production only when you mean to. If the agent still reaches for production, tell us in the comments.

👉 Start free at cloudhike.dev. You get $10 in credits at signup, plus $5 more with code TUBEGURUJI5, no card required.

— The CloudHike team