

Login And Registration System DockerLogin And Registration System Docker
A modern and secure user authentication system built with PHP, MySQL, JavaScript, all run on Docker.
Login And Registration System Docker
A modern and secure user authentication system built with PHP, MySQL, JavaScript, all run on Docker.
Overview
A modern, secure user authentication system, featuring email verification, password reset, CSRF protection, and more.
This project is designed to provide a secure and production-ready login/register system that can be easily deployed on any device using Docker. It follows best practices for authentication, input validation, and session management, making it a solid starting point for any web application requiring user accounts.
Features
🔧 Core Functionality
- User Registration with Validation
- Secure Login with Session Management
- Email Verification using unique tokens
- Forgot Password and Reset Flow
- Responsive UI with modern design
- Clean Code and well-documented structure
🔒 Security Features
- Passwords hashed with password_hash()
- CSRF protection using unique tokens
- Input validation and sanitization
- Session hardening (httponly, secure, strict_mode)
- Email verification required before access to dashboard
🐳 Dockerized Setup
- PHP backend and MySQL database running in separate Docker containers
- Easily portable and deployable to any environment
🛠️ Tech Stack
- Frontend: HTML5, CSS3, JavaScript
- Backend: PHP (PDO)
- Database: MySQL (MariaDB)
- Email: PHPMailer (SMTP-based)
- DevOps: Docker, Docker Compose
Requirements
1. For Dockerized Setup (Recommended)
You must have the following installed:
- Docker Engine
- Version: 20.10+
- Required to run PHP and MySQL containers
- Docker Compose
- Version: 1.29+
- Used to define and run multi-container applications
2. Email Delivery (SMTP Configuration)
To use email verification and password reset, you need:
- Access to an SMTP server (e.g., Gmail, Outlook, Zoho, SendGrid)
-
Valid SMTP credentials:
- Host (e.g., smtp.gmail.com)
- Port (usually 465 or 587)
- Username
- Password or App Password
- TLS/SSL enabled
Note: If using Gmail, you may need to enable “App Passwords” and allow access for less secure apps (or use OAuth2 setup)
Instructions
Step 1: Download and place the files in a directory of your choice without changing the structure of the folders.
⚙️ Step 2: Configure Email & Database Credentials
- Open the
php/config.php
file. - Set the following variables with your own values:
// Database $db_host = 'db'; // Use 'db' for Docker-based hostname $db_name = 'login_db'; $db_user = 'user'; $db_pass = 'password'; // Email (SMTP) $mailHost = 'smtp.yourserver.com'; $mailUsername = '[email protected]'; $mailPassword = 'yourSMTPpassword'; $mailFrom = '[email protected]';
💡 Use an SMTP provider like Gmail (with App Password), Outlook, Zoho, or SendGrid.
Step 3: Start the Project with Docker
In the root project directory:
docker-compose up --build
Step x: Shut Down the Project
docker-compose down
Category | Scripts & Code / PHP Scripts / Login |
First release | 4 August 2025 |
Last update | 4 August 2025 |
Files included | .php, .css, .html, .sql, Javascript .js |
Tags | php, MySQL, Javascript, login system, php user management, email verification, registration system, docker, secure authentication, register system, login register, fullstack login project |