Skip to content

Tiana-Coker/iFarmr-Backend

Repository files navigation

Ifarmer - Java Spring Boot Backend Application

Welcome to the Ifarmer project! This README provides an overview of the application's architecture, features, and development setup.

Table of Contents

Introduction

Ifarmer is a Java Spring Boot-based backend application designed to handle various agricultural and farming operations. This includes managing users, posts, comments, likes, notifications, and more. The project is structured to support scalability, maintainability, and ease of integration with other systems such as frontend applications.

Features

  • User Management: Secure authentication, authorization, and profile management.
  • Post Management: Create, edit, and delete posts with support for likes and comments.
  • Notification System: Real-time notifications for various user activities (e.g., new posts, likes, comments).
  • Recent Activities Feed: Aggregated view of the most recent activities, including new posts, comments, and likes.
  • Firebase Integration: Push notifications using Firebase Cloud Messaging (FCM).
  • Role-Based Access Control: Secure access to different parts of the application based on user roles.
  • Logging and Monitoring: Integrated logging to troubleshoot issues effectively.

Architecture Overview

The Ifarmer application is built using the Spring Boot framework, following a layered architecture:

  1. Controller Layer: Handles HTTP requests and responses.
  2. Service Layer: Contains business logic and interacts with the data access layer.
  3. Repository Layer: Manages database interactions using Spring Data JPA.
  4. Security Layer: Manages authentication, authorization, and security configurations.

The application also integrates with third-party services such as Firebase for push notifications and supports real-time data synchronization.

Modules and Key Components

  • User Module: Manages user-related operations such as registration, authentication, profile updates, and role assignments.
  • Post Module: Handles the creation, editing, deletion, and retrieval of posts, along with associated comments and likes.
  • Notification Module: Manages notifications for user activities, including sending and retrieving notifications.
  • Firebase Integration: Manages push notifications using Firebase Cloud Messaging (FCM).

Development Setup

To set up the development environment for Ifarmer, follow these steps:

  1. Clone the Repository:

    git clone https://github.com/yourusername/ifarmer.git
    cd ifarmer
    
  2. Set Up Environment Variables:

    Configure the required environment variables such as database credentials, Firebase configuration, and other application-specific settings.

  3. Install Dependencies:

    Ensure you have Java 17 and Maven installed. Then, install the required dependencies:

    mvn clean install
    
  4. Set Up the Database:

    Configure your database (e.g., MySQL) and update the application.properties file with the correct database settings.

  5. Run the Application:

    mvn spring-boot:run
    

Build And Run

To build the Ifarmer project, use the following command:

mvn clean package

This will create a jar file in the target directory that can be run using:

java -jar target/ifarmer-0.0.1-SNAPSHOT.jar

Contributing

If you'd like to contribute to Ifarmer, please follow these guidelines:

  1. Fork the repository and create your feature branch (git checkout -b feature/YourFeature).
  2. Commit your changes (git commit -am 'Add some feature').
  3. Push to the branch (git push origin feature/YourFeature).
  4. Create a new Pull Request.

License

Ifarmer is open-source software licensed under the MIT license. See the LICENSE file for more information.