Skip to content

Repository files navigation

Vet Insights

A full-stack veterinary blog and e-commerce platform built with Flask, featuring comprehensive content management and online store functionality.

🌟 Overview

Vet Insight combines a veterinary blog with an e-commerce platform for vet products. It includes a complete content management system, shopping cart functionality, order management, and a comprehensive admin dashboard with analytics.

Live Site: vet-insights.com
Deployment: fassihulabbas.onrender.com

✨ Features

  • Blog System: Full-featured blog with TinyMCE WYSIWYG editor
  • E-commerce Store: Product catalog with variants, shopping cart, and checkout
  • Order Management: Complete order processing with email confirmations
  • Admin Dashboard: Extensive admin panel with analytics and management tools
  • Inventory Management: Stock tracking and product management
  • Booking System: Appointment/booking management
  • SEO Optimized: Google Search Console integration, sitemaps, robots.txt
  • Mobile Responsive: Fully responsive design without frameworks

🛠️ Tech Stack

  • Backend: Flask (Python)
  • Frontend: HTML, JavaScript, Tailwind CSS (locally installed)
  • Database: Supabase (PostgreSQL)
  • Image Storage: Cloudinary
  • Email: Gmail with App Passwords
  • Deployment: Render.com
  • Domain: Spaceship
  • Editor: TinyMCE (embedded WYSIWYG)

📁 Project Structure

├── blueprints/
│   ├── admin/
│   │   ├── __init__.py
│   │   ├── routes.py
│   │   └── templates/admin/
│   ├── auth/
│   ├── store/
│   ├── sitemap/
│   └── blog/
├── static/
│   ├── css/
│   │   └── main.css (generated by Tailwind)
│   ├── img/
│   │   └── favicon.ico
│   └── js/
|   |
|   └── robots.txt
|   └── areas.json (Lahore data)
├── templates/
├── db_models.py
├── email_templates.py
├── forms.py
├── utils.py
├── server.py (main app)
├── requirements.txt
└── Procfile

🚀 Deployment

The application is deployed on Render with the following setup:

  • Tier: Render.com (Starter Web Service Package)
  • Repository: Public GitHub repo monitoring
  • Domain: vet-insight.com (registered through Spaceship)
  • SEO: Google Search Console, sitemaps, robots.txt configured

Environment Variables (Production)

GMAIL_APP_PASSWORD=your_gmail_app_password
GMAIL_ADDRESS=your_gmail_address
CLOUD_NAME=your_cloudinary_cloud_name
CLOUDINARY_API_KEY=your_cloudinary_api_key
CLOUDINARY_API_SECRET=your_cloudinary_api_secret
SUPABASE_CONNECTION_STRING=your_supabase_connection_string
SECRET_KEY=your_flask_secret_key
SUPERADMIN_PHONE_NUMBER=superadmin_phone
SUPERADMIN_EMAIL=superadmin_email

💻 Local Development Setup

Prerequisites

  • Python 3.x
  • Node.js (for Tailwind)
  • Git

Setup Steps

  1. Clone the repository

    git clone [repository-url]
    cd vet-insight
  2. Set up Python environment

    pip install -r requirements.txt
  3. Configure for local development

    export FLASK_ENV=development
    export FLASK_APP=server.py
  4. Database Setup (Local)

    • Remove the getenv call for database URI
    • Replace with SQLite: sqlite:///example.db
    • Comment out error handlers
    • Comment out zoneinfo calls in email_templates.py (Windows compatibility)
    • Comment out sitemap blueprint (hardcoded domain)
  5. Create initial admin user

    python db_init.py  # Creates hashed superadmin user
  6. Start development servers

    # Terminal 1: Flask app
    flask run --debug
    
    # Terminal 2: Tailwind CSS
    npm run dev

🔐 Authentication & Authorization

  • Authentication: Flask-Login with Flask-WTF CSRF protection
  • User Roles:
    • Superadmins: Cannot be deleted, can manage all aspects
    • Admins: Can manage site content and orders
  • Admin Access: /admin route
  • Guest Shopping: Cart functionality without login required

📝 Content Management

Adding Blog Articles

  1. Navigate to Admin Panel → Dashboard
  2. Click "Manage Articles" or use sidebar
  3. Click "Add Article"
  4. Use TinyMCE editor with title, description, tags, thumbnail (optional)

Managing Products

  1. Access through admin panel
  2. Add products with stock, purchase price, sale price
  3. Create product variants through built-in UI
  4. Manage inventory and product images

🛒 E-commerce Flow

  1. Browse Products: Customers view product catalog
  2. Add to Cart: Products stored in Chrome local storage
  3. Checkout: Customer fills details (Cash on Delivery only)
  4. Order Confirmation: Thank you page with order ID and receipt
  5. Email Notifications: Customer and admin receive order emails
  6. Order Management: Admin calls to confirm, then delivers or cancels
  7. Status Updates: Email notifications for order status changes

📧 Email Integration

  • Service: Gmail with App Passwords
  • Order Confirmations: Automatic receipts to customers
  • Admin Notifications: Order alerts to administrators
  • Cancellation Emails: Automated status updates

🗄️ Database Schema

All data stored in Supabase (PostgreSQL):

  • Articles and blog posts
  • Admin users and authentication
  • Bookings and appointments
  • Orders and order items
  • Products and product variants
  • Product images
  • Inventory tracking

Note: Migrations are set up for Supabase (production DB only)

🔧 External Integrations

  • Google Icons API: Icon resources
  • Gmail: Email functionality via App Passwords
  • Cloudinary: Image storage and management
  • TinyMCE: Rich text editor

📱 Frontend

  • CSS Framework: Tailwind CSS (locally installed, not CDN)
  • Responsive Design: Mobile-first responsive design
  • JavaScript: Vanilla JavaScript for cart and interactive features
  • No External Frameworks: Pure HTML/CSS/JS implementation

🛡️ Security Features

  • Flask-WTF CSRF protection on all forms
  • Protected admin routes
  • Secure file upload handling (POST only for upload_image and video_upload)
  • Session-based authentication with Flask-Login

⚠️ Known Limitations

  • Testing: No automated tests implemented (manual testing only)
  • Backup: No automated backup system configured
  • Maintenance: Manual maintenance required when issues arise
  • Payment: Cash on Delivery only
  • Scope: Project considered complete as delivered

🚨 Production Notes

  • Maintenance: Admin responsible for ongoing management
  • Testing: All functionality hand-tested during development
  • Environment: Production-only database migrations

📞 Support

For technical questions or issues, contact the original developer: Syed Zain Ul Abideen Email: goodtingbye2@gmail.com

📄 License

No formal license. Created by Syed Zain Ul Abideen.


This documentation was created to help future developers understand and maintain the Vet Insight platform.

About

Portfolio/Blog Website for Dr. Fassih Ul Abbas

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages