A robust web-based peer support and anonymous guidance platform built with PHP, MySQL, and jQuery. It allows students to safely book counseling sessions with verified Peer Listeners (Navigators) from the ZNNHS Turno Peer Health Navigators Network (PHNN), while administrators oversee registration logs and platform-wide approvals with ease.
- PHP 8.x
- MySQL / MariaDB
- PHPMailer
- jQuery & AJAX
- Vanilla CSS
# Clone the repository git clone https://github.com/wayne2604/peerlink.git # Navigate to the directory cd peerlink # Copy the example config and add your DB credentials cp includes/db_connect.php.example includes/db_connect.php
Ensure you have a local server (like XAMPP) running, the database schema (if0_41094727_peerlink.sql) imported, and your mail settings configured in send_otp.php to get started.
- Multi-Role Authentication β Secure landing gates and custom dashboards tailored for Students (Clients), Peer Listeners (Navigators), and Administrators.
- Anonymous Session Booking β Simple peer selection workspace allowing students to review listener specialties, beliefs, personalities, and hobbies.
- Real-Time Interactive Chat β Robust chat rooms running asynchronous background queries to facilitate continuous, smooth communication between students and active listeners.
- AI-Powered Automated Support β Dedicated automated FAQ bot integrated directly into the client and listener portals for immediate advice.
- Listener Verification Gate β Secure backend verification queues where admins review, approve, or reject prospective peer listener accounts.
- Safety Flags & Referral Redirects β Immediate crisis flags redirecting users directly to Guidance Counselor offices and Department of Health support resources when a session is reported.
- Dark Mode Compatibility β Full responsive design featuring light and dark theme toggles synced flawlessly via browser LocalStorage.
The system follows a modular PHP architecture designed for reliability, responsiveness, and ease of use:
- Database Connectivity: Uses
mysqliwith secure parameterized database preparation to ensure clean queries and robust authentication checking. - Decoupled Logic: System components are highly modularized, isolating UI presentation layers (e.g.,
student_home.php,listener_dashboard.php) from logic engines (e.g.,login_process.php,post_data.php). - Secure Recovery System: Connects PHPMailer dynamically to SMTP servers to generate and send secure 6-digit One-Time Passwords (OTPs) for swift password recovery.
- Asynchronous Chat Polling: Incorporates jQuery AJAX streams to continuously poll for message updates, allowing peer-to-peer chats to behave in real-time.
/
βββ PHPMailer/ # Core PHPMailer library for SMTP email dispatch
βββ css/ # Stylesheets, styling variables, and layout styles
βββ images/ # App assets, system logo, and avatars
βββ includes/ # Shared backend dependencies and config files
β βββ db_connect.php # Main database connection file (gitignored)
β βββ db_connect.php.example # Database connection configuration template
βββ admin_dashboard.php # Admin hub for pending approvals and user registries
βββ booking_form.php # Booking interface for students to describe and reserve sessions
βββ communication_room.php # Secure live-chat workspace for ongoing support sessions
βββ forgot_password.php # Initialization form to send recovery codes via email
βββ index.php # Main login page and entry point for all roles
βββ listener_dashboard.php # Navigator console for profile editing and incoming request management
βββ load_data.php # AJAX helper to fetch new chat messages securely
βββ login_process.php # Authentication logic and secure session starter
βββ post_data.php # AJAX helper saving newly sent message strings
βββ register.php # Unified client registration and validation form
βββ send_otp.php # Core PHP code sending one-time recovery passwords via SMTP
βββ student_home.php # Client console featuring listener selection and FAQ bot
βββ terminate_session.php # Logic ending or escalating peer support chat sessions
βββ verify_otp.php # Code validation page to finalize account password resets
Wayne β github.com/wayne2604