A simple jokes application built with Next.js, featuring a modern UI with Tailwind CSS and a PostgreSQL database with Prisma ORM. This application is ready to deploy on Blossom.
-
Install dependencies:
yarn install
-
Set up environment variables: Create a
.env
file in the root directory with the following variables:DATABASE_URL="postgres://user:password@localhost:5432/example_nextjs_dev"
For local development, you can use SQLite by not setting the
DATABASE_URL
variable. -
Set up the database:
yarn db:setup
-
Start the development server:
yarn dev
-
Open http://localhost:3000 in your browser to see the application.
Additional Information
- Modern UI with Tailwind CSS
- PostgreSQL database with Prisma ORM
- Server-side rendering with Next.js
- Ready to deploy on Blossom
yarn dev
- Start the development serveryarn build
- Build the application for productionyarn start
- Start the production serveryarn lint
- Run ESLint to check for code issuesyarn db:setup
- Set up the database (run migrations and seed data)
nodejs-nextjs/
├── app/ # Next.js app directory
│ ├── globals.css # Global styles
│ ├── layout.tsx # Root layout
│ ├── page.tsx # Home page
│ ├── error.tsx # Error page
│ ├── loading.tsx # Loading page
│ ├── not-found.tsx # 404 page
│ ├── random/ # Random joke page
│ └── jokes/ # Jokes pages
├── lib/ # Utility functions and shared code
├── prisma/ # Prisma schema and migrations
├── public/ # Static files
└── scripts/ # Database setup and seeding scripts