Skip to content
This repository has been archived by the owner on Jan 15, 2025. It is now read-only.

codefastlabs/next-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

79 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Project Overview

This project leverages the power of Next.js and is initialized with create-next-app.

Getting Started

Clone the Repository

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-name

Replace your-new-repo-name with the desired name for your project.

Navigate to Your Project Directory

After cloning, move into the project directory:

cd your-new-repo-name

Rename the Project

To rename your project and update all necessary files, run the rename-project.sh script:

./scripts/rename-project.sh

Provide a New Project Name

When 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 docker directory
  • .env.development.sample

Example

To rename the project to next-fullstack, you can run:

./scripts/rename-project.sh next-fullstack

Alternatively, if you omit the project name, the script will prompt you:

./scripts/rename-project.sh
Enter the new project name: next-fullstack

Prerequisites

Ensure jq is installed on your system to run the script. Install it using your package manager. For macOS, you can use Homebrew:

brew install jq

If you encounter issues, check that the required files exist in your project directory.

Environment Setup

To configure the project for WebStorm, create a .env.local file in the root directory with the following content:

REACT_EDITOR=webstorm

Quickly set up your environment by running:

cp .env.sample .env.local

To configure the environment for testing, run:

cp .env.sample .env.test.local

If 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.local

Generate an AUTH_SECRET for token encryption and email verification hashes:

openssl rand -base64 32

Starting the Development Server

Launch the development server with:

pnpm dev

Open http://localhost:3000 in your browser to view your app. The page automatically refreshes when you edit app/page.tsx.

Fonts

The project uses next/font to load the Geist font family efficiently from Vercel.

Quick Commands

Database Commands

  • Start the database container:
    make database-up
  • Stop the database container:
    make database-down

Development Environment Commands

  • 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

Staging Environment Commands

  • 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

Production Environment Commands

  • 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

Cleanup Command

  • Remove unused Docker images and volumes:
    make cleanup

Learn More

For further contributions and info, visit the Next.js GitHub repository.

Deployment

Deploy your Next.js app on Vercel, the creators of Next.js.

Refer to the Next.js deployment documentation for more details.

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published