A comprehensive quiz application designed to help developers test their PHP knowledge and prepare for PHP certification exams. The system features a Laravel 12 backend API with a modern Nuxt 3 frontend, providing an interactive quiz experience with real-time scoring and detailed result reviews.
This application serves as a study tool for PHP developers who want to:
- Test their PHP knowledge with randomized questions
- Practice for PHP certification exams
- Track their progress and identify knowledge gaps
- Review detailed explanations for quiz answers
- Improve their understanding of PHP concepts
- API-first architecture with RESTful endpoints
- ULID primary keys for better performance and security
- Comprehensive validation with custom request classes
- Database relationships for quiz sessions and answers
- Modern PHP practices with type declarations and strict validation
- Server-side rendering for better SEO and performance
- Vue 3 Composition API with TypeScript support
- PrimeVue component library with Aura theme
- Pinia state management for quiz flow
- Responsive design with mobile-first approach
- Random Quiz Generation: 30 questions randomly selected from the question pool
- Real-time Progress Tracking: Visual progress indicators during quiz
- Instant Scoring: Immediate feedback on quiz completion
- Detailed Review: Review all questions with correct answers and explanations
- Session Management: Persistent quiz sessions with ULID tracking
- Responsive UI: Works seamlessly on desktop and mobile devices
- SEO Optimized: Proper meta tags and structured data
- Laravel 12 - PHP framework
- MySQL - Database
- Laravel Sanctum - API authentication (ready for future implementation)
- Spatie Packages - Query Builder, Permissions, Activity Log
- Custom Validation - Request classes with business logic
- Nuxt 3 - Vue.js framework
- Vue 3 - JavaScript framework
- TypeScript - Type safety
- PrimeVue 4 - UI component library
- Pinia - State management
- vue-api-query - API integration with models
- DDEV - Local development environment
- Node.js - Frontend build tools
- Composer - PHP dependency management
Before running this project locally, ensure you have:
- DDEV installed and configured
- Docker running (required by DDEV)
- Node.js (v18 or higher)
- Composer (will be handled by DDEV)
# Clone the repository
git clone git@github.com:tschope/php-certification-study.git
cd php-certification-study
# Start DDEV environment
ddev start# Install PHP dependencies
ddev composer install
# Copy environment file (if not exists)
cp .env.example .env
# Generate application key
ddev artisan key:generate
# Run database migrations
ddev artisan migrate
# Optional: Seed the database with sample questions
ddev artisan db:seed# Navigate to frontend directory and install dependencies
cd frontend
ddev npm install
# Copy frontend environment file
cp .env.example .env
# Start the Nuxt development server
ddev nuxtOnce both servers are running:
- Frontend (Nuxt): https://php-certification-study.localhost.ddev.site:3000
- Backend API (Laravel): https://php-certification-study.localhost.ddev.site/api
- Laravel App: https://php-certification-study.localhost.ddev.site
The Laravel application uses standard Laravel environment variables. Key configurations:
APP_NAME="PHP Certification Study"
APP_URL=https://php-certification-study.localhost.ddev.site
DB_CONNECTION=mysql
DB_HOST=db
DB_PORT=3306
DB_DATABASE=db
DB_USERNAME=db
DB_PASSWORD=dbThe Nuxt application supports the following environment variables:
# Application Configuration
APP_URL=https://php-certification-study.localhost.ddev.site
APP_NAME=PHP Certification Study
APP_DESCRIPTION=Test your PHP knowledge with our comprehensive quiz system
# API Configuration
API_BASE_URL=/api
# SEO Configuration
SITE_AUTHOR=PHP Certification Study Team
SITE_KEYWORDS=PHP, certification, quiz, programming, web developmentphp-certification-study/
โโโ app/
โ โโโ Http/
โ โ โโโ Controllers/Api/
โ โ โ โโโ QuizController.php # Main quiz API controller
โ โ โโโ Requests/
โ โ โโโ StartQuizRequest.php # Quiz start validation
โ โ โโโ SubmitAnswerRequest.php # Answer submission validation
โ โโโ Models/
โ โโโ QuizSession.php # Quiz session model
โ โโโ QuizAnswer.php # Quiz answer model
โโโ database/
โ โโโ migrations/ # Database schema
โโโ routes/
โ โโโ api.php # API routes
โโโ frontend/
โ โโโ components/ # Vue components
โ โโโ composables/
โ โ โโโ useApi.ts # API integration
โ โโโ pages/
โ โ โโโ index.vue # Homepage
โ โ โโโ quiz/
โ โ โโโ start.vue # Quiz start page
โ โ โโโ take.vue # Quiz taking page
โ โ โโโ result.vue # Quiz results page
โ โ โโโ review.vue # Quiz review page
โ โโโ stores/
โ โ โโโ quiz.ts # Pinia quiz store
โ โโโ plugins/
โ โ โโโ primevue.client.ts # PrimeVue configuration
โ โโโ nuxt.config.ts # Nuxt configuration
โโโ README.md
- Start a Quiz: Navigate to the homepage and click "Start Quiz"
- Take the Quiz: Answer 30 randomly selected questions
- Submit Answers: Click "Next" after each question or "Finish Quiz" on the last question
- View Results: See your score and performance summary
- Review Answers: Click "Review Quiz" to see all questions with correct answers
# Start the development environment
ddev start
# Stop the development environment
ddev stop
# Restart the development environment
ddev restart
# Run Laravel Artisan commands
ddev artisan migrate
ddev artisan make:model ModelName
ddev artisan route:list
# Run Composer commands
ddev composer install
ddev composer update
ddev composer require package/name
# Run NPM commands (from project root)
ddev npm install
ddev npm run build
ddev nuxt # Start Nuxt dev server
# Access database
ddev mysql
# View logs
ddev logs
# SSH into container
ddev ssh- DDEV not starting: Ensure Docker is running and ports 80/443 are available
- Database connection errors: Run
ddev restartand check database credentials - Frontend build errors: Clear node_modules and reinstall:
ddev npm install - API 500 errors: Check Laravel logs:
ddev logs
# Check DDEV status
ddev describe
# View application logs
ddev logs -f
# Clear Laravel caches
ddev artisan cache:clear
ddev artisan config:clear
ddev artisan route:clear
# Clear Nuxt cache
cd frontend && ddev npm run buildFor production deployment:
- Set appropriate environment variables for your hosting platform
- Configure your web server to serve the Nuxt application
- Set up the Laravel API with proper database credentials
- Configure CORS settings for cross-origin requests
- Set up SSL certificates for HTTPS
- Fork the repository
- Create a feature branch:
git checkout -b feature/new-feature - Commit your changes:
git commit -am 'Add new feature' - Push to the branch:
git push origin feature/new-feature - Submit a pull request
This project is open-source and available under the MIT License.
If you encounter any issues or have questions:
- Check the troubleshooting section above
- Review DDEV documentation: https://ddev.readthedocs.io/
- Check Laravel documentation: https://laravel.com/docs
- Check Nuxt documentation: https://nuxt.com/docs
Happy coding and good luck with your PHP certification studies! ๐