|
Download docs/development.md from p4cng/natinel: direct link, hf CLI and curl.
- Browser
- Download file 3.28 kB
-
https://huggingface.co/spaces/p4cng/natinel/resolve/main/docs/development.md
- Command line
-
hf download hf://spaces/p4cng/natinel/docs/development.md
-
curl -L -o development.md https://huggingface.co/spaces/p4cng/natinel/resolve/main/docs/development.md
3.28 kB
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
- Clone the repository
- Navigate to the project root directory
- Run the following command:
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
- Navigate to the
backenddirectory:
cd backend
- Create a virtual environment:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
- Install dependencies:
pip install -r requirements.txt
- Run the development server:
python dev.py
The backend API will be available at http://localhost:8000
Frontend
- Navigate to the
frontenddirectory:
cd frontend
- Install dependencies:
npm install
- Run the development server:
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
- Follow the existing patterns for adding new models, schemas, and API endpoints
- All new endpoints should be added in the appropriate files under
app/api/v1/ - Database models should be added in
app/models/ - Pydantic schemas should be added in
app/schemas/
Frontend Development
- Follow Next.js best practices
- Use Tailwind CSS for styling
- Component structure should follow the existing patterns
Testing
(To be implemented)
Deployment
(To be implemented)