Using Laravel 11 and applying TDD, I have built a API REST that allows restaurant owners to digitize their businesses. The platform offers functionalities such as restaurant registration, menu management, and QR code generation for a more interactive customer experience.
- Auth users
- Show restaurants
- Show restaurant by id
- Create restaurants
- Update restaurant
- Delete restaurants
- Show menus
- Show menu by id
- Create menus
- Update menu
- Delete menus
- Show dishes
- Show dish by id
- Create dish
- Update dish
- Delete dish
- Generate QR code
- Show QR code
- Laravel 11
- tymon/jwt-auth 2.*
- giauphan/laravel-qr-code 1.*
- Postgres 14
Install and run
- Clone and move to folder
$ git clone [email protected]:abrahamuchos/restaurant-tdd-api.git
$ cd restaurant-tdd-api- Install dependencies
$ composer install-
Create a copy of the
.env.examplefile and rename it to.env. Next, configure the necessary environment variables. -
Run
php artisan jwt:secretto generate a secret key for JWT. This will update your.envfile with something like JWT_SECRET=foobar -
Generate an application key by running
php artisan key:generate. -
Run
php artisan migrateto create the database tables. -
Run
php artisandb:seedto create dummy data and admin user. -
Run
php artisan serveto start the Laravel development server. -
Run
php artisan storage:linkto start the Laravel development server.
To run Jobs (Qr Image Generator) php artisan queue:work to start the Laravel queue worker (Check POST Menu endpoint)
To run this project, you will need to add the following environment variables to your .env file
DB_HOST
DB_PORT
DB_DATABASE
DB_USERNAME
DB_PASSWORD
JWT_SECRET
Documentation Restaurant TDD API - Postman
You can find a .json with the endpoints in /docs/Restaurant TDD.postman_collection.json