ʕ•ᴥ•ʔ

  • home

  • blogs

    æ
  • art

  • games

  • projects

Blazzzing Fast Project - Part Two

Author(s): Renato Sanchez

Published on Fri Aug 08 2025

Summary: Creating a speed-first app with rust.

#SQLx

#Rust

#Astro


This is article form part of a series of blogs/documentation on my way to build a fast and modern web project built with the fastest tech stack of nowadays: AstroJS, Rust and PostgreSQL. In this chapter I’ll cover all the design of the backend services for the blog application, previously I’ve implement the database design with SQLx and PostgreSQL, read it in [[Blazzzing-Fast-Project-Part-One]].

Design

This app will contain different functionalities but we can resume all of them in the basic HTTP methods: GET, POST, DELETE and PATCH. Each one with different proposes.

The POST method in the most of cases is used to send data to the server to create some type of stuff, in example, on a user sign up or log in a platform the web page send a POST message with data like username, password and email. GET method is literally used to get data from the server, something like when Facebook serve your feed on the screen. DELETE method is used only to remove or delete something of the system, maybe when you delete a post or a user delete it’s account. PATCH method are used to modify data of the database, like when a user change its username or email.

Most of the time you don’t want to really delete data from some row of the database, here is where soft delete takes place, this is a common move used to conserve data in the database without delete it, let’s say that we just set a little flag (a column in the table) like “active” to false, and this let’s us to recover that data later if is needed.

So lets design this API. Just as part of good practices I will wrap all the API routes with the prefix /api/.

User Endpoints - /api/users

As we know the applications must let users sign up, log in and log out. so that are a part of the API really important:

  • POST /api/users: User register endpoint, here the user will send all the data needed to sign up to the platform.
  • GET /api/users/:id: Retrieve user data endpoint by the id
back to the top