This guide explains how to set up and run GraphStation on your local machine for development purposes.
Ensure you have the following installed:
- Node.js (v18 or higher recommended) & npm
- Python 3.9+
- Memgraph (running via Docker)
First, create your local environment configuration by copying the template and running the setup script:
./setup_local.shThis script will:
- Create a
.envfile from.env.template. - Prompt you for your NAS credentials (to configure paths).
- Install frontend dependencies (
npm install). - Make deployment scripts executable.
Note: For local development, ensure MEMGRAPH_HOST in your .env points to where your Memgraph instance is running (e.g., localhost if running via Docker locally).
The backend is a Flask application. To run it locally:
- Navigate to the backend directory:
cd backend - Install Python dependencies:
pip install -r requirements.txt
- Start the server:
python main.py
The API will be available at http://localhost:5000.
The frontend is a React application built with Vite.
- Navigate to the frontend directory:
cd frontend - Start the development server:
npm run dev
The frontend will typically be available at http://localhost:5173.
Important for Frontend-Backend Communication: During local development, you may encounter CORS issues or cookie problems because the frontend and backend are on different ports/domains.
- Development Mode: You can enable
VITE_DEV_MODE=truein your.envfile. This enables a feature where clicking on your username in the UI copies the session cookie, which can be manually applied to your browser for testing purposes. - Proxying: For a more seamless experience, consider configuring a proxy in
vite.config.jsto redirect/apirequests tohttp://localhost:5000.
Since GraphStation relies heavily on Memgraph, you should have a Memgraph instance running. The easiest way is using Docker:
docker run -d \
--name memgraph-dev \
-p 7687:7687 -p 3000:3000 \
memgraph/memgraphYou can use Memgraph Lab (accessible at http://localhost:3000) to inspect your data and run Cypher queries manually.
| Task | Command |
|---|---|
| Initial Setup | ./setup_local.sh |
| Start Backend | cd backend && python main.py |
| Start Frontend | cd frontend && npm run dev |
| Install Python Deps | pip install -r backend/requirements.txt |
| Install JS Deps | npm install (in frontend/) |