Skip to content

Repository files navigation

Support Kochani API

A Laravel 12 application for managing and tracking information about affected individuals in Kochani, providing both an admin panel and API endpoints for data access.

Overview

This application serves as a management system for tracking individuals affected by a disaster in Kochani. It provides:

  • Admin Panel: A Filament-powered dashboard for managing records of affected individuals
  • API: Endpoints for accessing data programmatically
  • Data Management: Tools for importing, updating, and tracking donation information

Features

Admin Panel

The application includes a comprehensive admin panel built with Filament that provides:

  • Complete CRUD operations for managing affected individuals
  • Searchable and filterable tables
  • Donation tracking and management
  • Custom actions for updating donation amounts
  • Global search functionality

API Endpoints

The application exposes the following API endpoints:

  • GET /api/hurt-people: Returns a list of all affected individuals

Data Model

The core data model (HurtPerson) includes fields for:

  • Personal information (name, surname, parent details)
  • Contact information (phone number)
  • Location data (city, country, latitude, longitude)
  • Banking details (transaction account, IBAN, SWIFT)
  • Donation tracking (amount, confirmation status)

Installation

Prerequisites

  • PHP 8.2+
  • Composer
  • MySQL or compatible database
  • Node.js & NPM (for frontend assets)

Setup Steps

  1. Clone the repository:

    git clone https://github.com/yourusername/support-kochani-api.git
    cd support-kochani-api
  2. Install PHP dependencies:

    composer install
  3. Install and compile frontend assets:

    npm install
    npm run build
  4. Create and configure your environment file:

    cp .env.example .env
    php artisan key:generate
  5. Configure your database connection in the .env file:

    DB_CONNECTION=mysql
    DB_HOST=127.0.0.1
    DB_PORT=3306
    DB_DATABASE=support_kochani
    DB_USERNAME=your_username
    DB_PASSWORD=your_password
    
  6. Run database migrations:

    php artisan migrate
  7. (Optional) Seed the database with sample data:

    php artisan db:seed --class=HurtPersonSeeder

    Note: This requires a CSV file at storage/app/supportkocani.mk - web|en|povredeni.csv

  8. Create a user for the admin panel:

    php artisan make:filament-user
  9. Start the development server:

    php artisan serve

Usage

Admin Panel

Access the admin panel at http://localhost:8000/admin and log in with your credentials.

The admin panel allows you to:

  • View and manage all affected individuals
  • Filter and search records
  • Update donation amounts
  • Track donation confirmation status

API Usage

The API can be accessed at the following endpoint:

GET http://localhost:8000/api/hurt-people

This returns a JSON collection of all affected individuals in the database.

Data Import

The application includes a seeder for importing data from a CSV file. The CSV should be placed at:

storage/app/supportkocani.mk - web|en|povredeni.csv

The CSV should use semicolons (;) as delimiters and include the following columns:

  • children
  • parents
  • phone number
  • transaction
  • city
  • country
  • amount
  • latitude
  • longitude
  • iban
  • swift
  • address
  • iban_account_holder
  • donations confirmed

Run the seeder with:

php artisan db:seed --class=HurtPersonSeeder

License

This project is open-sourced software licensed under the MIT license.

About

A Laravel 12 application for managing and tracking information about affected individuals in Kochani, providing both an admin panel and API endpoints for data access.

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages