The final checkpoint 🚀
Your team has come a long way: it started as a card in the console, grew into a team with statistics, and in React you gave it a face on screen. But all of that lived in the code: if you reload, it's gone. Real apps remember.
Today you close the loop: your team moves to a database (SQL) and is served by an API (Node). This is full-stack.
The journey of a piece of data
When your screen asks for the team, the data makes this journey:
[ Database ] → [ API / server ] → [ Interface ]
SQL (the table) Node (the handler) React (③)
- The database stores the team permanently. You query it with SQL.
- The API (an Express handler) reads that data and returns it as JSON.
- The interface (your React component from the previous checkpoint) renders it.
You'll build it from the ground up
- SQL: query your team and its average age in the
teamtable. - Node: write the handlers that serve the list and the statistic as JSON.
Each handler receives (req, res). In the tests we call it with a simulated request
and response (crearReq/crearRes), like a toy Express. 👇
Examples
A handler in action — press Run
function listTeam(req, res) {
res.json([
{ name: "Ana", age: 26 },
{ name: "Beto", age: 36 },
]);
}
// In the tests it's called with simulated req/res:
const res = crearRes();
listTeam(crearReq(), res);
console.log("Status:", res.statusCode);
console.log("Body:", res.body);