Skip to content

Latest commit

 

History

17 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CSTU Archive — Setup Guide

This project is built using Flutter (frontend) and PHP/MySQL (backend).
The Flutter code is inside the lib/ folder, and the PHP API scripts are inside the api/ folder.

Requirements

🔹 Flutter SDK (stable channel) 🔹 Android Studio or VS Code with Android SDK
🔹 PHP 7.4+ and MySQL/MariaDB
(Windows: XAMPP/WAMP, macOS: MAMP, Linux: LAMP)

Clone and Install Dependencies✅

git clone https://github.com/Nafiz-Mostofa/cstu_archive.git<br>
cd cstu_archive
flutter pub get

Database Setup✅

Create a MySQL database named "flutter_auth".

Create the required tables (or import them if you have a .sql file):

students table example:
student_id (PK)  VARCHAR
student_name     VARCHAR
username         VARCHAR NULL
email            VARCHAR NULL
password         VARCHAR NULL
gp               DECIMAL
semester_credit  DECIMAL
total_credit     DECIMAL
gpa              DECIMAL
cgpa             DECIMAL
failed_subjects  INT
subjects_to_register TEXT
adminpanel table:
id (PK)      INT AI
email        VARCHAR UNIQUE
username     VARCHAR NULL
password     VARCHAR NULL
phone        VARCHAR NULL
Insert the three allowed admin emails first (leave username, password, and phone as NULL):
cstuadmin1@gmail.com
cstuadmin2@gmail.com
cstuadmin3@gmail.com
Note: Make sure the email addresses are correct. You can input any gmail according to your need.

4) PHP API Configuration✅

Place php file in your local device for database connection:

Download each php file given in the api folder of GitHub and place it in a folder named after the name of the Database.
If your database name is "flutter_auth" than your folder name will be "flutter_auth".
And the folder should be placed in this path C:\xampp\htdocs.

🔹(Make sure your Apache/PHP server is running, so you can access the API at http://localhost/api/.)

5) Set the Base API URL in Flutter✅

Edit lib/services/auth_service.dart and lib/services/admin_auth_service.dart and update the baseUrl:

🔹Android Emulator:
http://your_ip_address/api/
🔹iOS Simulator:
http://127.0.0.1:8080/api/

To find your PC's IP:

🔹Windows: ipconfig → check IPv4 under Wi-Fi/Ethernet
🔹macOS/Linux: ifconfig or ip a

6) Allow HTTP in Android (Cleartext Traffic)✅

If you use HTTP instead of HTTPS, add this inside the tag in android/app/src/main/AndroidManifest.xml:

android:usesCleartextTraffic="true"

7) Run the Project✅

flutter run

8) Login & Signup Flow (Summary)✅

🔹Student Signup: Requires a valid student_id. Once registered, the same ID cannot be used again.
🔹Student Login: Signup username + password.
🔹Forgot Password (Student): Verifies student_id + username before allowing password reset.
🔹Admin Signup: Only works for pre-added emails in the adminpanel table. Can register once only.
🔹Admin Login: Signup username + password.
🔹Admin Forgot Password: Verifies email + username before allowing password reset.

9) Common Issues & Solutions✅

Problem: API not reachable from phone

Solution:

🔹Ensure phone & PC are on the same network.
🔹Use your PC’s LAN IP in baseUrl.
🔹Check if firewall/antivirus is blocking Apache/PHP.
Problem: ERR_CONNECTION_TIMED_OUT

Solution:

🔹Check Apache/PHP is running.
🔹Open http://localhost/api/get_all_students.php in browser.
🔹Verify IP/port in baseUrl.
Problem: 500 / DB connection failed

Solution:

🔹Check database credentials in db_connect.php.
🔹Verify MySQL is running.
Problem: UI overflow when keyboard opens

Solution:

🔹The app uses resizeToAvoidBottomInset: true and SingleChildScrollView.
🔹If still happening, adjust small-screen font scaling in device settings.

10) Project Structure (Short)✅

cstu_archive/
 ├─ lib/
 │   ├─ services/
 │   │   ├─ auth_service.dart
 │   │   └─ admin_auth_service.dart
 │   └─ screens...
 ├─ api/
 │   ├─ db_connect.php
 │   ├─ login.php
 │   ├─ signup.php
 │   ├─ forgot_password.php
 │   ├─ get_user_details.php
 │   ├─ get_all_students.php
 │   ├─ admin_login.php
 │   ├─ admin_signup.php
 │   └─ admin_forgot_password.php
 ├─ android/
 ├─ pubspec.yaml
 └─ README.md

11) Build for Production✅

flutter build apk --release
or
flutter build appbundle --release

Security Note:

For production, use HTTPS if possible, sanitize all SQL inputs, and keep sensitive config (DB password) out of public repositories by adding them to .gitignore.

Need Help?

Direct Message to my gmail.

nafizmostofa2003@gmail.com

About

Simple Database Management System Project for university student using Dart and Flutter for Frontend and PHP/MySQL for Backend.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages