This project is a learning endeavor to explore Prisma, a modern ORM for Node.js and TypeScript, integrated with PostgreSQL. The application backend is built with Node.js and Express.js, focusing on efficient database interaction and type-safe development.
- Prisma: ORM for database access and migrations
- PostgreSQL: Relational database
- TypeScript: Typed JavaScript for better development experience
- Node.js: JavaScript runtime
- Express.js: Backend framework for building APIs
Ensure you have the following installed on your system:
- Node.js (v16 or higher)
- PostgreSQL
- npm or yarn
- TypeScript
- Clone the repository:
git clone <repository-url> cd <repository-folder>
- Install dependencies:
npm install or yarn install
- Set up environment variables: Create a .env file in the project root with the following content:
DATABASE_URL=postgresql://<username>:<password>@localhost:5432/<database_name>
- Initialize Prisma:
npx prisma init
- Generate Prisma Client:
npx prisma generate
- Apply database migrations:
npx prisma migrate dev --name init