This guide provides the step-by-step instructions to get the NEXUS project running locally on your machine.
- Google Gemini API Key: You must have a valid API key from Google AI Studio.
- Python 3.10+: Required for the backend and AI helper.
- C Compiler: A C compiler like
gcc(common on Linux/macOS) orMinGW(for Windows). - Web Browser: A modern browser like Chrome, Firefox, or Edge.
This is the most important step.
-
Go to Google AI Studio and create a new API key.
-
Set an Environment Variable: You must set this key in your terminal. Do not hard-code it into the Python files.
- Windows (PowerShell):
$env:GEMINI_API_KEY = "YOUR_API_KEY_HERE"
- macOS / Linux:
export GEMINI_API_KEY="YOUR_API_KEY_HERE"
Note: You must re-run this command every time you open a new terminal.
- Windows (PowerShell):
It is highly recommended to use a clean virtual environment to avoid conflicts.
-
Create a Virtual Environment: From the
NEXUS/root folder:python -m venv venv
-
Activate the Environment:
- Windows:
.\venv\Scripts\activate - macOS / Linux:
source venv/bin/activate
- Windows:
-
Install Python Libraries:
# These are the only 3 libraries needed for this project pip install google-generativeai pip install flask pip install flask-corsTroubleshooting: If you ever get a
404 v1betaerror, your library is out of date. Run this:pip install --upgrade google-generativeai
The C-Core must be compiled into an executable file that the Python backend can run.
- Navigate to the
c_coredirectory:cd c_core - Compile all
.cfiles usinggcc:# This command finds all .c files and compiles them into # a single executable named "nexus_engine.exe" gcc -Wall -Wextra -std=c11 -O2 -o nexus_engine.exe *.c
- Verify that
nexus_engine.exe(ornexus_engineon macOS/Linux) is now present in thec_corefolder.
- Navigate back to the
backenddirectory:cd ../backend - Set your API key in this terminal (if you haven't already).
# Windows $env:GEMINI_API_KEY = "YOUR_API_KEY_HERE"
- Run the Flask server:
python app.py
- You should see the server running on
http://127.0.0.1:5000.
- Navigate to the
frontendfolder. - Open the
index.htmlfile directly in your browser. - You are ready to go. Upload a document to begin.
-
Error:
429 You exceeded your current quota- Cause: You are using the Gemini free tier, which is limited to 1-2 requests per minute. You uploaded too many files too quickly.
- Fix: Stop your server, wait 60 seconds, and restart it.
-
Error:
500 Internal Server Error(in the browser)- Cause: The C-Core engine is missing or cannot run.
- Fix: You forgot to do Step 3. Go to
c_coreand run thegcccommand.
-
Problem: The Mind Map is just text (e.g.,
MINDMAP_DATA:...)- Cause: Your browser is using an old, cached version of the
script.jsfile. - Fix: Do a "Hard Refresh" in your browser: Ctrl+Shift+R (or Cmd+Shift+R on Mac).
- Cause: Your browser is using an old, cached version of the