Boilerplate of the full-stack Next.js application created to start my side projects faster.
- Framework:
Next.js16, working onReact19 - Database connection:
Prisma ORM - Authentication:
Next Auth 5,bcryptjsfor passwords encryption - Styling:
Tailwind 4, - Design System:
shadcn/uidesign system,lucide-reacticons library - Forms Management:
react-hook-formwithZodvalidation library - Client-side Notifications:
sooner - Code formatting:
ESLint&Prettier - Deployment environment -
Docker
Local environment is fully-dockerized. To start working locally on this project, please follow these steps:
The instructions below need to be executed once during project initialization. If you have already executed them, you can skip this section.
- Create your local environment variables file from the dist file:
cp .env.dist .env- Run following command to generate
AUTH_SECRETand paste it into.envfile:
npx auth secret --raw-
Fill in the rest of the missing environment variables from the
env.distfile. -
Create an override Docker Compose file with some special local environment configuration from the dist file:
cp docker-compose.override.yml.dist docker-compose.override.yml- Build a development version of the application's Docker image:
npm run docker:build- Enter application's shell to perform actions inside the Docker container:
npm run shell- Install dependencies inside shell:
npm i- Exit application's shell:
exit- Run local docker environment:
npm run docker:start- Open application's shell again in another terminal window:
npm run shell- Run the following command to create the database client, run all migrations, and seed the database with initial data.
npm run db:init- Exit application's shell:
exit- Open http://localhost:3000 with your browser to see the result.
Congratulations! Now your project is bootstrapped successfully!
The application has been adapted for deployment in the Docker environment.
To build application the locally, run:
npm run docker:buildTo build a production version of the application's Docker image, run:
npm run docker:build-prodImportant: Remember to remove the docker-compose.override.yml file, because it was used only for local environment configuration.
To run your production application, use the following command:
npm run docker:start-prodIf your application has an external database, you can also run only the Next.js application container by using the following command:
docker run -p 3000:3000 --name next_fullstack_boilerplate --network=next_fullstack_boilerplate next-fullstack-boilerplateIt is always possible to write your own docker-compose file, which runs the production version of the application's Docker image.
npm run [command_name]dev- Launches the app in development mode on http://localhost:3000build- Compiles and bundles the appstart- Runs the application built using the build commandlint- Validate the code using ESLint and Prettierlint:fix- Validate and fix the code using ESLint and Prettiershell- Runs npm CLI inside Docker container for running commandsdocker:build- Builds application Docker image for local environmentdocker:build-prod- Builds application Docker image for production environmentdocker:start- Run the application locally in a Docker environmentdocker:start-prod- Run production version of the application in Docker environmentdb:seed: - Seed database with initial datadb:generate-client- Generate a Prisma client for the databasedb:run-migrations- Run database migrationsdb:add-migration- Create new database migration based on changes in Schema documentdb:init- Single command for database initialization (generating Prisma client, running migrations and seeding database with initial data)