Follow below Steps to run CRM Nexus web application in your system:
git remote add origin https://github.com/jenish04/CRM_Nexus_Web_Application.git
cd CRM Nexus Web Application
-
Create your own MongoDB account by visiting the MongoDB website and signing up for a new account.
-
Create a new database or cluster by following the instructions provided in the MongoDB documentation. Remember to note down the "Connect to your application URI" for the database, as you will need it later. Also, make sure to change
<password>
with your own password -
add your current IP address to the MongoDB database's IP whitelist to allow connections (this is needed whenever your ip changes)
-
Check a file named .env in the /backend directory.
This file will store environment variables for the project to run.
In the .env file, find the line that reads:
DATABASE="your-mongodb-uri"
Replace "your-mongodb-uri" with the actual URI of your MongoDB database.
In your terminal, navigate to the /backend directory
cd backend
the urn the following command to install the backend dependencies:
npm install
This command will install all the required packages specified in the package.json file.
While still in the /backend directory of the project, execute the following command to run the setup script:
npm run setup
This setup script may perform necessary database migrations or any other initialization tasks required for the project.
In the same terminal, run the following command to start the backend server:
npm run dev
This command will start the backend server, and it will listen for incoming requests.
Open a new terminal window , and run the following command to install the frontend dependencies:
cd frontend
npm install
After installing the frontend dependencies, run the following command in the same terminal to start the frontend server:
npm run dev
This command will start the frontend server, and you'll be able to access the website on localhost:3000 in your web browser.
❗ If you encounter an OpenSSL error while running the frontend server, follow these additional steps:
Reason behind error: This is caused by the node.js V17 compatible issues with OpenSSL, see this and this issue on GitHub.
Try one of these and error will be solved
-
upgrade to Node.js v20.
-
Enable legacy OpenSSL provider
Here is how you can enable legacy OpenSSL provider
- On Unix-like (Linux, macOS, Git bash, etc.)
export NODE_OPTIONS=--openssl-legacy-provider
- On Windows command prompt:
set NODE_OPTIONS=--openssl-legacy-provider
- On PowerShell:
$env:NODE_OPTIONS = "--openssl-legacy-provider"
Here is reference about enabling legacy OpenSSL provider
After trying above solutions, run below command
npm run dev
If you still facing issue, then follow this stackoverflow thread. It has so many different types of opinions. You definitely have solution after going through the thread.