Skip to content

Latest commit

 

History

History
172 lines (142 loc) · 5.03 KB

File metadata and controls

172 lines (142 loc) · 5.03 KB

ClyCites API

Overview

ClyCites API is a comprehensive agricultural management platform that provides a suite of services for modern farming operations. This API serves as the backend infrastructure for managing farms, crops, livestock, weather monitoring, and agricultural intelligence.

🌟 Key Features

  • Farm Management

    • Complete farm operations tracking
    • Crop and livestock management
    • Farm worker coordination
    • Smart farming capabilities
  • Weather & Alerts

    • Real-time weather monitoring
    • Customizable farm alerts
    • Weather-based recommendations
  • AI & Analytics

    • AI-powered recommendations
    • Daily farming assistance
    • Predictive analytics
    • Price monitoring
  • Team & Organization

    • Multi-user support
    • Role-based access control
    • Team collaboration features
    • Organization management

🏗 Project Structure

The ClyCites API is built using a microservices architecture, where each service is responsible for specific functionality. This design ensures scalability, maintainability, and separation of concerns. Below is a detailed breakdown of each service and its components:

System Architecture

ClyCites-api/
├── agricasst/          # Agriculture Assistant Service
│   ├── app/
│   │   ├── controllers/   # Request handlers
│   │   ├── models/       # Data models
│   │   ├── routes/       # API endpoints
│   │   ├── services/     # Business logic
│   │   └── utils/        # Helper functions
│   ├── config/          # Service configuration
│   └── middleware/      # Custom middlewares
│
├── auth/               # Authentication Service
│   ├── controllers/    # Auth controllers
│   ├── models/        # User and token models
│   ├── middlewares/   # Auth middlewares
│   └── routes/        # Auth endpoints
│
├── analytics/         # Analytics Service
├── ml-predict/       # Machine Learning Service
├── price-monitoring/ # Price Monitoring Service
├── sampling-data/    # Data Sampling Service
└── wcapi/            # Web API Service

The project is organized into several microservices:

📊 Agriculture Assistant (/agricasst)

  • Core agricultural management service that handles:
    • Crop lifecycle management (planting, monitoring, harvesting)
    • Farm resource allocation and scheduling
    • Equipment and inventory tracking
    • Soil health monitoring and recommendations
    • Irrigation management and scheduling
    • Pest and disease monitoring
    • Yield forecasting and optimization
  • RESTful API endpoints for:
    • /crops: Crop management and monitoring
    • /resources: Farm resource management
    • /schedules: Agricultural activity scheduling
    • /soil: Soil health data and analysis
    • /irrigation: Irrigation system control
    • /pests: Pest and disease tracking

📈 Analytics (/analytics)

  • Data analysis and reporting
  • Performance metrics and insights
  • Agricultural trends analysis

🔐 Authentication (/auth)

  • User authentication and authorization
  • API token management
  • Role-based access control
  • Security middleware

🤖 ML Predictions (/ml-predict)

  • Machine learning models for agriculture
  • Crop yield predictions
  • Weather pattern analysis
  • Smart farming recommendations

💰 Price Monitoring (/price-monitoring)

  • Agricultural market price tracking
  • Price trend analysis
  • Market insights

📊 Data Sampling (/sampling-data)

  • Data collection and sampling
  • Statistical analysis
  • Quality assurance

🌐 Web API (/wcapi)

  • Web-facing API endpoints
  • External integrations
  • API documentation

🚀 Getting Started

Prerequisites

  • Node.js
  • MongoDB
  • Docker (for containerized deployment)

Installation

  1. Clone the repository: ```bash git clone https://github.com/olivierndanyuzwe/ClyCites-api.git ```

  2. Install dependencies for each service: ```bash cd ClyCites-api for dir in */; do cd "$dir" npm install cd .. done ```

  3. Configure environment variables:

  • Copy the example .env files in each service directory
  • Update with your specific configuration

Running the Services

Each service can be run independently or using Docker Compose:

```bash

Using Docker Compose

docker-compose up

Running individual services

cd auth npm start ```

🔒 Security

  • JWT-based authentication
  • Rate limiting
  • API key authentication
  • Role-based access control

📚 Documentation

API documentation is available for each service. After starting the services, you can access the documentation at:

  • Authentication API: /auth/api-docs
  • Agriculture Assistant: /agricasst/api-docs
  • Weather API: /wcapi/api-docs

🤝 Contributing

We welcome contributions! Please see our contributing guidelines for details.

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

📞 Support

For support and queries, please create an issue in the repository or contact the development team.


Built with ❤️ by the ClyCites Team