This is an example of a minimal production-grade Next.js application built with JavaScript. It serves as a starting point for building robust and scalable web applications.
- Framework: Next.js (App Router)
- Language: JavaScript
- Styling: Tailwind CSS
- UI Components: shadcn/ui
- ORM: Prisma
- Linting: ESLint
A brief overview of the key directories and files:
.
├── prisma/ # Prisma schema and migrations
├── src/
│ ├── app/ # Application routes (App Router)
│ ├── components/ # Reusable React components
│ ├── lib/ # Utility functions
│ ├── services/ # Business logic (e.g., auth, user services)
│ └── ...
├── public/ # Static assets
├── next.config.mjs # Next.js configuration
└── package.json # Dependencies and scripts
- Node.js (v18.x or later)
- Bun
-
Clone the repository:
git clone <your-repo-url> cd nextjs-prod
-
Install dependencies:
bun install
-
Database Setup
- You'll need a PostgreSQL database.
- Create a
.envfile in the root of the project. - Add your database connection string to the
.envfile:DATABASE_URL="postgresql://USER:PASSWORD@HOST:PORT/DATABASE" - Push the database schema:
bunx prisma db push
bun devOpen http://localhost:3000 to view the application in your browser.
To learn more about Next.js, take a look at the following resources:
- Next.js Documentation - learn about Next.js features and API.
- Learn Next.js - an interactive Next.js tutorial.
You can check out the Next.js GitHub repository - your feedback and contributions are welcome!
The easiest way to deploy your Next.js app is to use the Vercel Platform from the creators of Next.js.
Check out our Next.js deployment documentation for more details.