This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.
To set up and run the application, please follow the procedures outlined in the following subsections:
- Ensure you have NVM, Node <= V16, npm <=V8 (Install yarn using:)
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
nvm install 16
nvm use 16
- Confirm you are using node V16:
node -v
npm i -g yarn
- Check if yarn was successfully installed:
yarn -v
Manage Node versions using NVM: Node Version Manager
-
Clone the repository to your local machine:
git clone https://github.com/Mental-Health-Kenya/MentalHealthKE.git && cd MentalHealthKE
Incase you exprience errors cloning the repo:
git clone https://github.com/Mental-Health-Kenya/MentalHealthKE.git --depth 1
-
Download and install MongoDB from the MongoDB website:
-
If using a Windows machine, one may need to add mongo to the environment variables. The instructions regarding the addition of environment variables can be found in the Microsoft Docs article for installing and configuring MongoDB:
https://docs.microsoft.com/en-us/azure/virtual-machines/windows/install-mongodb
-
Create a directory to store the data.
mkdir <path>
-
Set the path for storing the data:
mongod --dbpath /data/<path>
-
Run the service using the following command:
sudo systemctl start mongod
-
After installing MongoDB, launch the MongoDB terminal by using the following command:
mongosh
-
To add sample data, enter the commands listed in the "docs/database_ commands.txt" file of this repository
-
In the cloned project, navigate to the server directory:
cd server
-
Install the dependencies:
yarn
-
Run the server:
yarn start
The console should then print a statement about the server running on a certain port:
Server is running on Port 3000...
-
In the cloned project, navigate to the client directory:
cd client
-
Install all dependencies:
yarn
-
Run the client:
yarn start
The console should then print a statement with a URL in which the application is running.
For example:
Project is running at http://localhost:8080/
-
Launch the application in a web browser by navigating to the URL printed by the console