This project leverages the power of Next.js and is initialized with
create-next-app.
To start a new project based on this template, clone the repository using the command:
git clone https://github.com/codefastlabs/next-app.git your-new-repo-nameReplace your-new-repo-name with the desired name for your project.
After cloning, move into the project directory:
cd your-new-repo-nameTo rename your project and update all necessary files, run the rename-project.sh script:
./scripts/rename-project.shWhen prompted, input your new project name.
Note: If your project name contains spaces (for example, "my new project"), enclose it in quotes. If entered without quotes, only the first word will be recognized.
This script automatically updates:
package.json- Docker Compose files in the
dockerdirectory .env.development.sample
To rename the project to next-fullstack, you can run:
./scripts/rename-project.sh next-fullstackAlternatively, if you omit the project name, the script will prompt you:
./scripts/rename-project.sh
Enter the new project name: next-fullstackEnsure jq is installed on your system to run the script. Install it using your package manager. For macOS, you can use
Homebrew:
brew install jqIf you encounter issues, check that the required files exist in your project directory.
To configure the project for WebStorm, create a .env.local file in the root directory with the following content:
REACT_EDITOR=webstormQuickly set up your environment by running:
cp .env.sample .env.localTo configure the environment for testing, run:
cp .env.sample .env.test.localIf you're using Docker, copy .env.sample for various environments:
cp .env.sample .env.development.local
cp .env.sample .env.production.local
cp .env.sample .env.staging.localGenerate an AUTH_SECRET for token encryption and email verification hashes:
openssl rand -base64 32Launch the development server with:
pnpm devOpen http://localhost:3000 in your browser to view your app. The page automatically refreshes
when you edit app/page.tsx.
The project uses next/font to load
the Geist font family efficiently from Vercel.
- Start the database container:
make database-up
- Stop the database container:
make database-down
-
Build the development Docker image:
make development-build
-
Start the development Docker container:
make development-up
-
Build and start the development Docker container:
make development-build-up
-
Stop the development Docker container:
make development-down
-
Stop, build, and start the development of a Docker container:
make development-down-build-up
-
Build the staging Docker image:
make staging-build
-
Start the staging Docker container:
make staging-up
-
Build and start the staging Docker container:
make staging-build-up
-
Stop the staging Docker container:
make staging-down
-
Stop, build, and start staging Docker container:
make staging-down-build-up
-
Build the production Docker image:
make production-build
-
Start the production Docker container:
make production-up
-
Build and start the production Docker container:
make production-build-up
-
Stop the production Docker container:
make production-down
-
Stop, build, and start the production Docker container:
make production-down-build-up
- Remove unused Docker images and volumes:
make cleanup
- Next.js Documentation: Explore all of Next.js' features and API.
- Learn Next.js: Follow the interactive Next.js tutorial.
For further contributions and info, visit the Next.js GitHub repository.
Deploy your Next.js app on Vercel, the creators of Next.js.
Refer to the Next.js deployment documentation for more details.
MIT