Flask PostgreSQL TailwindCSS Python License

⚑ OL-Tager (NeoPulse)

A modern, full-stack e-commerce platform for healthcare & medical supplies β€” built with Flask, PostgreSQL, and a premium glassmorphism UI.

πŸ“– Overview

OL-Tager (branded as NeoPulse) is a full-featured e-commerce web application designed for browsing, managing, and purchasing medical and healthcare products. It features a sleek, modern storefront with dark/light theme support and a comprehensive admin dashboard for complete store management.


✨ Features

πŸ›οΈ Customer-Facing Storefront

  • Landing Page β€” Hero section, featured products, certifications, user reviews, and contact form
  • Product Catalog β€” Dynamic product grid with category filtering, sorting, and search
  • Product Detail Modal β€” Rich product details in a full-screen modal overlay
  • Shopping Cart β€” Slide-out cart sidebar with checkout flow
  • Dark / Light Theme β€” System-aware theme toggle with localStorage persistence

πŸ” Authentication System

  • User Registration β€” With strong password validation:
  • Minimum 8 characters
  • At least one uppercase letter, one number, and one special character
  • Duplicate username/email detection
  • Email format validation via regex
  • User Login / Logout β€” Session-based auth with 30-day cookie support
  • Password Security β€” Werkzeug generate_password_hash / check_password_hash
  • CSRF Protection β€” Flask-WTF CSRF tokens on all forms

πŸ› οΈ Admin Dashboard

  • Dashboard Overview β€” Revenue, orders, active users, and conversion rate metrics
  • Product Management β€” Full CRUD: add, edit, delete products with image upload
  • User Management β€” View all registered users
  • Activity Logs β€” Comprehensive audit trail logging:
  • User registrations, logins (success/failure)
  • Admin logins (success/failure)
  • Product updates
  • IP address tracking via api.ipify.org
  • Admin Auth β€” Separate admin login system with session-based access control

🎨 UI / UX

  • Glassmorphism Design β€” Frosted glass effects with backdrop-filter: blur()
  • Responsive Layout β€” Mobile-first design with hamburger menu and adaptive grids
  • Micro-Animations β€” Hover transitions, scale effects, and smooth scroll behavior
  • Modern Typography β€” Google Fonts (Outfit family)
  • TailwindCSS β€” Utility-first styling via CDN

πŸ—„οΈ Database Schema

The app uses PostgreSQL with four tables, auto-created on startup:

TableDescription
usersStores user accounts (id, name, email, hashed password)
productsProduct catalog (id, name, price, photo_na, type_so, description)
logActivity audit trail (user_id, name, data, who, public_ip, warb_typ)
cartShopping cart per user (id, user_id, items_id as JSONB)

πŸ—οΈ Project Structure

OL-Tager/
β”œβ”€β”€ main.py                # Flask application entry point & all routes
β”œβ”€β”€ requirements.txt       # Python dependencies
β”œβ”€β”€ .env                   # Environment variables (DB credentials)
β”œβ”€β”€ .gitignore             # Git ignore rules
β”œβ”€β”€ README.md              # This file
β”œβ”€β”€ static/
β”‚   └── img/               # Product images & assets
β”‚       └── default.png    # Default product placeholder
└── templates/
    β”œβ”€β”€ index.html          # Landing page (public storefront)
    β”œβ”€β”€ products.html       # Product catalog (authenticated users)
    β”œβ”€β”€ login.html          # User login page
    β”œβ”€β”€ register.html       # User registration page
    β”œβ”€β”€ 404.html            # Custom 404 error page
    β”œβ”€β”€ _messages.html      # Flash message partial
    β”œβ”€β”€ admin_login.html    # Admin login page
    β”œβ”€β”€ admin_dashboard.html# Admin dashboard with metrics
    β”œβ”€β”€ admin_products.html # Product management (CRUD)
    β”œβ”€β”€ admin_users.html    # User list view
    β”œβ”€β”€ admin_logs.html     # Activity logs viewer
    └── admin_analytics.html# Analytics page

πŸš€ Getting Started

Prerequisites

  • Python 3.10+
  • PostgreSQL (running locally or remote)
  • pip (Python package manager)

1. Clone the Repository

git clone https://github.com/Mhkh2642009/OL-Tager.git
cd OL-Tager

2. Create a Virtual Environment

python -m venv venv
source venv/bin/activate    # Linux / macOS
venv\Scripts\activate       # Windows

3. Install Dependencies

pip install -r requirements.txt

4. Configure Environment Variables

Create a .env file in the project root with your PostgreSQL credentials:

DB_HOST=localhost
DB_PORT=5432
DB_NAME=your_database_name
DB_USER=your_username
DB_PASSWORD=your_password

5. Run the Application

python main.py

The server will start at http://0.0.0.0:5000 (or the port specified by the PORT env variable).


πŸ”‘ Admin Access

Navigate to /admin/login to access the admin panel.

Default admin credentials are hardcoded in main.py. It is strongly recommended to change these or move them to environment variables before deploying to production.

πŸ“¦ Dependencies

PackageVersionPurpose
Flask3.1.2Web framework
Flask-Session0.8.0Server-side session management
Flask-WTF1.2.2CSRF protection & form validation
psycopg2-binary2.9.11PostgreSQL adapter
python-dotenv1.2.1.env file loading
Werkzeug3.1.4Password hashing & utilities
Jinja23.1.6Template engine
WTForms3.2.1Form handling
cachelib0.13.0Session caching backend

πŸ—ΊοΈ API Routes

Public Routes

MethodRouteDescription
GET/Landing page (guests) / Product catalog (logged-in)
GET/POST/registerUser registration
GET/POST/loginUser login
GET/logoutUser logout

Admin Routes

MethodRouteDescription
GET/POST/admin/loginAdmin login
GET/admin/dashboardAdmin dashboard with metrics
GET/admin/productsView all products
POST/admin/products/addAdd a new product
GET/POST/admin/products/<id>/editEdit a product
GET/POST/admin/products/<id>/delDelete a product
GET/admin/usersView all users
GET/admin/logsView activity logs
GET/admin/analyticsAnalytics page
GET/admin/logoutAdmin logout

πŸ”’ Security Features

  • βœ… Password hashing with Werkzeug (PBKDF2)
  • βœ… CSRF protection on all forms (Flask-WTF)
  • βœ… Server-side sessions (filesystem-backed)
  • βœ… HTTP-only session cookies
  • βœ… SameSite=Lax cookie policy
  • βœ… File upload validation with secure_filename()
  • βœ… 16 MB max upload size limit
  • βœ… Input validation (email regex, password strength)
  • βœ… Activity logging with IP tracking

🀝 Contributing

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

πŸ“„ License

This project is open source and available under the MIT License.


Made with ❀️ by the OL-Tager Team