This project is a full-stack quiz platform consisting of a Python backend (with MySQL and Firebase integration) and an Android app for users to take quizzes, submit answers, and receive notifications.
- Backend: Python server with RESTful API, MySQL database for quiz data, and Firebase for authentication and notifications.
- Database: MySQL schema and stored procedures for quizzes, questions, answers, user associations, and tokens.
- Android App: Simple app for users to sign up, receive quizzes, submit responses, and get push notifications.
- Install MySQL and run the provided SQL script to create tables and stored procedures.
- (Optional) Load sample data using the provided
.dumpfiles.
Example:
mysql -u <user> -p < quiz_schema.sql- Clone the backend repository.
- Install Python dependencies:
pip install mysql-connector-python firebase-admin schedule- Place your Firebase service account JSON in the project folder.
- Update DB and Firebase config in the script if needed.
- Start the server:
python <script_name>.py -host_http 0.0.0.0 -port_http 8080- Clone/open the Android app in Android Studio.
- Add
google-services.jsonfrom your Firebase project to theapp/directory. - Set your backend server IP in the Retrofit builder.
- Build and run the app on a device or emulator.
- Users sign up and log in through the Android app (Firebase Authentication).
- The app fetches quizzes via the backend API, displays questions, and submits answers.
- The backend stores responses, manages user-quiz associations, and sends notifications using Firebase Cloud Messaging.
- Admins can manage quizzes, associations, and view logs via the backend CLI.
POST /get_questionnaire— Get quiz for a userPUT /response— Submit user answersPOST /token— Register device token for notificationsPUT /log— Log user activity
- Backend: Python 3, MySQL, Firebase project
- Android App: Android Studio, Firebase project
- Ensure backend server is accessible from the Android device (use local IP, not
localhost). - MySQL and Firebase credentials must be correct.
- Open necessary ports (e.g., 8080) on your backend server.
- Add new quiz types or question formats in the database and backend.
- Expand app features (history, leaderboards, etc.).
- Style the Android app to fit your needs.