Student Project · ITUE203 · CHARUSAT

Six semesters of notes,
finally in one place
instead of ten group chats.

BrainBin centralizes semester-wise study materials, college events and Google Drive resources behind a plain login — built on PHP, MySQL and prepared statements, with an admin panel for the person who actually has to keep it organized.

6Semesters covered
2User roles
6MySQL tables
17PHP endpoints
BrainBin Project Overview
Two roles, one users table

Just user and admin — no in-between.

There's no faculty tier here. Every account is a row in users with a role column; admins get a second dashboard, students get the portal. Status checks (active / inactive) gate login before role even matters.

Student

role: "user"

Signs up with a college email, lands on a dashboard built around six semester cards plus a collective materials browser.

  • Browse materials by semester & subject
  • Open linked Google Drive folders
  • See upcoming college events
  • Download server-hosted material files

Admin

role: "admin"

The same login screen, a different landing page — full control over users, events, and which Drive folders map to which subject.

  • Promote, demote, activate, deactivate, delete users
  • Create and manage college events
  • Link Drive folders to semester + subject
  • Read the full audit log
Inside the portal

7 modules. Each one a real PHP endpoint.

Pick a module on the left — every panel lists the actual feature set and a live sample of how it behaves, checked against the project's own PHP files and SQL queries.

Authentication

POST signup.php · login.php

Plain username/password auth with PHP's password_hash(), prepared statements against MySQL, and a status check that runs before the password is even verified.

  • Username: 3-50 alphanumeric characters, server-validated
  • Password hashed with bcrypt via password_hash()
  • Inactive accounts are blocked at login, not just hidden
  • Every login and signup writes a row to audit_log

Live signup validation

    Student Dashboard

    GET dashboard.php

    The landing page after login — six semester cards, an "All Study Materials" shortcut, upcoming events pulled live from MySQL, and an FAQ accordion.

    • One card per semester (1st through 6th)
    • Upcoming events queried straight from the events table
    • Session timestamp refreshed on every dashboard load
    • Plain-JS FAQ accordion, no framework needed

    Click a semester

    Study Materials

    GET get_materials.php · download_material.php

    The server-hosted half of the materials system — files uploaded directly through the admin panel, tracked in a study_materials table with a running download count.

    • Filtered by semester (1-6) on every request
    • Joined against users to show who uploaded each file
    • download_count increments on every fetch
    • File size converted to KB for display

    Semester 3 materials

    Google Drive Resources

    GET get_drive_materials.php · POST admin_drive_actions.php

    The newer, recommended path: instead of uploading files to the server, an admin links a Drive folder to a semester + subject + material type, and it shows up for every student instantly.

    • No storage limits — Drive holds the actual files
    • One dropdown form: semester, subject, material type
    • Grouped by semester then subject on the student side
    • Automatic per-user access grant is wired but currently disabled in signup.php

    Admin: link a new folder

    Event Management

    GET manage_events.php · POST event_actions.php

    Full CRUD for college events — admins create and remove them, students see the read-only upcoming list on their dashboard.

    • event_name, event_date, description, status fields
    • Status is open or closed, shown as a colored pill
    • Newest events sort first, ordered by event_date
    • Deletes are immediate — no soft-delete flag

    Add an event

    User Management

    POST admin_actions.php

    One action endpoint, four operations — change_role, toggle_status, delete_user, all gated by a server-side admin check, and all blocked from targeting your own account.

    • Promote / demote between user and admin
    • Activate / deactivate without deleting the account
    • Hard delete, with no self-delete allowed
    • Every action writes to audit_log with an IP address

    Directory — try the row actions

    Audit & Analytics

    GET admin_dashboard.php

    The numbers on the admin landing page are live COUNT() queries, not cached stats — total users, total admins, total and open events, plus the 10 most recent audit_log rows.

    • 4 stat cards computed on every dashboard load
    • Audit log joined against users for the actor's name
    • Logs every signup, login, role change and deletion
    • No log rotation yet — table grows indefinitely

    Admin overview

    312Total users
    4Admins
    9Open events
    14Total events
    Under the hood

    6 MySQL tables, inferred from the live queries.

    There's no ORM here — just prepared statements. This schema is reconstructed directly from the SELECT/INSERT calls in the PHP files, since the SQL setup scripts described in the README aren't included in this checkout. Blue fields are foreign-key-style references.

    users

    usernameVARCHAR, unique
    emailVARCHAR, unique
    passwordVARCHAR, hashed
    roleuser / admin
    statusactive / inactive
    last_loginDATETIME

    events

    event_nameVARCHAR
    event_dateDATE
    event_descriptionTEXT
    event_statusopen / closed

    study_materials

    subjectVARCHAR
    material_typeVARCHAR
    semesterINT, 1-6
    uploaded_by→ users.id
    download_countINT

    drive_resources

    semesterINT, 1-6
    subjectVARCHAR
    drive_folder_idVARCHAR
    folder_nameVARCHAR
    created_by→ users.id

    drive_permissions

    user_id→ users.id
    resource_id→ drive_resources.id
    statusVARCHAR
    error_messageTEXT, nullable

    audit_log

    user_id→ users.id
    actionVARCHAR
    table_nameVARCHAR, nullable
    ip_addressVARCHAR
    created_atDATETIME
    Built with

    The LAMP stack, on purpose.

    No build step, no framework, no node_modules. The kind of stack you can read top to bottom in an afternoon — which is sort of the point for a Web Frameworks coursework project.

    PHP 7.4+
    mysqli, prepared statements
    MySQL 5.7+
    6 tables, no ORM
    XAMPP
    Apache + MySQL, local dev
    password_hash()
    bcrypt, PHP-native
    Vanilla HTML/CSS/JS
    No framework, no bundler
    Google Drive API
    Service account, PHP client
    Session-based auth
    30-min timeout, remember-me cookie
    Audit logging
    Every write traced to a user + IP