The backend is a Laravel application that exposes a JSON REST API under theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/raczkodavid/Tikera/llms.txt
Use this file to discover all available pages before exploring further.
/api prefix. All responses follow a consistent envelope through the ApiResponse helper class. Authentication uses Laravel Sanctum, issuing plain-text bearer tokens that are stored client-side and verified on every protected route. The database is SQLite, with schema managed through versioned migrations.
Authentication
Tikera uses Laravel Sanctum token authentication. On login or registration the API creates a new personal access token, deletes any previous tokens for that user, and returns the plain-text token to the client.localStorage and sends it as a Authorization: Bearer <token> header. Routes that require authentication are wrapped in the auth:sanctum middleware group (see Routes below).
The ApiResponse helper
Every controller method returns JSON through App\Helpers\ApiResponse rather than calling response()->json() directly. This guarantees a consistent envelope across the entire API:
The frontend’s
api.js reads response.data.data to unwrap the payload, and reads response.data.message when showing error toasts.Routes
All routes are registered inroutes/api.php under the shared api middleware group:
Any request that does not match a defined route returns
{"message": "Page Not Found"} with a 404 status through a catch-all Route::any at the bottom of the file.Data models
Movie
Screening
Room
The
rooms database table uses seats_per_row as the column name (from the migration), while the Room model’s $fillable array refers to it as columns. The API response surfaces it as seatsPerRow in JSON output. The seeder creates rooms using seats_per_row directly.Booking
TicketType
Seeded during migration — not managed by users through the UI.name | price_multiplier |
|---|---|
normal | 1.00 |
student | 0.75 |
senior | 0.80 |
Model relationships summary
| Relationship | Type |
|---|---|
Movie → Screening | hasMany |
Screening → Movie | belongsTo |
Screening → Room | belongsTo |
Room → Screening | hasMany |
Screening → Booking | hasMany |
Booking → Screening | belongsTo |
Booking → User | belongsTo |
User → Booking | hasMany (via Laravel default) |
Database migrations
Migrations run in the order shown. Each file maps to a single schema change:| Migration file | Table / change |
|---|---|
0001_01_01_000000_create_users_table | users — standard Laravel users table |
0001_01_01_000001_create_cache_table | cache, cache_locks |
0001_01_01_000002_create_jobs_table | jobs, job_batches, failed_jobs |
2024_03_21_000001_create_movies_table | movies |
2024_03_21_000002_create_rooms_table | rooms (name, rows, seats_per_row, nullable description) |
2024_03_21_000003_create_screenings_table | screenings (FK → movies, rooms; start_time, date, week_number, week_day) |
2024_03_21_000004_create_bookings_table | bookings (FK → users, screenings; total_price, status enum) |
2024_03_21_000005_add_seats_to_bookings_table | Adds seats TEXT column (JSON array) |
2024_03_21_000006_create_ticket_types_table | ticket_types (name, price_multiplier); seeds three default types |
2024_03_21_000007_add_ticket_types_to_bookings_table | Adds ticket_types JSON column to bookings |
2025_05_11_094302_create_personal_access_tokens_table | Sanctum personal_access_tokens table |