A full-stack trivia gaming platform built with Laravel (backend) and Flutter (frontend).
- User authentication (register/login)
- Create and manage trivia games (5-10 MCQs)
- Invite users to play games
- Play trivia games and track scores
- In-app notifications
- Leaderboards
- Game history
- Laravel 10.x
- Laravel Sanctum for authentication
- MySQL database
- RESTful API architecture
- Flutter 3.x
- Provider for state management
- Material Design UI
- Clone the repository
git clone <repository-url>
cd backend- Install dependencies
composer install- Copy environment file
cp .env.example .env- Generate application key
php artisan key:generate- Configure database in
.envfile
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=trivia_platform
DB_USERNAME=root
DB_PASSWORD=
- Run migrations and seeders
php artisan migrate --seed- Start the development server
php artisan serveThe API will be available at http://localhost:8000/api
- Navigate to the Flutter directory
cd frontend- Install dependencies
flutter pub get- Update the API URL in
lib/services/api_service.dart
static const String baseUrl = 'http://localhost:8000/api';- Run the app
flutter run- Controllers: Handle HTTP requests and responses
- Models: Define database relationships and business logic
- Migrations: Database schema definitions
- Routes: API endpoint definitions
- Middleware: Authentication and request filtering
- Models: Data structures for API responses
- Providers: State management and business logic
- Services: API communication and local storage
- Screens: UI components and pages
- Widgets: Reusable UI components
The API is documented using Postman. Import the Trivia_Platform_API.postman_collection.json file into Postman to view all endpoints and examples.
POST /api/register- User registrationPOST /api/login- User loginGET /api/games- List all gamesPOST /api/games- Create a new gamePOST /api/invitations- Send game invitationGET /api/play/{game}- Get game for playingPOST /api/play/{game}/submit- Submit game answersGET /api/leaderboard- Global leaderboard
- Backend Development: 10 hours
- Frontend Development: 12 hours
- Testing & Documentation: 6 hours
- Total: 28 hours
- Users must register with a unique email and username
- Games must have between 5-10 questions
- All questions are multiple choice with 4 options (A, B, C, D)
- Users can only play games they created or were invited to
- Leaderboard shows top 10 scores for each game and globally
- Notifications are handled within the app (no push notifications)
- Admin dashboard for managing users and games
- Real-time leaderboard updates
- Timer for gameplay
- Firebase/Event System for notifications
- More question types (true/false, fill in the blank)
- Categories and tags for games
- Achievement system
- Social sharing features
- Email: john@example.com
- Password: password123
This project is licensed under the MIT License.