π§ BrainDrive Local Installation
Works on Windows, macOS, and Linux. Follow the steps in order to configure BrainDrive for local development.
1. Before You Beginβ
- Keep two terminal windows or sessions available: one for the backend API, one for the frontend UI.
- A dedicated Conda environment keeps Python, Node.js, and Git versions consistent across platforms. If you prefer system-managed tools, ensure compatible versions are available globally.
Required Softwareβ
Tool | Suggested Version | Download | Verify Installation |
---|---|---|---|
Conda (Miniconda or Anaconda) | Latest, with Python 3.11 support | Miniconda Β· Anaconda | conda --version |
Git | 2.40+ | git-scm.com | git --version |
Node.js & npm | Node 18 LTS (or newer compatible with Vite 4) | nodejs.org | node -v Β· npm -v |
If Git or Node.js are missing on your system, the Conda environment in Step 2 installs both for you.
2. Prepare Your Workspaceβ
2.1 Create the Conda Development Environment (Recommended)β
conda create -n BrainDriveDev -c conda-forge python=3.11 nodejs git -y
conda activate BrainDriveDev
Activate
BrainDriveDev
in every terminal each time you work on BrainDrive.
2.2 Clone the Repositoryβ
git clone https://github.com/BrainDriveAI/BrainDrive-Core.git
cd BrainDrive-Core
3. Backend Setup (Terminal 1)β
3.1 Install Python Dependenciesβ
cd backend
conda activate BrainDriveDev # ensure the environment is active
pip install -r requirements.txt
3.2 Configure Backend Environment Variablesβ
Create backend/.env
using one of the following options:
Option A: Copy the template
cp .env-dev .env # macOS/Linux
copy .env-dev .env # Windows PowerShell or CMD
Option B: Customize manually
Open backend/.env-dev
and copy values into a new backend/.env
, adjusting secrets, database location, and feature flags as needed. Update SECRET_KEY
, ENCRYPTION_MASTER_KEY
, and any provider credentials before deploying beyond local development.
3.3 Run the FastAPI Development Serverβ
uvicorn main:app --reload --host localhost --port 8005
Leave this process running; it serves BrainDrive's API and documentation.
4. Frontend Setup (Terminal 2)β
4.1 Install Node Dependenciesβ
cd BrainDrive-Core/frontend
conda activate BrainDriveDev # or ensure Node.js 18+ is active
npm install
4.2 Configure Frontend Environment Variablesβ
Create frontend/.env
:
Option A: Copy the example file
cp .env.example .env # macOS/Linux
copy .env.example .env # Windows PowerShell or CMD
Option B: Customize manually
Reference frontend/.env.example
and tailor values. Ensure VITE_API_URL
matches the backend host/port. Remove temporary auto-login credentials (VITE_DEV_EMAIL
, VITE_DEV_PASSWORD
) before sharing builds.
4.3 Run the Vite Development Serverβ
npm run dev
Keep this process running to serve the BrainDrive UI.
5. Access and Verifyβ
Component | URL | What to Expect |
---|---|---|
Backend API docs | http://localhost:8005/docs | FastAPI interactive documentation loads without errors. |
Frontend UI | http://localhost:5173 | BrainDrive web app loads and can reach the backend. |
If the frontend cannot reach the backend, confirm both servers are running and that CORS settings in backend/.env
include http://localhost:5173
.
6. Restarting After a Breakβ
- Open two terminal windows.
- In each window run
conda activate BrainDriveDev
. - Terminal 1:
cd backend
thenuvicorn main:app --reload --host localhost --port 8005
. - Terminal 2:
cd frontend
thennpm run dev
. - Visit http://localhost:5173.
7. Next Stepsβ
- Review your BrainDrive's Owners Manual
- Use the plugin developer quickstart guide to build your first plugin.
- View the BrainDrive Roadmap
- Join the BrainDrive Community
8. Troubleshooting & Tipsβ
- Port already in use: Stop any process occupying ports 8005 or 5173, or update the port in your
.env
files and start commands. - Python packages fail to install: Make sure
BrainDriveDev
is active and runpip install --upgrade pip
. For system Python, install dependencies inside a virtual environment. - Node modules issues: Delete
frontend/node_modules
andfrontend/package-lock.json
, then rerunnpm install
. - Environment variable changes not applied: Restart the corresponding server after edits to
.env
files. - Security reminder: Example secrets in the provided templates are for local development only. Replace them with strong values before deploying BrainDrive anywhere public.
- Directory awareness: Always confirm you are in the correct directory (
backend
orfrontend
) before running commands. Different operating systems and terminals donβt always behave the same with relative paths, so being explicit withcd
helps prevent confusion and errors.
9. Supportβ
Visit the support forum a community.braindrive.ai.
We're here to build the future of user-owned AI together.