Backend
Your backend is the heart of your votura project. It handles all the API routes, the business logic and the connection to the database. It is written in TypeScript and uses the Express framework.
As you can see in the following image, the backend follows a simple layered architecture.
We are using an express server to handle the API requests and responses:
- In the routing layer, we define the API routes and doing some global error handling.
- In the business layer, we implement the business logic of the API endpoints. For validation and transformation of the request and response data, we use the Zod.
- In the persistence layer, we handle the connection to the database and the data access. We use Kysely as a type-safe SQL query builder and PostgreSQL as the database.