PostgREST is the quiet workhorse of API development, letting you tap into the power of PostgreSQL without getting bogged down in boilerplate code. In this guide, we'll build a practical Time Off Manager application that showcases how to get real work done with this understated tool.
Website: PostgREST
Introduction to PostgREST, how to set up our PostgreSQL database, and create the core users table for our Time Off Manager. We'll then use PostgREST's automatic API generation to expose basic CRUD operations on this table.
Part 2: Adding Structure and Logic
We create a dedicated api
schema for our API endpoint, using views to customize data access and provide necessary abstraction. We also introduce stored procedures to encapsulate business logic, like adding users and managing vacation balances.
Part 3: Authentication And Authorization
Dive into authentication using pgcrypto to securely store passwords and JWTs for stateless authentication. Using row-level security we ensure users only access their own data, and we fine-tune our API functions to complete the Time Off Manager workflow.