Next.js Frontend Installation
Instructions for setting up the SaasCart Next.js frontend
Next.js Frontend Installation
Before starting, confirm that the SaasCart API is configured and running. Once confirmed, you can proceed with setting up the Next.js SaasCart frontend.
Getting Started with SaasCart Frontend
1. Open the Next.js Frontend Directory
Navigate to the nextjs-saascart-frontend
directory that you downloaded from SaasCart.
2. Configure next.config.js
- Open
next.config.js
in your code editor. - Adjust the URL settings as follows:
- Set
baseURL
to the main URL for your frontend, e.g., http://localhost:3000 or https://your-domain.com. - Set
URL
to your Laravel API server URL, e.g., http://127.0.0.1:8000/api or https://api.your-domain.com/api. - Set
storageURL
to the primary domain for Laravel, e.g., http://127.0.0.1:8000 or https://api.your-domain.com. - Add
api.your-domain.com
to the hostname for image access.
- Set
3. Install Node Modules
In the nextjs-saascart-frontend
folder, run the following command in the terminal to install dependencies:
4. Run the Project
After installing the necessary dependencies, start the project with the following command:
This will start the application on the default port, accessible at http://localhost:3000.
Once you’ve completed the Next.js SaasCart frontend installation, the next step is to set up the Next.js SaasCart Admin. Follow the instructions in the Next.js Admin Installation.