i thought building an api would be straightforward. it wasn’t.
validation matters more than logic
most issues came from bad input, not complex code.
app.post('/api/link', async (req, res) => {
const { url } = req.body;
if (!url) {
return res.status(400).json({ error: "url required" });
}
// create short link
});
simple checks like this saved hours later.
basic flow of request handling
database decisions matter early
i redesigned my schema twice because i didn’t think about queries.
- optimize for reads
- avoid unnecessary joins
- keep schema simple
simple systems scale better than clever ones.
closing
small project, but it changed how i think about backend systems.