Welcome to the Next.js Starter Kit, an open-source template designed to help you build high-performance, maintainable, and enjoyable applications. This template comes pre-configured with a variety of tools and features to accelerate your development process.
- Next.js: The React framework for production.
- TypeScript: Strongly typed programming language that builds on JavaScript.
- Tailwind CSS: A utility-first CSS framework for rapid UI development.
- ESLint: A tool for identifying and fixing problems in JavaScript code.
- Prettier: An opinionated code formatter.
- NextAuth.js v5: Authentication for Next.js applications.
- NextUI: A React UI library for building modern web applications.
- Drizzle ORM: A lightweight TypeScript ORM for SQL databases.
- Neon DB: Neon is a serverless open-source database that allows you to build and deploy databases with a few clicks.
Make sure you have the following installed:
-
Clone the repository:
git clone https://github.com/yourusername/nextjs-starter-template.git
-
Navigate to the project directory:
cd nextjs-starter-template
-
Install the dependencies:
npm install # or bun install
To start the development server, run:
npm run dev
# or
bun dev
Open http://localhost:3000 with your browser to see the result.
To create an optimized production build, run:
npm run build
# or
bun build
This will create a build
directory with the production build of your application.
After building the application, you can start the production server with:
npm run start
# or
bun start
Instructions for deploying the application will go here.
bun dev
: Starts the development server.bun build
: Builds the application for production.bun start
: Starts the production server.bun lint
: Runs ESLint to identify and fix problems in the code.bun db:generate
: Generates the database schema.bun db:migrate
: Migrates the database schema.bun db:studio
: Opens the Neon DB Studio.bun db:push
: Pushes the database schema to the Neon DB.
Details about using Zustand for state management will go here.
Details about using Jotai for state management will go here.
Details about using Recoil for state management will go here.
T3 Env is a library that provides environmental variables checking at build time, type validation and transforming. It ensures that your application is using the correct environment variables and their values are of the expected type. You’ll never again struggle with runtime errors caused by incorrect environment variable usage.
Config file is located at env.mjs. Simply set your client and server variables and import env from any file in your project.
export const env = createEnv({
server: {
NODE_ENV: z.enum(["development", "production"]),
DB_HOST: z.string(),
DB_USER: z.string(),
DB_PASSWORD: z.string(),
DB_NAME: z.string(),
DB_PORT: z.coerce.number(),
DATABASE_URL: z.string().url(),
},
emptyStringAsUndefined: true,
experimental__runtimeEnv: process.env,
})
If the required environment variables are not set, you'll get an error message:
❌ Invalid environment variables: { SECRET_KEY: [ 'Required' ] }
Contributions are always welcome! To contribute, please follow these steps:
- Fork the repository.
- Create a new branch with a descriptive name.
- Push your changes to the forked repository.
- Create a pull request, and we'll review your changes.
For support, please open an issue on the GitHub repository.
This project is licensed under the MIT License. See the LICENSE file for more information.