Skills / Backend basics
Backend basics
Build and deploy their first small server. Covers a few real endpoints, frontend requests, current host limits, server-side secrets, and failure handling. Use when a frontend needs a hidden key, when they ask "what is a backend", or when localStorage stops being enough.
Use this skill. Nothing to install.
Don't have an agent? · Raw file: skills/backend-basics.md
Watch the first two minutes
This is how a session goes, including the part everyone is afraid of. Click through it.
Scripted example of a real session.
I've never touched a server
Nobody has until the first one. The skill makes "server" concrete: code that runs on a machine that is always on, holds secrets the browser can't see, and answers HTTP requests. You build two or three endpoints that serve a real need from your existing project, you run every deploy and every curl yourself, and the agent narrates what each command does in one line before you run it. These projects each hide a real backend behind them:
Speedrun game with a real leaderboard
Turn-based game two browsers can play
Booking system for a tutor or coach
What you end up with
An API of your own at a live URL, with your frontend calling it. Here is a finished one for the weather page above: two endpoints, secrets server-side.
$ curl https://maya-api.example.com/api/weather
{"temp_f":74,"condition":"clear","cached":true}
app.get("/api/weather", async (req, res) => {
const r = await fetch(UPSTREAM_URL, {
headers: { "X-Api-Key": process.env.WEATHER_KEY },
});
if (!r.ok) return res.status(502).json({ error: "weather source down" });
res.json(await pickFields(r));
});
$ curl "https://maya-api.example.com/api/weather?city=%20"
HTTP 400 {"error":"city must be a non-empty name"}
- The key never reaches the browser. It lives in the host's env-var settings
and a gitignored local
.env. Open dev tools on the frontend and there is nothing to find. - Bad input gets a 400 with a message. You test the failure yourself with curl, so the first user to type garbage isn't the tester.
- Two endpoints, complete. The skill holds the line at two or three. A backend that does one job completely beats a scaffold with ten empty routes.
Questions people actually ask
Is a server a machine I have to buy or rent?
Not here. You deploy to a free tier: serverless functions or a small Node app on a free host. It runs on someone else's always-on machine, and the free tier's limits are named honestly before you commit to one.
What is CORS and why did the browser block my request?
Browsers refuse to let a page call an API on a different domain unless that API says it's allowed. Your API sends a header granting your frontend permission. The skill expects CORS to bite during wiring and has you fix it and explain why the browser blocked the call in two sentences.
What happens when the free tier sleeps?
Some free hosts idle your instance after inactivity, so the first request after a quiet spell is slow while it wakes. That's the honest price of free, and the skill says so up front. For a personal project it is usually fine; serverless functions mostly avoid it.
Can people hack my API?
Anyone can send it requests, which is why the skill treats unhappy paths as part of the build: bad input gets a 400, a down upstream gets caught, secrets stay in env vars on the server. With two endpoints doing one job, the surface stays small enough to reason about.
Do I have to know Node?
You need the JavaScript you already have from building a frontend. The endpoint code is short, and the agent explains each piece as you write it. If you have no frontend yet, run build a web app first or build the pair together.
Where to go from here
Your API works. Now give it memory and users:
Or build something with a backend at its heart:
Ideas to use it on
- The chore rotation bot — Whose week is it for dishes, trash, or driving is a recurring argument in your house because the rotation lives in everyone's memory.
- A club election people can trust — An election system for a real vote your club actually needs to hold: officers, a budget priority, next semester's event.
- The platform your club actually runs on — A management platform for a club you are actually in: member roster, events with RSVP, attendance taken at real meetings, and announcements from officers.
- A deadline aggregator with its own backend — One page showing every deadline that matters to you and your classmates, pulled from the scattered places they actually live: a teacher's posted calendar (ICS feed), a class platform with an API or export, plus manual entry for the ones that exist only on a whiteboard.
- A bot your Discord server actually uses — Some job in your Discord server is still done by a human: giving newcomers the right role, reminding everyone about game night, keeping a leaderboard for the running joke.
- An inventory system for a family business — A stock-tracking system for a business run by your family or someone you know well: a shop, a stall, a food truck, a workshop.
- The league office for your rec league — A season platform for a rec league you play in or help run: pickup basketball, intramural volleyball, a fantasy league, a chess ladder.
- A newsletter platform with real subscribers — A publishing platform for a newsletter a real group already wants: your neighborhood association's monthly update, your club's weekly recap, the scout troop's announcements.
- A turn-based game two browsers can play — A turn-based game (connect-four, dots-and-boxes, battleship, or a small card duel) that two people play from two different machines.
- An order desk for a real business — An order-request system for a real small business: a family bakery, a neighbor's tailoring shop, a friend's sticker shop.
- A realtime quiz battle for your actual friends — A live quiz in the kahoot shape, but the questions are about what your friend group actually knows: your inside jokes, your team's season, your school, your server's lore.
- Your school's schedule as a calendar feed — Your school publishes its schedule as a PDF, a webpage, and three different emails, and you retype the parts you care about into your phone.
- A buy-and-sell board for your school — A listings board for students at your school: textbooks, calculators, uniforms, concert tickets someone can't use.
- A booking system for a tutor or coach — A booking system for one real person who sells their time: a tutor, a music teacher, a sports coach, maybe you.
- A speedrun game with a real leaderboard — One short, skill-heavy level (a platformer sprint, a maze, a precision mouse course, a typing gauntlet) timed to the millisecond, where finishing posts your time to a leaderboard that lives on a server.
- A study-group scheduler with real sign-in — A scheduler for a study group that currently plans everything in a chat thread.
- Volunteer hours a real org can verify — An hours platform for an organization you already volunteer with: an NHS chapter, a food bank, a library program, a religious youth group.
Curious? Read the full skill — the exact instructions your agent gets
--- name: backend-basics category: code description: Build and deploy their first small server. Covers a few real endpoints, frontend requests, current host limits, server-side secrets, and failure handling. Use when a frontend needs a hidden key, when they ask "what is a backend", or when localStorage stops being enough. --- # backend-basics Build someone's first backend: a small API they wrote, deployed on a current no-card plan, answering requests from their own frontend. The point is to make "server" concrete. Code that runs on a machine that is always on, holds secrets the browser can't see, and answers HTTP requests. ## Ground rules - The backend must serve a real need from their existing project: hiding an API key, sharing data between visitors, or doing work the browser can't. If nothing exists yet, run build-web-app first, or build the frontend and backend as one small pair. - Compare current official plan and runtime documentation before choosing a host. Serverless functions or a small Node server are both reasonable. Record the limits and what happens at the edge of them, including request caps, sleeping instances, and retention. No card details anywhere; if a supposedly free host demands a card, pick another host. - Their accounts, their keys. They sign up themselves; secrets go in the host's env-var settings and a local `.env` that is gitignored before it is created. `git status` proves it. - Two or three endpoints, no more. A backend that does one job completely beats a scaffold with ten empty routes. - They run every deploy and every curl. You narrate what each command does in one line first. ## The path 1. Say the shape out loud together: browser calls your API, your API does the private work, JSON comes back. Draw it as three boxes if that helps. Then pick the two endpoints this project needs. 2. Hello endpoint, locally: one route returning JSON. Hit it with curl and with the browser so both feel the same. 3. Deploy that hello endpoint before writing anything else. Free tiers make this a ten-minute step; a live URL early keeps the rest honest. 4. Real endpoints: the private fetch with the hidden key, or the shared read/write the project needs. Env vars set in the host dashboard by them, mirrored in local `.env`. 5. Wire the frontend to it with `fetch`. Handle CORS when it bites (it will) and explain in two sentences why the browser blocked the call. 6. Unhappy paths: bad input gets a 400 with a message, a down upstream gets caught, and they test both with curl. ## Done - A deployed API at a URL, written by them, with 2 to 3 endpoints - Their frontend calling it and rendering the result - Secrets only in host env vars and a gitignored `.env`; nothing secret in the repo or the browser dev tools - They can trace one request from click to response out loud Then: database-basics when the API needs memory that survives a redeploy, or auth-basics when different users should see different things.





