This is a query play studio, written in and for educational and demonstrational purposes.
A full-stack SPA platform for mastering database query writing across various database systems. Provides secure sandbox environments with different databases for hands-on experimentation. Supports both free exploration and structured exercise modes. Features an AI mentor using cloud or local models for intelligent query analysis, performance optimization, and guidance on advanced query language constructs.
Based on tech stack:
- HTML,
- PHP,
- Symfony,
- MySQL,
- TypeScript,
- Vue,
- Vue Router,
- Pinia,
- Axios,
- CSS,
- TailwindCss,
- Docker.
- Clone the repository:
git clone [repository-url]- Change directory to project:
cd /path/to/query-play-studio/-
Add file .env.local with your parameters
-
Run Docker Desktop (with wsl - for Windows only)
-
Run wsl (for Windows only):
wsl- Up docker compose:
docker-compose --env-file .env.local up -dor
./docker/run.sh- Also available other scripts:
./docker/build.sh
./docker/stop.sh
./docker/kill.sh- Generate application key:
docker compose exec php bin/console secrets:generate-keys
docker compose exec php bin/console secrets:set APP_SECRETor
docker compose exec php php -r "echo 'APP_SECRET=' . bin2hex(random_bytes(32)) . PHP_EOL;"- Add new tab in terminal and connect to container:
docker exec -it qps-php bash- Install php dependencies:
composer install- Install node dependencies:
npm install- Build project:
npm run build- In browser go to http://localhost/
- Start the Vite dev server inside the Docker container:
npm run dev - Note: The frontend is located in the
frontenddirectory, so the command runs from/app/frontendin the container. - Vite will run on port 3000 and provide hot reloading for Vue components.
- Symfony with Caddy runs on port 80 and serves the HTML page.
- The Twig template will load scripts from
http://localhost:3000/for HMR. - Open your browser at
http://localhostto see the application.
- Build the frontend assets inside the Docker container:
npm run build - Note: The frontend is located in the
frontenddirectory, so the command runs from/app/frontendin the container. - This will compile and bundle all assets into the
public/build/directory (in the project root, one level up fromfrontend). - The main files are
app.js(JavaScript bundle),app.css(all CSS styles in one file), and chunk files in thechunks/folder. - Set the Symfony environment to production by setting
APP_ENV=prodandAPP_DEBUG=0in your.env.localfile. - Clear the Symfony cache for the production environment:
php bin/console cache:clear --env=prod - Restart the Docker container (or ensure Caddy is serving the updated
public/build/directory) and openhttp://localhost.
- To switch from development to production: Stop the Vite dev server (Ctrl+C), run the build command, set
APP_ENV=prod, and clear the cache. - To switch from production to development: Delete the
public/build/folder, setAPP_ENV=dev, and start the Vite dev server again.
- In development, all scripts and styles are served by the Vite dev server from
http://localhost:3000/. - In production, all assets are static files in the
public/build/directory (located at the project root) and served by Caddy.
APP_ENV(in.env.local): Controls which scripts are included by Twig (devfor Vite HMR,prodfor compiled assets).NODE_ENV: Automatically set by Vite (developmentwhen runningnpm run dev,productionwhen building).
That's it! Thank you!
The 'Query play studio' is open-sourced software licensed under the MIT license.