Skip to content

ClyCites/ClyCites-api

Repository files navigation

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

Releases

No releases published

Sponsor this project

Packages

No packages published

Contributors 2

  •  
  •  

Languages