A modern, user-friendly barber appointment management system built with Flask, SQLite, and Bootstrap 5.
- Modern Responsive Design - Bootstrap 5 with custom glassmorphism styling
- Mobile-First Approach - Optimized for all devices
- Secure Authentication - Password hashing and session management
- Real-time Availability - Live appointment slot updates
- Professional UI/UX - Clean, intuitive interface with luxury barber theme
- Automated Testing - GitHub Actions CI/CD pipeline
- Template Validation - Jinja2 syntax checking and validation
- Easy Registration - Quick account creation
- Smart Booking System - Select date, time, and service
- Service Selection - Choose from professional hair styles
- Personal Notes - Add special requests to appointments
- Appointment History - Track all bookings and status
- Status Tracking - Real-time appointment status updates
- Dashboard Overview - Comprehensive appointment management
- Approval System - Review and approve/reject appointments
- Service Management - Add, edit, and manage hair styles
- Customer Management - View customer information
- Analytics - Appointment statistics and insights
- Real-time Updates - Auto-refresh for live data
# Clone the repository
git clone <repository-url>
cd OpenBarber
# Start with Docker Compose v2
docker compose up -d
# Access the application
open http://localhost:5000Bu proje GitHub Actions ile otomatik test ve deployment pipeline'Δ±na sahiptir:
- Multi-Python Version Testing - Python 3.8, 3.9, 3.10, 3.11
- Template Validation - Jinja2 syntax checking
- Flask Application Testing - Startup and endpoint validation
- Database Testing - SQLite operations and schema validation
- Code Quality - Flake8 linting and Black formatting
- Security Scanning - Bandit security analysis
- Vulnerability Scanning - Safety package for known vulnerabilities
- Code Security Analysis - Bandit static analysis
- Dependency Checking - Automated security updates
- Build Validation - Docker image build testing
- Compose Testing - Docker Compose v2 functionality
- Health Checks - Application health monitoring
- Staging Deployment - Automatic staging environment updates
- Production Ready - Production deployment pipeline
- Health Monitoring - Post-deployment health checks
# .github/workflows/ci.yml
name: OpenBarber CI/CD Pipeline
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main ]# Install dependencies
pip install -r requirements.txt
# Run the application
python3 app.py
# Access the application
open http://localhost:5000- Username:
admin - Password:
admin123
- Create a new account via the registration page
- All customer accounts have booking privileges
OpenBarber/
βββ .github/ # GitHub Actions workflows
β βββ workflows/
β βββ ci.yml # CI/CD pipeline configuration
βββ app.py # Main Flask application
βββ requirements.txt # Python dependencies
βββ Dockerfile # Container configuration
βββ docker-compose.yml # Docker Compose v2 setup
βββ .gitignore # Git ignore rules
βββ templates/ # Jinja2 HTML templates
β βββ base.html # Base template with navigation
β βββ index.html # Homepage with services
β βββ login.html # User authentication
β βββ register.html # Account creation
β βββ book_appointment.html # Booking interface
β βββ user_dashboard.html # Customer panel
β βββ admin_dashboard.html # Admin management
β βββ 404.html # Error page
β βββ 500.html # Server error page
βββ data/ # Database storage (Docker)
βββ barber.db # SQLite database (auto-created)
- users - Customer and admin accounts
- hair_styles - Available services with pricing
- appointments - Booking records with status tracking
- β Database tables created automatically
- β
Default admin user (
admin/admin123) - β Sample hair styles with pricing
- β Production-ready configuration
- Automated Linting - Flake8 for Python code standards
- Code Formatting - Black for consistent code style
- Template Validation - Jinja2 syntax verification
- Type Checking - Static analysis for better code quality
- Password Hashing - Werkzeug security
- Session Management - Secure user sessions
- SQL Injection Protection - Parameterized queries
- XSS Prevention - Template escaping
- Admin Privilege Separation - Role-based access
- Input Validation - Client and server-side
- Security Scanning - Bandit static analysis
- Vulnerability Monitoring - Safety dependency checking
# Run all tests locally
pip install pytest pytest-cov flake8 black bandit safety
# Code quality checks
flake8 . --max-line-length=88
black --check .
# Security scans
bandit -r .
safety check
# Template validation
python test_templates.py- Backend: Flask 2.3.2 (Python)
- Database: SQLite with automatic initialization
- Frontend: Bootstrap 5.3.0 + Font Awesome 6.4.0
- Containerization: Docker + Docker Compose v2
- Styling: Custom CSS with glassmorphism design
- JavaScript: Vanilla JS for interactions
- CI/CD: GitHub Actions for automated testing
- Code Quality: Flake8, Black, Bandit, Safety
- Template Engine: Jinja2 with validation
SECRET_KEY=your-secret-key-here
FLASK_ENV=development|productionenvironment:
- FLASK_ENV=development
- SECRET_KEY=openbarber-production-secret-key-2025python3 app.py
# Runs on http://localhost:5000 with debug modedocker compose up -d
# Runs as a daemon with volume persistencepip install gunicorn
gunicorn -w 4 -b 0.0.0.0:5000 app:app| Feature | Customer | Admin |
|---|---|---|
| View Services | β | β |
| Book Appointments | β | β |
| View Appointment History | β | β |
| Approve/Reject Bookings | β | β |
| Manage Services | β | β |
| Customer Management | β | β |
| Analytics Dashboard | β | β |
- Monday - Saturday: 9:00 AM - 6:00 PM
- Sunday: Closed
- Booking Window: Next 14 days
- Time Slots: Hourly appointments
GET /- Homepage with services and availabilityGET|POST /login- User authenticationGET|POST /register- Account creationGET|POST /book_appointment- Booking interfaceGET /user_dashboard- Customer appointment viewGET /admin_dashboard- Admin management panelGET /admin/approve_appointment/<id>- Approve bookingGET /admin/cancel_appointment/<id>- Cancel booking
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Make your changes with proper testing
- Run quality checks:
# Code formatting black . # Linting flake8 . --max-line-length=88 # Security check bandit -r . # Template validation python test_templates.py
- Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
# Clone the repo
git clone <your-fork-url>
cd OpenBarber
# Create virtual environment
python -m venv venv
source venv/bin/activate # Linux/Mac
# or
venv\Scripts\activate # Windows
# Install dependencies
pip install -r requirements.txt
pip install pytest pytest-cov flake8 black bandit safety
# Run development server
python app.py- β All tests must pass
- β Code must be formatted with Black
- β No linting errors from Flake8
- β Security checks must pass
- β Templates must be valid Jinja2
- β Add tests for new features
- β Update documentation as needed
This project is licensed under the MIT License - see the LICENSE file for details.
Database not found:
# Delete existing database and restart
rm barber.db
python3 app.pyPort already in use:
# Find and kill process using port 5000
lsof -ti:5000 | xargs kill -9Docker permission issues:
# Fix permissions
sudo chown -R $USER:$USER .For support and questions:
- π§ Email: info@openbarber.com
- π± Phone: +1 (555) 123-4567
- π Website: OpenBarber.com
OpenBarber - Where tradition meets technology πβ¨