Pawthos_Website

Pawthos System – Overview and Setup Guide

This repository contains the Pawthos system: a FastAPI backend with a React (TypeScript + Tailwind) frontend for pet, medical, vaccination, appointments, reports/alerts, and administrative record management.

Project Structure

Pawthos/
  backend/                # FastAPI app, SQLAlchemy models, Alembic migrations
    core/                 # auth, config, database, models, schemas
    routers/              # feature routers (auth, users, pets, medical, etc.)
    alembic/              # migrations and config
    main.py               # FastAPI app entrypoint (run with uvicorn)
  frontend/               # React app (CRA + TypeScript + Tailwind)
    public/               # static assets, redirects (SPA routing)
    src/                  # UI, hooks, services, router
  documentation/          # this guide and feature docs

GitHub Repository Location

Prerequisites

Setup

  1. Install backend dependencies:
    cd backend
    pip install -r requirements.txt
    
  2. Environment Configuration:
    • Copy env.example to .env (in backend/)
    • Update the following variables:
      • DATABASE_URL: Your PostgreSQL connection string
      • SECRET_KEY: A secure random string for JWT tokens
      • SMTP_USER: Your Gmail address (for sending OTP)
      • SMTP_PASS: Your Gmail App Password (not your Gmail login password)
  3. Database Setup:
    • Ensure PostgreSQL is running and accessible
    • Apply migrations (from backend/):
      alembic upgrade head
      
  4. Run the backend (dev):
    uvicorn main:app --reload --port 8000
    
  5. Run the frontend (dev):
    cd ../frontend
    npm install
    npm start
    

Backend: http://localhost:8000 Frontend: http://localhost:3000

Authentication and Roles

Backend Modules (key)

Database Migrations (Alembic)

From backend/:

alembic revision -m "<message>"   # generate new migration after model changes
alembic upgrade head               # apply
alembic downgrade -1               # rollback last

Frontend Build and SPA Routing

cd frontend
npm run build

Serve frontend/build/ with a static host and enable SPA fallback to index.html for unknown routes. See documentation/frontend-README.md for examples (Netlify, Vercel, Nginx, Apache).

Development Notes

Quickstart (copy/paste)

# Backend
cd backend
pip install -r requirements.txt
alembic upgrade head
uvicorn main:app --reload --port 8000

# Frontend
cd ../frontend
npm install
npm start