CleanGraph can be set up on both Windows and Linux systems. The following instructions will guide you through the setup process on both operating systems.
Before you begin, ensure you have met the following requirements:
- You have a Windows/Linux/Mac machine running Python 3.8+ and Node.js 16.15.* (ensures the frontend can proxy to the backend, issues occur with later versions of Node).
- You have basic knowledge of Python, JavaScript, and command-line tools.
client/ # Javascript React Client.
public/
src/
package.json # Client dependencies.
docs/ # Documentation files.
mkdocs.yml # Documentation configuration file.
docs/ # Markdown pages, assets, etc.
server/ # Python FastAPI Server.
requirements.txt # Server dependencies.
models/
plugins/
routers/
services/
CODE_OF_CONDUCT.md # Contributor Code of Conduct.
CONTRIBUTING.md # Contribution Guidelines.
LICENSE.md # MIT License.
README.md # General ReadMe.
First, clone the CleanGraph repository to your local machine:
git clone https://github.com/nlp-tlp/CleanGraphNavigate into the client/ directory. Install the client dependencies by running:
npm installNavigate to the server/ directory. Here, set up a Python virtual environment and install the server dependencies.
For Windows:
Create a virtual environment called venv:
python -m venv venvActivate the virtual environment:
.\venv\Scripts\activateInstall the dependencies:
pip install -r .\requirements.txtFor Linux:
Create a virtual environment:
python3 -m venv venvActivate the virtual environment:
source venv/bin/activateInstall the dependencies:
pip install -r requirements.txtCreate a .env file with the following structure - this is used to connect to the MongoDB database:
If you are not familiar with MongoDB - visit here to create a new database.
PORT=8000
MONGO_DB_USERNAME="<YOUR_MONGO_DB_USERNAME>"
MONGO_DB_PASSWORD="<YOUR_MONGO_DB_PASSWORD>"
MONGO_CLUSTER_NAME="<YOUR_MONGO_DB_CLUSTER_NAME>"
MONGO_DB_NAME="<YOUR_MONGO_DB_NAME>"
MONGO_URI="mongodb+srv://${MONGO_DB_USERNAME}:${MONGO_DB_PASSWORD}@${MONGO_CLUSTER_NAME}.0aum8fo.mongodb.net/${MONGO_DB_NAME}?retryWrites=true&w=majority"Once the setup is complete, start the client and server separately.
To start the client, navigate to the client/ directory and run:
npm startThis will start the client on http://localhost:3000
To start the server, make sure the virtual environment is activated, navigate to the server/ directory, and run:
uvicorn main:appThis will start the server on http://localhost:8000
After completing these steps, you should now have CleanGraph up and running on your machine.
If you wish to have the documentation site available locally, you can set it up by following these steps:
- Navigate to the
docs/directory in your terminal. - Set up a new Python virtual environment.
For Windows:
python -m venv venv
For Linux:
python3 -m venv venv- Activate the newly created virtual environment.
For Windows:
.\venv\Scripts\activateFor Linux:
source venv\bin\activate- Install the necessary dependencies.
pip install -r requirements.txt- Run the documentation site server using MkDocs.
mkdocs server -a 0.0.0.0:8001Upon completion of these steps, the documentation site should be available at http://localhost:8001. You can navigate the documentation through your web browser while the MkDocs server is running.