Build the Data Layer
5 min read
Module Introduction
Build the Data Layer
The starter lets you explore Readly, but its data is temporary. The next step is to establish a persistent source of truth.
In this module, you will connect PostgreSQL, configure Prisma, model the application’s core entities, run the first migration, and create one shared Prisma client.
What We Are Modeling
The database will support:
- users and sessions
- books
- reading progress
- bookmarks
- highlights
- notes
- reader preferences
The models are intentionally shaped around the features you will build later rather than around the current mock objects alone.
Module Goal
By the end of this module:
- PostgreSQL is running locally
- Prisma can connect to it
- the Readly schema is migrated
- relationships and ownership are represented in the database
- application code has a shared Prisma client
Checkpoint
You are ready for Module 3 when you can run Prisma against your local database and see the complete Readly schema without errors.