A full‑stack app for typing practice and challenges.
- Back‑end: Laravel 12 (PHP 8.2+), Sanctum, Sail (Docker), Pest
- Front‑end: Vue 3, Vite 7, TypeScript, Pinia, Vue Router, Tailwind CSS v4, DaisyUI
- E2E/Unit: Cypress, Vitest
typing/
back-end/ # Laravel API (Sail-ready)
front-end/ # Vue 3 SPA (Vite/TypeScript)
package.json # Root helper scripts
- Docker + Docker Compose (recommended) OR PHP 8.2+, Composer, MySQL
- Node.js 20.19+ or 22.12+ and npm
From the repo root:
npm run startWhat it does:
- Brings up Laravel Sail containers in
back-end/ - Installs front‑end deps and starts Vite dev server in
front-end/
Default ports (see back-end/docker-compose.yml):
- API:
http://localhost:80 - Vite dev:
http://localhost:5173
- Back‑end
cd back-end
composer install
cp .env.example .env
./vendor/bin/sail up -d
./vendor/bin/sail php artisan key:generate
./vendor/bin/sail php artisan migrate- Front‑end
cd ../front-end
npm install
npm run devBack‑end:
cd back-end
composer install
cp .env.example .env
php artisan key:generate
php artisan migrate
php artisan serveFront‑end:
cd ../front-end
npm install
npm run dev- PHP: ^8.2
- Framework:
laravel/framework:^12 - Auth:
laravel/sanctum - Dev tooling: Sail, Pint, Pest, Pail
Useful composer scripts (in back-end/composer.json):
# Dev convenience (concurrently runs server, queue, logs, vite)
composer run dev
# Run tests
composer testDatabase: MySQL (via Sail). Credentials/DB name come from back-end/.env (copy from .env.example).
- GET
/api/paragraph/{lang}/{number}→ Returns a paragraph for a given language and item number.
Auth: /api/user is protected by Sanctum.
Key tech:
- Vue 3, TypeScript, Pinia, Vue Router
- Tailwind CSS v4, DaisyUI
Common scripts (in front-end/package.json):
# Dev server
npm run dev
# Type-check + build
npm run build
# Unit tests (Vitest)
npm run test:unit
# E2E tests (Cypress)
npm run test:e2e:dev # against vite dev server
npm run test:e2e # against preview/prod build
# Linting / formatting
npm run lint
npm run formatVite alias: @ → front-end/src
- When using Sail, the API will be served from the container at
http://localhost(port 80 by default). Vite dev server runs on5173. - Ensure CORS/Sanctum configuration if you add authenticated routes consumed by the SPA.
- Tailwind v4 is configured via the Vite plugin in
front-end/vite.config.ts.
Back‑end (Pest):
cd back-end
./vendor/bin/sail php artisan test # with Sail
# or
php artisan test # without DockerFront‑end:
cd front-end
npm run test:unit
npm run test:e2e:devBack‑end .env (copy from .env.example) must define DB credentials used by Sail (DB_DATABASE, DB_USERNAME, DB_PASSWORD).
Front‑end can consume Vite env vars via import.meta.env (e.g., VITE_API_BASE_URL). Create front-end/.env as needed.
- Back‑end: Deploy as a standard Laravel app (configure web server, PHP 8.2+, queue worker if needed, and database). Run migrations on release.
- Front‑end:
npm run buildproduces static assets infront-end/distfor serving via any static host or your web server.
# Bring up Sail and start front-end dev in one go
npm run startMIT