API Online

Installation

Get GreenLedger running locally in a few steps.

Prerequisites

  • Python 3.10+
  • Node.js 18+
  • OpenAI API key or Google Gemini API key

Backend Setup

1. Clone and navigate

git clone https://github.com/greenledger/greenledger.git
cd greenledger/backend

2. Create virtual environment

python -m venv venv
# Windows
.\venv\Scripts\activate
# Mac/Linux
source venv/bin/activate

3. Install dependencies

pip install -r requirements.txt

4. Configure environment

# Create .env file
OPENAI_API_KEY=sk-your-key-here
# or
GOOGLE_API_KEY=your-gemini-key-here

5. Run the server

python run.py
# Server starts at http://localhost:8000

Frontend Setup (Optional)

1. Navigate to frontend

cd frontend

2. Install dependencies

npm install

3. Start development server

npm run dev
# Frontend starts at http://localhost:5173

Verify Installation

Test the API is running correctly:

curl http://localhost:8000/api/health
# Response: {"status": "healthy"}

✓ You're ready to start using the API!