β‘ 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
localStoragepersistence
π 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:
| Table | Description |
|---|---|
users | Stores user accounts (id, name, email, hashed password) |
products | Product catalog (id, name, price, photo_na, type_so, description) |
log | Activity audit trail (user_id, name, data, who, public_ip, warb_typ) |
cart | Shopping 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
| Package | Version | Purpose |
|---|---|---|
| Flask | 3.1.2 | Web framework |
| Flask-Session | 0.8.0 | Server-side session management |
| Flask-WTF | 1.2.2 | CSRF protection & form validation |
| psycopg2-binary | 2.9.11 | PostgreSQL adapter |
| python-dotenv | 1.2.1 | .env file loading |
| Werkzeug | 3.1.4 | Password hashing & utilities |
| Jinja2 | 3.1.6 | Template engine |
| WTForms | 3.2.1 | Form handling |
| cachelib | 0.13.0 | Session caching backend |
πΊοΈ API Routes
Public Routes
| Method | Route | Description |
|---|---|---|
| GET | / | Landing page (guests) / Product catalog (logged-in) |
| GET/POST | /register | User registration |
| GET/POST | /login | User login |
| GET | /logout | User logout |
Admin Routes
| Method | Route | Description |
|---|---|---|
| GET/POST | /admin/login | Admin login |
| GET | /admin/dashboard | Admin dashboard with metrics |
| GET | /admin/products | View all products |
| POST | /admin/products/add | Add a new product |
| GET/POST | /admin/products/<id>/edit | Edit a product |
| GET/POST | /admin/products/<id>/del | Delete a product |
| GET | /admin/users | View all users |
| GET | /admin/logs | View activity logs |
| GET | /admin/analytics | Analytics page |
| GET | /admin/logout | Admin 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=Laxcookie 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
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
π License
This project is open source and available under the MIT License.
Made with β€οΈ by the OL-Tager Team