A modern web application for organizing, tracking, and managing digital coupons with automated expiry notifications and sharing capabilities.
- User Authentication: Secure registration and login system with password hashing
- Coupon Management: Add, edit, delete, and organize digital coupons
- Smart Dashboard: Intuitive grid-based interface with real-time filtering
- Advanced Search: Filter by category, store, expiry date, and discount percentage
- Expiry Alerts: Automated email notifications for soon-to-expire coupons
- Coupon Sharing: Share coupons with other registered users
- Usage Tracking: Mark coupons as used and track savings
- Responsive Design: Optimized for mobile, tablet, and desktop
- Modern UI: Dark theme with lime accents and smooth animations
- AJAX Search: Real-time filtering without page reloads
- Interactive Elements: Copy-to-clipboard, hover effects, and modal interfaces
- Profile Management: Custom profile pictures and user statistics
- PHP 8.1+: Server-side logic and templating
- MySQL 8.0: Relational database with ACID compliance
- PDO: Secure database abstraction layer with prepared statements
- PHPMailer: Email delivery for notifications
- Composer: Dependency management
- HTML5: Semantic markup and modern standards
- Tailwind CSS: Utility-first CSS framework for rapid development
- JavaScript (ES6+): Interactive functionality and DOM manipulation
- GSAP: High-performance animations and scroll triggers
- AJAX: Asynchronous data loading and form submissions
- XAMPP/WAMP: Local development environment
- Git: Version control
- VS Code: Development environment
Before installing Layers, ensure you have:
- Web Server: Apache 2.4+ or Nginx
- PHP: Version 8.1 or higher
- MySQL: Version 8.0 or higher
- Composer: For PHP dependency management
- Node.js (optional): For Tailwind CSS compilation
git clone https://github.com/yourusername/layers.git
cd layers# Install PHP dependencies
composer install
# Install frontend dependencies (if using Tailwind CLI)
npm install- Open
src/config/db.php - Update database credentials:
define('DB_SERVER', 'localhost');
define('DB_USERNAME', 'your_username');
define('DB_PASSWORD', 'your_password');
define('DB_NAME', 'coupon_organizer');The application will automatically:
- Create the database if it doesn't exist
- Set up all required tables
- Handle schema migrations
- Open
src/includes/expiry_alert.php - Configure SMTP settings:
$mail_config = [
'host' => 'smtp.gmail.com',
'username' => 'your-email@gmail.com',
'password' => 'your-app-password',
'port' => 587
];Point your web server document root to the src/ directory.
For XAMPP users:
- Place the project in
htdocs/layers/ - Access via
http://localhost/layers/src/
layers/
โโโ src/ # Main application directory
โ โโโ assets/ # Static assets
โ โ โโโ images/ # Images and icons
โ โ โโโ js/ # JavaScript files
โ โโโ components/ # Reusable PHP components
โ โ โโโ header.php
โ โ โโโ footer.php
โ โโโ config/ # Configuration files
โ โ โโโ db.php # Database connection
โ โ โโโ db_setup.php # Database schema
โ โ โโโ db_setup_notifications.php
โ โโโ cron/ # Automated tasks
โ โ โโโ check_expiring_coupons.php
โ โ โโโ setup_cron.php
โ โโโ includes/ # Include files
โ โ โโโ auth_header.php # Authentication logic
โ โ โโโ expiry_alert.php # Email notifications
โ โ โโโ header.php # Common header
โ โโโ logs/ # Application logs
โ โโโ pages/ # Application pages
โ โ โโโ dashboard.php # Main dashboard
โ โ โโโ login.php # User authentication
โ โ โโโ register.php # User registration
โ โ โโโ profile.php # User profile
โ โ โโโ [other pages]
โ โโโ uploads/ # User uploads
โ โ โโโ profile_images/
โ โโโ index.php # Landing page
โ โโโ output.css # Compiled Tailwind CSS
โ โโโ script.js # Main JavaScript file
โโโ vendor/ # Composer dependencies
โโโ composer.json # PHP dependencies
โโโ package.json # Node.js dependencies
โโโ README.md # This file
- Register an Account: Create a new user account with your email
- Login: Access your personal dashboard
- Add Coupons: Click "Add Coupon" to start organizing your deals
- Set Up Notifications: Configure email alerts for expiring coupons
- Add: Use the modal form to input coupon details
- Edit: Click the edit icon on any coupon card
- Delete: Remove unwanted coupons with confirmation
- Mark as Used: Track which coupons you've redeemed
- Share: Send coupons to other registered users
- Search: Type to find coupons by name, store, or code
- Filter: Use category dropdown to narrow results
- Sort: Organize by expiry date or discount percentage
- Toggle Expired: Show or hide expired coupons
The application includes an automated notification system:
- Daily Checks: Runs via cron job to identify expiring coupons
- Email Alerts: Sends personalized notifications 24 hours before expiry
- Visual Indicators: Dashboard highlights soon-to-expire coupons
- Testing Mode: Use
?test=1parameter for manual testing
Add this to your crontab for daily checks:
# Run daily at 9:00 AM
0 9 * * * /usr/bin/php /path/to/layers/src/cron/check_expiring_coupons.php- Modify
src/input.cssfor custom Tailwind styles - Recompile with
npm run buildornpx tailwindcss build - Color scheme can be adjusted in
tailwind.config.js
- Customize email layouts in
src/includes/expiry_alert.php - Modify HTML structure and styling as needed
- Add new coupon categories in the database
categoriestable - Update frontend dropdown options accordingly
- Password Hashing: Uses PHP's
password_hash()with salt - SQL Injection Prevention: PDO prepared statements throughout
- XSS Protection: All outputs escaped with
htmlspecialchars() - Session Security: Secure session management with regeneration
- Input Validation: Server-side validation for all forms
- File Upload Security: Type and size validation for profile images
- users: User accounts and profile information
- coupons: Coupon details and metadata
- shared_coupons: Coupon sharing relationships
- categories: Predefined coupon categories
- notifications: User notification history
- One-to-many: Users โ Coupons
- Many-to-many: Users โ Shared Coupons
- Foreign key constraints ensure data integrity
Database Connection Error
Solution: Check database credentials in src/config/db.php
Ensure MySQL service is running
Email Notifications Not Working
Solution: Verify SMTP settings in src/includes/expiry_alert.php
Check if app passwords are required for Gmail
Tailwind Styles Not Loading
Solution: Ensure output.css is compiled
Run: npx tailwindcss -i src/input.css -o src/output.css --watch
XAMPP Permission Issues
Solution: Ensure proper file permissions
On Linux/Mac: chmod -R 755 layers/
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
- Follow PSR-12 PHP coding standards
- Use meaningful commit messages
- Add comments for complex logic
- Test thoroughly before submitting
This project is licensed under the MIT License - see the LICENSE file for details.
If you encounter any issues or have questions:
- Check the Issues page
- Create a new issue with detailed description
- Include error messages and steps to reproduce
- Mobile app development (React Native/Flutter)
- Browser extension for automatic coupon detection
- Integration with popular shopping sites
- Advanced analytics and savings reports
- Social features and coupon communities
- API for third-party integrations
- Multi-language support
- Dark/light theme toggle
- Tailwind CSS for the utility-first CSS framework
- GSAP for high-performance animations
- PHPMailer for email functionality
- Font Awesome for icons (if used)
Built with โค๏ธ for smart shoppers who never want to miss a deal!
For more information, visit our documentation or contact the development team.
