This is an experimental Next.js blog app bootstrapped with create-next-app
. The application is designed to create, read, update and delete blog posts.
- Next.js
- Tanstack query
- react-hook-form
- Prisma as an ORM
- Prisma client
- PostgreSQL database
- Lucide icons
- daisy ui
- Cypress for unit and end-to-end testing
You'll need the following installed
- Node.js version: 20.10.0
- npm version: 10.2.3
- PostgreSQL needs to be installed
- PostgreSQL -
brew install postgresql
orsudo apt-get install postgresql
- PostgreSQL -
First, set up the database:
Setting Up Environment Variables
Create a .env file in the root of your project and add the following line to set up your database connection:
DATABASE_URL="postgresql://<postgres_user_name>:<postgres_user_password>@localhost:5432/blog_app?schema=public"
Replace <postgres_user_name> and <postgres_user_password> with your PostgreSQL username and password.
Setting Up the Database
Run the following command to create the database:
npx prisma migrate dev
Run the development server:
npm run dev
Open http://localhost:3000 with your browser to see the result.