# Nature Intelligence for Business Platform - Development Setup ## Overview This document provides instructions for setting up and running the Nature Intelligence for Business Platform locally for development purposes. ## Prerequisites - Docker and Docker Compose - Node.js (for local development without Docker) - Python 3.11+ (for local development without Docker) ## Quick Start with Docker 1. Clone the repository 2. Navigate to the project root directory 3. Run the following command: ```bash docker-compose up --build ``` This will start three services: - Frontend (Next.js) on http://localhost:3000 - Backend (FastAPI) on http://localhost:8000 - PostgreSQL with PostGIS on port 5432 ## Manual Setup ### Backend 1. Navigate to the `backend` directory: ```bash cd backend ``` 2. Create a virtual environment: ```bash python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate ``` 3. Install dependencies: ```bash pip install -r requirements.txt ``` 4. Run the development server: ```bash python dev.py ``` The backend API will be available at http://localhost:8000 ### Frontend 1. Navigate to the `frontend` directory: ```bash cd frontend ``` 2. Install dependencies: ```bash npm install ``` 3. Run the development server: ```bash npm run dev ``` The frontend will be available at http://localhost:3000 ## API Documentation Once the backend is running, you can access the API documentation at: - Swagger UI: http://localhost:8000/docs - ReDoc: http://localhost:8000/redoc ## Project Structure ``` nature-intelligence/ ├── frontend/ # Next.js frontend application │ ├── src/ # Source code │ │ ├── app/ # App router pages │ │ │ └── dashboard/ # Dashboard page │ │ ├── components/ # Reusable components │ │ └── services/ # API service layer │ ├── public/ # Static assets │ └── ... # Configuration files ├── backend/ # FastAPI backend application │ ├── app/ # Application source code │ │ ├── api/ # API routes │ │ │ └── v1/ # API version 1 │ │ ├── core/ # Core utilities and configurations │ │ ├── models/ # Database models │ │ ├── schemas/ # Pydantic schemas │ │ └── database/ # Database configuration │ ├── main.py # FastAPI application entry point │ └── requirements.txt # Python dependencies ├── docker-compose.yml # Docker Compose configuration └── README.md # This file ``` ## Development Guidelines ### Backend Development 1. Follow the existing patterns for adding new models, schemas, and API endpoints 2. All new endpoints should be added in the appropriate files under `app/api/v1/` 3. Database models should be added in `app/models/` 4. Pydantic schemas should be added in `app/schemas/` ### Frontend Development 1. Follow Next.js best practices 2. Use Tailwind CSS for styling 3. Component structure should follow the existing patterns ## Testing (To be implemented) ## Deployment (To be implemented)