/nextjs_template

Base next.js project template with already configured next-auth and prisma. I've also added base config for shadcn. prettierc file and docker-compose and Dockerfile config.

Primary LanguageTypeScript

This is my base configuration for the Next.js project.

Things configured:

  • TypeScript
  • ESLint
  • Prettier
  • Prisma
  • NextAuth.js
  • NextAuth middleware (base configuration - only dashboard route is protected)
  • Next-intl
  • Swagger UI for API documentation
  • TailwindCSS
  • Shadcn
  • Playwright
  • Jest
  • .env file

How to use:

  1. Clone the repository and remove origin and set new origin with your remote repository URL

    git https://github.com/KlaudiuszB5528/nextjs_template new-project-name
    cd new-project-name  # Navigate into the new project directory
    git remote remove origin  # Remove the default remote
    git init  # Initialize a new Git repository
    git remote add origin https://<your_remote_repository_url>
  2. Run

yarn install
npm install
pnpm install
  1. Update the .env file with your secrets
  2. Run docker compose to start the database(PostgreSQL)

Note: Make sure you have Docker installed on your machine

The frontend is running on port 3000 and the database is running on port 5432 by default (frontend part is commented out in the docker-compose file, uncomment it if you want to run the frontend in a container as well)

docker-compose up -d
  1. For local development, run the following command to generate the Prisma client and push the schema to the database
npx prisma generate
npx prisma db push
  1. Run the project
yarn dev
npm run dev
pnpm dev
  1. Enjoy!