Skip to content

A hands-on project to learn and practice Prisma ORM with PostgreSQL and TypeScript. Covers schema modeling, migrations, and CRUD operations.

Notifications You must be signed in to change notification settings

emazouz/prisma-postgresql-typescript-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🧠 Prisma + PostgreSQL + TypeScript – Learning Project

This project is a practical exercise to learn how to use Prisma ORM with a PostgreSQL database in a TypeScript environment. It includes basic setup, database modeling, migrations, and CRUD operations.


🎯 Goal

  • Learn how to set up and use Prisma with PostgreSQL
  • Practice defining models and running migrations
  • Write clean and type-safe database logic with TypeScript

πŸ›  Tech Stack

  • Language: TypeScript
  • Database: PostgreSQL
  • ORM: Prisma

πŸ”§ Features

  • βœ… Prisma setup with PostgreSQL connection
  • βœ… .env configuration for secure DB access
  • βœ… Schema modeling in schema.prisma
  • βœ… Migration and database initialization
  • βœ… Sample CRUD operations (Create, Read, Update, Delete)
  • βœ… Seed script to populate sample data

πŸš€ Getting Started

1. Clone the repository

git clone https://github.com/your-username/prisma-postgresql-typescript-demo.git
cd prisma-postgresql-typescript-demo

2. Install dependencies

npm install

3. Setup your .env file

DATABASE_URL="postgresql://user:password@localhost:5432/mydb"

4. Run Prisma migrations

npx prisma migrate dev --name init

5. Generate Prisma client

npx prisma generate

6. Run the app

npm run dev


---

πŸ“ Project Structure

/prisma          β†’ Prisma schema & migrations
/src
  β”œβ”€β”€ index.ts   β†’ Entry point
  β”œβ”€β”€ db.ts      β†’ Prisma client instance
  └── logic/     β†’ CRUD logic


---

πŸ“˜ Resources

Prisma Docs

PostgreSQL Tutorial

TypeScript Handbook



---

πŸ“ License

MIT – Free to use and modify.

---

About

A hands-on project to learn and practice Prisma ORM with PostgreSQL and TypeScript. Covers schema modeling, migrations, and CRUD operations.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published