Installation
Requirements
Before you begin, ensure that your computer has the following software installed.
nodejs
(18.15.0 or later) https://nodejs.org/enpnpm
Node package manager https://pnpm.io/ (recommended)Visual Studio Code
https://code.visualstudio.com/ (recommended)
Installation
Before initiating the installation process, ensure all required environment variables are added.
Setting Environment Variables
Open your terminal, navigate to the root directory of the project and execute the following command:
cp .env.local.example .env.local
This command copies the provided example file for local environment variables. Now, proceed to fill in the values for the following environmental variables in the newly created .env.local
file:
NEXT_PUBLIC_GOOGLE_MAP_API_KEY
is optional unless you're utilizing Google Maps. If you plan to integrate Google Maps into your project, obtain your API key from this link and assign it to NEXT_PUBLIC_GOOGLE_MAP_API_KEY
in your environment variables.
NEXTAUTH_SECRET
Open your terminal in mac/linux and enter the following command and it will generates a random 32-character base64-encoded string using OpenSSL. If your are a Windows user you can generate from here https://generate-secret.vercel.app/32
openssl rand -base64 32
NEXTAUTH_URL
should be set to your project's base URL. During development, it commonly defaults to http://localhost:3000. However, in a production environment, ensure to update it to match the URL of your deployed application.
GOOGLE_CLIENT_ID
is your project's Google API client ID. During development, use a test ID, and for production, obtain the official ID from the Google Developer Console (https://console.developers.google.com/). This ID is essential for authenticating with Google services in your application.
GOOGLE_CLIENT_SECRET
is your project's confidential key for secure communication with the Google API. During development, use a test secret; for production, obtain the official one from the Google Developer Console (https://console.developers.google.com/). This key is essential for authenticating and authorizing your application with Google services.
Once you've completed the aforementioned steps, you can execute the following commands in the terminal/command prompt from the project's root directory.
Command | Description |
---|---|
pnpm install | This process will install all the necessary dependencies into the node_modules folder. |
pnpm dev | It launches the project locally, initiates the development server, and monitors any changes in your code. You can access the development server at http://localhost:3000 |
Available Scripts
Here are some additional commands that you can use
Command | Description |
---|---|
pnpm clean | The pnpm clean efficiently eliminates npm packages, build files, and cache, leaving the project in a pristine state. |
pnpm build | The pnpm build orchestrates the construction of the project, creating any necessary build files and optimizing the application for deployment. |
pnpm start | The pnpm start launches the locally built application in production mode, providing a ready-to-deploy version of the project |
pnpm lint | The pnpm lint runs the linting process on the project, analyzing the code for potential errors, style issues, or other discrepancies. |