Skip to content

Alonessam/patilink

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

7 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🐾 PatiLink - Campus Stray Animal Care & Task Coordination System

An elegant, secure, and modern web application developed for campus stray animal care coordination. Featured as a university course term project.

React .NET 8 Tailwind CSS SQLite License


πŸ“‹ Table of Contents


πŸ“‹ About the Project

PatiLink digitalizes and coordinates care processes for stray animals living on university campuses. Built with a responsive React frontend and a fast ASP.NET Core Minimal API backend, it connects volunteers, campus veterinarians, and administrators to ensure that no animal is left without water, food, or medical attention.

PatiLink Dashboard


πŸ—οΈ System Architecture

Below is the high-level system architecture showing how the client, backend API, database, and background services interact:

graph TD
    subgraph Frontend ["Frontend (React Client - Port 5173)"]
        UI["Vite & React App"] -->|Axios Requests| Proxy["Vite Proxy"]
    end

    subgraph Backend ["Backend (C# API Server - Port 5055)"]
        Proxy -->|API Requests| API["Minimal API Endpoints"]
        API -->|EF Core| DB[("SQLite Database")]
        Worker["CareStatus Background Service"] -->|Database Scan| DB
    end
    
    style UI fill:#20232a,stroke:#61dafb,stroke-width:2px,color:#fff
    style API fill:#512bd4,stroke:#fff,stroke-width:1px,color:#fff
    style DB fill:#003b57,stroke:#fff,stroke-width:1px,color:#fff
    style Worker fill:#e28743,stroke:#fff,stroke-width:1px,color:#fff
Loading

✨ Key Features

  • 🐱 Animal Directory: Dynamic catalog with filtering options (by campus location, urgency, status).
  • πŸ“ Interactive Location Map: Leaflet.js-powered campus map showing live feeding points. Markers dynamic color shift (green for routine, pulsing red for hungry/urgent).
  • πŸ“± Smart Location-Verified QR System: Volunteers scan physical QR codes at feeding points using their mobile camera. The system checks location validity and highlights tasks on screen, preventing remote task manipulation.
  • ⏰ 6-Hour Care Policy: An integrated backend background service scans data every 15 minutes, automatically shifting care status to "Hungry" if 6 hours have passed since last feeding.
  • πŸ₯ Health & Medical Records: Dedicated panels for veterinarians to document check-ups, vaccines, and treatments, automatically triggering follow-up tasks.
  • πŸ“¦ Need & Donation Tracking: Real-time listing of items needed (food, medication, dog beds) and tracking of volunteer donation commitments.
  • πŸ” Secure Role-Based Access Control: Standard JWT authentication protecting APIs according to roles (Admin, Vet, Volunteer).

πŸ› οΈ Technology Stack

Backend

  • .NET 8 (ASP.NET Core) β€” Minimal API framework for lightweight, fast endpoints.
  • Entity Framework Core (EF Core) β€” Code-First ORM supporting relational modeling.
  • SQLite β€” Default embedded database for easy setup (SQL Server option available in settings).
  • JWT Bearer Authentication β€” Secure token-based user sessions.
  • BCrypt.Net-Next β€” Modern password hashing.
  • Hosted Service (BackgroundService) β€” Scheduler for the 6-hour status checker.

Frontend

  • React 19 β€” Powered by Vite for fast, optimized hot-reloads.
  • Tailwind CSS v4 β€” Utility-first styling with modern native HSL palettes and custom transitions.
  • React Router v7 β€” Declarative routing with guard components.
  • Leaflet & React Leaflet β€” Interactive maps based on OpenStreetMap.
  • React QR Scanner β€” Camera-based QR decoding.
  • Lucide React β€” Premium icon set.

πŸ“‚ Project Directory Structure

patilink/
β”œβ”€β”€ server/                        # Backend API (C#)
β”‚   └── PatiLink.Api/
β”‚       β”œβ”€β”€ Data/
β”‚       β”‚   β”œβ”€β”€ PatiLinkDbContext.cs    # EF Core context class
β”‚       β”‚   └── DbSeeder.cs             # Automatic demo data seed logic
β”‚       β”œβ”€β”€ Models/
β”‚       β”‚   └── PatiLinkModels.cs       # Data schema & DTO definitions
β”‚       β”œβ”€β”€ Services/
β”‚       β”‚   └── CareStatusBackgroundService.cs  # 6-hour care rule scheduler
β”‚       β”œβ”€β”€ Program.cs                  # Config and API routing endpoints
β”‚       └── appsettings.json            # DB & JWT configurations
β”œβ”€β”€ client/                        # Frontend (React)
β”‚   └── src/
β”‚       β”œβ”€β”€ api/
β”‚       β”‚   └── apiClient.js            # Axios middleware & headers configuration
β”‚       β”œβ”€β”€ components/
β”‚       β”‚   β”œβ”€β”€ Navbar.jsx              # Responsive, role-based navigation bar
β”‚       β”‚   β”œβ”€β”€ Footer.jsx              # Footer details
β”‚       β”‚   └── ProtectedRoute.jsx      # Route guardian checks
β”‚       β”œβ”€β”€ contexts/
β”‚       β”‚   └── AuthContext.jsx         # Global context for active sessions
β”‚       β”œβ”€β”€ pages/
β”‚       β”‚   β”œβ”€β”€ Home.jsx                # Summary metrics and quick alerts
β”‚       β”‚   β”œβ”€β”€ Animals.jsx             # Animal index page
β”‚       β”‚   β”œβ”€β”€ AnimalDetail.jsx        # Detail, health logs, and tasks
β”‚       β”‚   β”œβ”€β”€ Needs.jsx               # Needs board
β”‚       β”‚   β”œβ”€β”€ Donations.jsx           # Donation tracker
β”‚       β”‚   β”œβ”€β”€ HealthLogs.jsx          # Veterinary logs
β”‚       β”‚   β”œβ”€β”€ FeedingPoints.jsx       # Map-based location organizer
β”‚       β”‚   β”œβ”€β”€ Contact.jsx             # User reports
β”‚       β”‚   β”œβ”€β”€ VolunteerPanel.jsx      # Simulation of camera scan
β”‚       β”‚   └── AdminPanel.jsx          # Admin settings
β”‚       β”œβ”€β”€ App.jsx                     # Route settings
β”‚       └── index.css                   # Tailwind CSS tokens
β”œβ”€β”€ docs/                          # Schema & documentation notes
└── README.md

πŸš€ Setup and Run

Prerequisites

1. Launch the Backend API

cd server/PatiLink.Api
dotnet run
  • The server will start by default at http://localhost:5055.
  • A PatiLink.db file will be created locally on first run and populated with rich sample data automatically.
  • Security Note: A development secret key is defined in appsettings.json. Replace it with a secure environment variable key in production.

2. Launch the React Frontend

cd client
npm install
npm run dev
  • The web app will run locally at http://localhost:5173.
  • API requests are automatically proxied to the backend via Vite config.

πŸ‘€ Demo Users & QR Codes

Test Accounts

You can test the different access control levels using the following credentials:

Email Password Role Access Level
admin@patilink.edu.tr 123 Admin Full control over locations, animals, and logs
vet@patilink.edu.tr 123 Veterinarian Can log health reports and bypass QR codes for medical tasks
gonullu@patilink.edu.tr 123 Volunteer Can assign themselves to tasks and resolve them via QR scan

QR Code Simulation

In the Volunteer Panel, you can simulate camera input by inputting these codes corresponding to local points:

QR Code Identifier Physical Location Point
QR-ENG-001 Faculty of Engineering
QR-LIB-002 Behind the Library
QR-SPO-003 Sports Hall

πŸ”Œ API Endpoints Reference

Authentication

  • POST /api/auth/register β€” Standard user registration.
  • POST /api/auth/login β€” Login (returns JWT Token).

Animals

  • GET /api/animals β€” Retreive animal list (supports query parameters).
  • GET /api/animals/{id} β€” Retrieve detailed record.
  • POST /api/animals β€” Create a new entry (Admin/Vet only).
  • PUT /api/animals/{id} β€” Update animal profile (Admin/Vet only).
  • DELETE /api/animals/{id} β€” Remove animal profile (Admin only).

Tasks & Care

  • GET /api/tasks β€” List care duties.
  • POST /api/tasks β€” Create task duty.
  • PATCH /api/tasks/{id}/assign β€” Connect task with active volunteer.
  • POST /api/tasks/{id}/complete β€” Finish task (validates location QR code).

Needs & Donations

  • GET /api/needs β€” List needed items.
  • POST /api/needs β€” Register new campus need.
  • PATCH /api/needs/{id}/status β€” Modify need status.
  • GET /api/donations β€” Retrieve donation logs.
  • POST /api/donations β€” Record new donation commitment.

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details. Developed as a term project.

About

Stray animal tracking and donation application

Topics

Resources

License

Stars

1 star

Watchers

1 watching

Forks

Packages

 
 
 

Contributors