StudyHub AI Teacher Portal
A self-hosted teacher portal for creating AI-assisted summaries, key points, flashcards and quizzes from source-page images, then publishing them to individual students.
Overview
StudyHub is a standalone PHP/MySQL application. It does not require WordPress. Teachers manage students, subjects, learning materials and quiz results from a private dashboard. Students open their own private study link and see only materials assigned to them.
AI-assisted creation
Generate summaries, key points, flashcards and multiple-choice questions from uploaded JPG or PNG source pages.
Teacher control
Review and edit AI content, publish or unpublish materials, schedule availability and regenerate content when needed.
Private student links
Each student receives a long individual token link with access only to currently available assigned materials.
Visual learning
Add a custom portal logo, student photos, material covers, flashcard images and image-based quiz questions.
Server requirements
| Item | Requirement |
|---|---|
| PHP | 8.1 or newer |
| Database | MySQL 5.7+, MySQL 8+, or compatible MariaDB with JSON support |
| PHP extensions | PDO MySQL, cURL, Fileinfo and OpenSSL |
| Web server | Apache with mod_rewrite recommended for friendly student URLs |
| HTTPS | Strongly recommended for production |
| OpenAI | The customer's own OpenAI API key for AI generation |
Installation
Create an empty MySQL or MariaDB database and a database user in cPanel or your hosting panel.
Upload the package contents to the final domain, subdomain or subfolder. Keep the included
.htaccess files.The application root must be writable during installation so StudyHub can create
config.php. The /storage directory must remain writable for source uploads.Open
https://your-domain.com/install.php. It checks requirements, imports the schema, creates the admin account and generates an application secret.After installation you are redirected to the teacher login. The password can later be changed under My account.
config.sample.php.Manual installation
If the web installer cannot create config.php, copy config.sample.php to config.php, enter the database values, generate a strong random APP_KEY, import database.sql, then use /admin/setup.php to create the first teacher account.
Connect OpenAI
The customer supplies their own API key. OpenAI API usage is billed separately by OpenAI and is not included with the StudyHub purchase.
APP_KEY. An OPENAI_API_KEY environment variable can be used instead and takes precedence.What is sent for AI generation?
StudyHub sends the uploaded source-page images together with the subject, grade/year context, title and generation instructions. The integration requests structured JSON and uses store: false.
Languages
English is the source/default interface language. The product includes 11 ready-to-use language packs:
en_USpt_BRes_ESit_ITfr_FRtr_TRja_JPde_DEpl_PLru_RUuk_UAChoose the portal language in Settings → Interface language. Bundled languages are shown with a flag for faster recognition. The AI output language is independent, so a teacher can use the dashboard in one language while generating learning materials in another.
Add another language
Create a PHP file in /languages. StudyHub discovers valid language packs automatically.
<?php
return [
'locale' => 'de_DE',
'name' => 'Deutsch',
'flag' => '🇩🇪',
'strings' => [
'Overview' => 'Übersicht',
'Students' => 'Schüler',
'Settings' => 'Einstellungen',
],
];For the complete translation map, copy an existing translated file such as es_ES.php and replace the translated values while keeping the English keys unchanged.
Branding & visual learning media
StudyHub 2.3.0 adds visual customization without exposing uploaded files directly from the storage directory.
Portal logo
Upload a JPG, PNG or WebP logo in Settings → Portal. The logo appears beside the portal name in the teacher sidebar, login screen and student portal.
Student photos
Each student can have an optional profile photo. The image appears in the Students admin area and in the student portal header.
Material image
Add an optional material image when creating or editing a material. It becomes the cover on the student dashboard and appears at the beginning of the summary.
Flashcards & quizzes
Teachers can attach an optional image to each flashcard and to each quiz question, which is useful for maps, diagrams, vocabulary, science, art and visual identification exercises.
/storage. StudyHub serves authorized images through media.php rather than allowing direct public access to the storage folders.Recommended teacher workflow
- Add one or more Subjects.
- Add Students, assign their subjects, and optionally upload a profile photo.
- Choose New material.
- Select the subject, optional title, release date/time and students. You can also add a material cover image.
- Upload source pages in the correct order.
- Keep Generate content automatically with AI enabled.
- Review the generated summary, key points, flashcards and quiz. Add optional images to flashcards or quiz questions when useful.
- Edit anything necessary and save.
- Copy each student's private link from the Students screen.
- Use Results to review or clear quiz attempts.
Use Save as draft while reviewing a material, then choose Publish material when it is ready for the assigned students.
Student access
Students do not need accounts in the default product. Each student receives a long fixed token URL such as /a/PRIVATE_TOKEN. The token behaves like a password: anyone with the link can open that student's currently published materials.
A material appears only when it is assigned to that student, has Published status and its scheduled availability time has arrived.
Security & privacy
- Use HTTPS in production.
- Never expose
config.phpor the OpenAI API key publicly. - The included Apache rules block direct web access to sensitive application paths and source uploads.
- StudyHub uses prepared PDO statements, password hashing, CSRF tokens, secure session options and basic security headers.
- Uploaded source material may contain personal or copyrighted information. The operator is responsible for having permission to upload and process it.
- Student token links should be shared privately.
Backup & migration
A complete StudyHub backup needs three pieces:
- The MySQL/MariaDB database.
- The application files, especially
config.php. - The complete
/storagedirectory with original source images, portal branding, student photos and visual learning media.
Restore all three together. If APP_KEY is replaced without re-saving the API key, an API key encrypted with the previous secret cannot be decrypted.
Troubleshooting
Installer says the folder is not writable
Temporarily allow PHP to write to the application root during installation, or create config.php manually from config.sample.php. Avoid overly permissive permissions such as 777 unless the host specifically requires a temporary workaround.
Student pretty links return 404
Confirm Apache mod_rewrite is enabled and the included .htaccess file is present. On non-Apache servers, adapt the underlying student.php?t=TOKEN route.
AI generation says the API key is missing
Open Settings → OpenAI and save a valid key, or define the server environment variable OPENAI_API_KEY.
OpenAI returns a model or permission error
Confirm the selected model is available to the OpenAI project associated with the API key and that the key has permission to create Responses. The model ID can be changed in Settings.
Uploads fail
Check PHP upload limits, the included .user.ini and permissions on /storage. The default application limits are 20 images, 6 MB per image and 50 MB total.
Frequently asked questions
/languages. StudyHub detects installed packs automatically.