Skip to content

meet21122005/CareSpace-Enterprise

Repository files navigation

Carespace India - Medical Equipment Rental Platform

License: MIT Python 3.9+ Node.js 18+ React 18 FastAPI SEO Optimized

Complete medical equipment rental management system with advanced SEO optimization, modern responsive design, and comprehensive backend API. Built for healthcare providers and patients seeking quality medical equipment rental services in Mumbai and across India.

πŸ“‹ Table of Contents

πŸš€ Quick Start

Prerequisites

  • Python 3.9+ with pip
  • Node.js 18+ with npm
  • Git for cloning

Moving Project to Another Computer (with Data)

Follow these steps to zip your project, move it, and ensure all data is seeded properly in PostgreSQL on another computer:

1. Zip Your Project Folder

  • Right-click your CareSpace-Enterprise folder and select β€œSend to > Compressed (zipped) folder.”
  • Or, run this in PowerShell:
    Compress-Archive -Path "d:\meet\CareSpace-Enterprise" -DestinationPath "d:\meet\CareSpace-Enterprise.zip"

2. Copy and Extract

  • Copy the ZIP file to the new computer and extract it.

3. Set Up Backend (Python)

  • Install Python (same version as before).
  • Open a terminal in the backend folder.
  • Create a virtual environment:
    python -m venv ../venv
  • Activate the virtual environment:
    ../venv/Scripts/activate
  • Install dependencies:
    pip install -r requirements.txt

4. Set Up Frontend (Node.js)

  • Install Node.js (same version as before).
  • Open a terminal in the Frontend folder.
  • Run:
    npm install

5. Set Up PostgreSQL and Seed Data

  • Install PostgreSQL and create a database (same name as before).
  • Update your .env file with the correct database credentials if needed.
  • Run your seed or migration scripts to populate the database:
    python seed_data.py
    # or
    python backend/migrate_add_key_features.py

6. Start Backend and Frontend Servers

  • Backend: Run the backend server (e.g., using uvicorn).
  • Frontend: Run the frontend dev server (e.g., npm run dev).

This will ensure your code, dependencies, and database are all set up and seeded properly on the new computer.


One-Command Setup (Windows)

# Clone repository
git clone https://github.com/yourusername/CareSpace-Enterprise.git
cd CareSpace-Enterprise

# Setup backend
cd backend
python -m venv venv
venv\Scripts\activate
pip install -r requirements.txt

# Setup database
cd ..
python seed_data.py

# Setup frontend
cd Frontend
npm install
npm run build

# Start both servers
# Terminal 1 - Backend (Port 8001)
cd backend
../venv/Scripts/uvicorn.exe app.main:app --host 127.0.0.1 --port 8001

# Terminal 2 - Frontend (Port 5174)
cd Frontend
npm run dev

Environment Configuration

Backend Environment

The backend uses SQLite by default. For PostgreSQL in production:

# Set environment variable
DATABASE_URL=postgresql://username:password@host:5432/carespace_db

Frontend Environment

Create/update Frontend/.env:

# For local development
VITE_API_URL=http://127.0.0.1:8001

# For production
# VITE_API_URL=https://your-deployed-backend-url.vercel.app

Database Setup

For Development (SQLite - Default)

The app uses SQLite by default for easy development setup. No additional configuration needed.

For Production (PostgreSQL - Enterprise)

  1. Install PostgreSQL locally or use a cloud service (Vercel Postgres, AWS RDS, etc.)
  2. Create a database named carespace_db
  3. Set environment variable:
    # Copy the example file
    cp .env.example .env
    
    # Edit .env with your PostgreSQL connection string
    DATABASE_URL=postgresql://username:password@localhost:5432/carespace_db
  4. Run migrations (if needed):
    cd backend
    python -c "from app.core.database import Base, engine; Base.metadata.create_all(bind=engine)"

Cloud Database Options

  • Vercel Postgres: Integrated with Vercel deployments
  • AWS RDS: Managed PostgreSQL service
  • Google Cloud SQL: Enterprise-grade PostgreSQL
  • Supabase: Open-source Firebase alternative

🌐 Live Demo

✨ Features

πŸ₯ Core Healthcare Features

  • πŸ“¦ Equipment Inventory - 41 medical equipment products across 10 categories
  • πŸ’° Dynamic Pricing - Flexible 1-month, 2-month, and 3-month rental plans
  • 🏷️ Category Management - Organized equipment categories (Hospital Beds, CPAP/BiPAP, Oxygen, etc.)
  • πŸ” Advanced Search - Real-time product search with filtering
  • πŸ“ž Lead Management - Customer inquiry capture and management system
  • πŸ“± WhatsApp Integration - Direct customer communication
  • πŸ“§ Contact Forms - Professional inquiry handling

πŸ”‘ Recent UI Changes

  • Login Page Slideshow: The login page now features a slideshow of local images for enhanced visual appeal.
  • Branding Update: The logo and branding have been removed from the login page for a cleaner look.
  • Performance Improvements: Login page animations and image loading have been optimized for faster interaction and reduced lag.
  • Social Login Update: Only the Google login button remains, now using the official Google logo.
  • UI Isolation: The login page is fully isolated from the UI directory and does not depend on shared UI components.
  • Promotional Text Removal: Product pages no longer display promotional text (e.g., "Flexible rental plans available β€’ Free delivery").
  • Image Cropping Fix: Slideshow images are now properly cropped and displayed using object-fit for consistent appearance.
  • Git Workflow: All recent changes have been committed and pushed to the repository.

🎨 Frontend Excellence

  • πŸ“± Responsive Design - Mobile-first approach (320px to 4K displays)
  • 🎭 Modern UI/UX - Glassmorphism effects with Tailwind CSS
  • 🎬 Smooth Animations - Framer Motion powered transitions
  • β™Ώ Accessibility - WCAG compliant with ARIA labels
  • πŸŒ™ Dark/Light Modes - Theme switching capability
  • ⚑ Performance - Vite-powered fast loading (<2s first contentful paint)

πŸ”§ Backend Power

  • πŸš€ RESTful API - Clean FastAPI endpoints with automatic OpenAPI docs
  • πŸ—„οΈ Database Integration - SQLAlchemy ORM with PostgreSQL/SQLite support (enterprise-ready)
  • βœ… Data Validation - Pydantic schemas with comprehensive error handling
  • πŸ”’ Security - CORS enabled, input sanitization, SQL injection protection
  • πŸ“Š Analytics Ready - Structured data for business intelligence

🎯 SEO & Performance

πŸ” Advanced SEO Features

  • πŸ“ Dynamic Meta Tags - Product-specific titles, descriptions, and Open Graph
  • πŸ—ΊοΈ Auto-Generated Sitemap - XML sitemap with 57+ URLs for search engines
  • πŸ€– Robots.txt - Search engine crawling instructions
  • πŸ”— Canonical URLs - Duplicate content prevention
  • πŸ“± Social Media - Open Graph and Twitter Card optimization
  • ⚑ Core Web Vitals - Optimized for Google's performance metrics

πŸ“ˆ SEO Implementation

  • Schema Markup - JSON-LD structured data for rich snippets
  • Meta Descriptions - Compelling 155-character descriptions
  • Image Optimization - Alt texts and lazy loading
  • Mobile SEO - Responsive design with mobile-first indexing
  • Page Speed - Vite build optimization (<100KB gzipped JS)

🎯 SEO Results

  • Search Visibility: Optimized for "medical equipment rental Mumbai"
  • Social Sharing: Rich previews on Facebook, WhatsApp, LinkedIn
  • Local SEO: Mumbai-focused content and contact information
  • Rich Snippets: Potential for star ratings and price displays

πŸ“Š Database Overview

Pre-loaded Healthcare Data

  • πŸ₯ 10 Categories: Air Mattress, Auto CPAP, BiPAP, DVT/Lymph Pump, Feeding, Hospital Bed, Oxygen, Monitor, Suction, Ventilator
  • πŸ“¦ 41 Products: Complete medical equipment inventory
  • πŸ’° Price Range: β‚Ή3,000 - β‚Ή81,000 (duration-based pricing)
  • πŸ“ Coverage: Mumbai + Pan-India delivery

Sample Product Categories

πŸ₯ Hospital Beds (6 products)
   β€’ ICU Beds, Semi-Fowler Beds, Fowler Beds
   β€’ β‚Ή12,000 - β‚Ή45,000/month

🫁 Respiratory Equipment (16 products)
   β€’ CPAP, BiPAP, Oxygen Concentrators, Ventilators
   β€’ β‚Ή8,000 - β‚Ή81,000/month

πŸ›οΈ Support Surfaces (3 products)
   β€’ Air Mattresses for pressure relief
   β€’ β‚Ή3,000 - β‚Ή15,000/month

πŸ“Š Patient Monitoring (2 products)
   β€’ Multi-parameter monitors
   β€’ β‚Ή15,000 - β‚Ή25,000/month

πŸ—οΈ Project Architecture

Carespace-India/
β”œβ”€β”€ οΏ½ .env.example                 # Environment variables template
β”œβ”€β”€ πŸ—„οΈ carespace.db                 # SQLite database (development)
β”œβ”€β”€ 🐍 backend/                     # FastAPI Backend
β”‚   β”œβ”€β”€ app/
β”‚   β”‚   β”œβ”€β”€ core/                   # Core functionality
β”‚   β”‚   β”‚   β”œβ”€β”€ database.py         # SQLAlchemy setup
β”‚   β”‚   β”‚   β”œβ”€β”€ deps.py             # FastAPI dependencies
β”‚   β”‚   β”‚   β”œβ”€β”€ errors.py           # Error handlers
β”‚   β”‚   β”‚   └── config.py           # App configuration
β”‚   β”‚   β”œβ”€β”€ models/                 # Database models
β”‚   β”‚   β”‚   β”œβ”€β”€ category.py         # Equipment categories
β”‚   β”‚   β”‚   β”œβ”€β”€ product.py          # Medical equipment + SEO fields
β”‚   β”‚   β”‚   β”œβ”€β”€ lead.py             # Customer inquiries
β”‚   β”‚   β”‚   └── user.py             # User management
β”‚   β”‚   β”œβ”€β”€ routes/                 # API endpoints
β”‚   β”‚   β”‚   β”œβ”€β”€ categories.py       # Category CRUD
β”‚   β”‚   β”‚   β”œβ”€β”€ products.py         # Product CRUD & search
β”‚   β”‚   β”‚   β”œβ”€β”€ leads.py            # Lead management
β”‚   β”‚   β”‚   β”œβ”€β”€ auth.py             # Authentication
β”‚   β”‚   β”‚   └── contacts.py         # Contact form handling
β”‚   β”‚   └── schemas/                # Pydantic validation
β”‚   β”‚       β”œβ”€β”€ category.py
β”‚   β”‚       β”œβ”€β”€ product.py
β”‚   β”‚       β”œβ”€β”€ lead.py
β”‚   β”‚       └── user.py
β”‚   β”œβ”€β”€ generate_sitemap.py         # SEO sitemap generator
β”‚   └── requirements.txt            # Python dependencies
β”‚
β”œβ”€β”€ βš›οΈ Frontend/                     # React + TypeScript
β”‚   β”œβ”€β”€ dist/                       # Production build (8MB)
β”‚   β”œβ”€β”€ node_modules/               # Dependencies (150MB)
β”‚   β”œβ”€β”€ public/                     # Static assets
β”‚   β”‚   β”œβ”€β”€ images/                 # Product images
β”‚   β”‚   β”œβ”€β”€ sitemap.xml            # Auto-generated sitemap
β”‚   β”‚   β”œβ”€β”€ robots.txt             # SEO crawling rules
β”‚   β”‚   β”œβ”€β”€ favicon.ico            # Site favicon
β”‚   β”‚   └── _redirects             # SPA routing
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ app/
β”‚   β”‚   β”‚   β”œβ”€β”€ components/         # Reusable UI components
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ ui/            # Shadcn/ui library
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ Navbar.tsx     # Responsive navigation
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ Footer.tsx     # Site footer
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ ProductCard.tsx # Product display
β”‚   β”‚   β”‚   β”‚   └── EnquiryPopup.tsx # Contact forms
β”‚   β”‚   β”‚   └── pages/             # Page components
β”‚   β”‚   β”‚       β”œβ”€β”€ HomePage.tsx   # Landing page
β”‚   β”‚   β”‚       β”œβ”€β”€ ProductPage.tsx # Product details
β”‚   β”‚   β”‚       β”œβ”€β”€ CategoryPage.tsx # Category listings
β”‚   β”‚   β”‚       β”œβ”€β”€ SearchPage.tsx # Search results
β”‚   β”‚   β”‚       └── AboutPage.tsx  # Company info
β”‚   β”‚   β”œβ”€β”€ services/              # API integration
β”‚   β”‚   β”‚   └── api.ts             # Axios client
β”‚   β”‚   β”œβ”€β”€ hooks/                 # Custom React hooks
β”‚   β”‚   β”œβ”€β”€ types/                 # TypeScript definitions
β”‚   β”‚   └── utils/                 # Helper functions
β”‚   β”œβ”€β”€ index.html                 # HTML template with SEO
β”‚   β”œβ”€β”€ package.json               # Node dependencies
β”‚   β”œβ”€β”€ vite.config.ts             # Build configuration
β”‚   └── tsconfig.json              # TypeScript config
β”‚
β”œβ”€β”€ πŸ“„ Product info/               # Data source files
β”‚   └── Product 1-40.txt          # Product specifications
β”œβ”€β”€ πŸ› οΈ generate_sitemap.py         # Sitemap runner script
β”œβ”€β”€ 🌱 seed_data.py                # Database initialization
β”œβ”€β”€ πŸ–ΌοΈ update_images.py            # Image management
└── πŸ“ README.md                   # This documentation

πŸ“‘ API Endpoints

🏷️ Categories API

GET    /api/categories           # List all categories
GET    /api/categories/{slug}    # Get category by slug
POST   /api/categories           # Create new category (admin)

πŸ“¦ Products API

GET    /api/products                    # List products (paginated)
GET    /api/products/{slug}             # Get product details + SEO
GET    /api/products/category/{slug}    # Products by category
GET    /api/products/{slug}/related     # Related products
GET    /api/products/search?q=query     # Search products
POST   /api/products                    # Create product (admin)

πŸ“ž Leads & Contacts API

GET    /api/leads               # List all leads
GET    /api/leads/{id}          # Get lead by ID
POST   /api/leads               # Create new lead
POST   /api/contacts            # Contact form submission

πŸ”§ System API

GET    /                        # API information
GET    /health                  # Health check
GET    /docs                    # Swagger UI documentation
GET    /redoc                   # Alternative API docs

πŸ”§ Technical Stack

Backend (FastAPI + Python)

  • πŸš€ Framework: FastAPI with async support
  • πŸ—„οΈ Database: PostgreSQL/SQLite + SQLAlchemy ORM
  • βœ… Validation: Pydantic v2 schemas
  • πŸ“š Documentation: Auto-generated Swagger/ReDoc
  • πŸ”’ Security: CORS, input validation, SQL injection protection
  • ⚑ Performance: Async endpoints, connection pooling

Frontend (React + TypeScript)

  • βš›οΈ Framework: React 18 with hooks
  • πŸ“± Language: TypeScript for type safety
  • πŸ—οΈ Build: Vite for lightning-fast development
  • 🎨 Styling: Tailwind CSS v4 + custom utilities
  • 🎬 Animation: Framer Motion for smooth UX
  • πŸ” SEO: React Helmet Async for dynamic meta tags

DevOps & Tools

  • πŸ“¦ Package Management: pip (backend), npm (frontend)
  • πŸ—‚οΈ Version Control: Git with conventional commits
  • 🐳 Container Ready: Dockerfile included
  • πŸ“Š Monitoring: Health checks and error logging
  • πŸ§ͺ Testing: API testing with automated scripts

πŸš€ Deployment

Production Backend

cd backend
pip install -r requirements.txt
python -m uvicorn app.main:app --host 0.0.0.0 --port 8000 --workers 4

Production Frontend

cd Frontend
npm install
npm run build
# Deploy the 'dist' folder to your web server

Vercel Deployment

The backend is configured for Vercel deployment with CORS headers:

  1. Backend Deployment:

    cd backend
    vercel --prod
  2. Frontend Deployment:

    cd Frontend
    vercel --prod
  3. Update Frontend Environment: After backend deployment, update Frontend/.env:

    VITE_API_URL=https://your-vercel-backend-url.vercel.app

Docker Deployment (Optional)

# Build and run with Docker
docker build -t carespace-india .
docker run -p 8000:8000 -p 5173:5173 carespace-india

🧹 Project Maintenance

Database Management

# Reset database
python seed_data.py

# Update product data
python update_products_from_files.py

# Generate SEO sitemap
python generate_sitemap.py

Frontend Maintenance

cd Frontend
npm audit                    # Security audit
npm update                   # Update dependencies
npm run build               # Production build

File Organization

  • βœ… Clean Structure: Removed 111MB of unnecessary files
  • πŸ”’ Security: No sensitive data exposed
  • πŸ“¦ Optimized: Dependencies properly managed
  • πŸ—‚οΈ Organized: Clear separation of concerns

πŸ› Troubleshooting

Common Issues

Backend won't start:

# Check Python version
python --version  # Should be 3.9+

# Reinstall dependencies
cd backend
pip install -r requirements.txt

Frontend build fails:

# Clear cache and reinstall
cd Frontend
rm -rf node_modules package-lock.json
npm install

Database connection issues:

# For SQLite (development)
python seed_data.py

# For PostgreSQL (production)
# Ensure DATABASE_URL is set in .env
python -c "from app.core.database import engine; print('DB OK' if engine else 'DB Error')"

SEO sitemap not generating:

# Check database connection
python -c "from app.core.database import engine; print('DB OK' if engine else 'DB Error')"

# Run sitemap generator
python generate_sitemap.py

πŸ“ API Usage Examples

Search Medical Equipment

curl "http://127.0.0.1:8000/api/products/search?q=cpap"

Get Product Details with SEO

curl "http://127.0.0.1:8000/api/products/auto-cpap-machine-rent"

Submit Contact Form

curl -X POST http://127.0.0.1:8000/api/contacts \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Rajesh Kumar",
    "email": "rajesh@example.com",
    "phone": "+91-9876543210",
    "subject": "Hospital Bed Rental Inquiry",
    "message": "Need to rent ICU bed for 2 months"
  }'

Create Equipment Lead

curl -X POST http://127.0.0.1:8000/api/leads \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Priya Sharma",
    "phone": "+91-9123456789",
    "email": "priya.sharma@email.com",
    "product_id": "icu-bed-uuid",
    "message": "Interested in renting ICU bed for home care"
  }'

🀝 Contributing

We welcome contributions! Please follow these steps:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/medical-equipment-search)
  3. Commit changes (git commit -m 'Add advanced search filters')
  4. Push to branch (git push origin feature/medical-equipment-search)
  5. Open a Pull Request

Development Guidelines

  • Follow PEP 8 for Python code
  • Use TypeScript strict mode
  • Write descriptive commit messages
  • Test API endpoints thoroughly
  • Ensure mobile responsiveness

πŸ“„ License

MIT License - Open source and free to use commercially.

πŸ“ž Support & Contact

Healthcare Support

  • πŸ₯ Medical Equipment: 24/7 rental support
  • 🚚 Delivery: Pan-India doorstep delivery
  • πŸ”§ Maintenance: Equipment servicing available
  • πŸ“ž Emergency: Priority support for urgent needs

πŸ₯ Carespace India - Making Quality Healthcare Accessible Through Technology ✨

Trusted medical equipment rental partner serving Mumbai and across India since 2024.

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors