This guide walks you through cloning the repository, spinning up MySQL 8 and Redis via Laravel Sail (Docker Compose), running database migrations, and making your first authenticated API call. No local PHP or Composer installation is required — everything runs inside containers managed by Sail.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/GaelCeballos/Smart_Enviro_Backend/llms.txt
Use this file to discover all available pages before exploring further.
Prerequisites
Docker Desktop
Install Docker Desktop and make sure it is running. Windows users must also enable the WSL2 integration in Docker Desktop → Settings → Resources → WSL Integration.
Git
Install Git so you can clone the repository.
Setup
Install Composer dependencies
The This populates
vendor/ directory is not committed to source control. Use Docker to run Composer without a local PHP installation:vendor/ and makes the ./vendor/bin/sail command available for all subsequent steps.Copy the environment file
.env in your editor and fill in the database credentials before starting containers:The
DB_CONNECTION defaults to sqlite in .env.example. Change it to mysql and uncomment the DB_HOST, DB_PORT, DB_DATABASE, DB_USERNAME, and DB_PASSWORD lines when using Sail.Start Sail (Docker)
| Service | Default port |
|---|---|
| Laravel application | 80 |
| MySQL 8.4 | 3306 |
| Redis (Alpine) | 6379 |
./vendor/bin/sail ps.Generate the application key
APP_KEY value into your .env file. Laravel uses it to encrypt sessions, cookies, and other signed data.Run database migrations
First API Call
With the stack running, you can register a user and obtain an API token in two requests. Register a new user:Authorization header for all subsequent requests to protected endpoints:
Next Steps
Authentication
Learn how Sanctum token issuance, single-session enforcement, and logout work.
Devices Overview
Discover how to claim devices, toggle actuator states, and update device properties.
Login Endpoint
Full reference for the
/api/login endpoint — request body, responses, and error codes.Store Sensor Data
Reference for posting ESP32 telemetry to
/api/sensor-data using a device token.