Simple PHP + MySQL login system for a Coffee Shop Point of Sale (POS).
Features:
- User registration
- Login with password hashing
- Session handling
- Role-based dashboard (admin, barista, cashier)
Requirements
- XAMPP (Apache + MySQL)
- PHP 7.4+ (mysqli extension)
Setup
- Place the
POSfolder in your XAMPPhtdocs(already assumed:C:/xampp/htdocs/POS). - Start Apache and MySQL from the XAMPP Control Panel.
- Create the database and tables: import
db/schema.sqlinto phpMyAdmin or run the SQL file.- You can import via phpMyAdmin or run
mysql -u root -p < db/schema.sql.
- You can import via phpMyAdmin or run
- Edit
config.phpif your MySQL username/password differ from defaults. - Seed an admin user (optional but recommended): open
http://localhost/POS/seed_admin.phpin your browser. This creates anadminuser with passwordAdmin@123if it doesn't exist. - Open
http://localhost/POS/to access the login page.
Files & locations
config.php- DB config and helperinit.php- session and auth helpersindex.php- login formlogin.php- login handlerregister_form.php- registration formregister.php- registration handlerlogout.php- logoutdashboard.php- role routerdashboard_admin.php,dashboard_barista.php,dashboard_cashier.php- role pagesdb/schema.sql- SQL schemaseed_admin.php- creates admin user with hashed password
Next steps / improvements
- Add CSRF protection and input sanitization for production.
- Add email verification and password reset.
- Add logging and stronger role management (disable self-registration for admin).
Copyright © 2026 Aldrian Loberiano.
This project is intended strictly for personal use.
Any unauthorized commercial use, distribution, or copying of the code or materials in this repository is prohibited and may constitute copyright infringement.