Skip to content

ecuation/dl-api

Repository files navigation

Laravel API with Lumen (Laravel microframework)

Simple API technical test using a prebuild MySQL database schema and data.

Installation

Download project, install dependencies with composer and db migrations .

$ git clone [email protected]:ecuation/dl-api.git dl-api.development
$ cd dl-api.development
$ composer install

Copy .env file into the project and setup the necessary project and DB connection environment variables

$ cp .env.example ./.env

Run Laravel migrations with artisan command

$ php artisan migrate

Import the sample employees.sql database into the DB project

$ cd database/db_dump
$ mysql -u yourDbUserName -p youDatabaseName < employees.sql

Install Laravel Passport (run this command in the root project directory)

$ php artisan passport:install

Previous command will return a very similar result as below:

Client ID: 1
Client secret: 1cYyIHtKfPjJRHrOcngug8H03mvCOvSn05SUviYO
Password grant client created successfully.
Client ID: 2
Client secret: gOV3kfHdI2t6soli5Fhi3n16AqgrAwcTU8Ip2e1G

Note: Save the above credentials in your clipboard from the client with the ID: 2 (You will need these credentials to set it in your .env frontend project file in order to make the correct WebClient->API connection)

Last backend setup step: Create the default admin user just by running the following seeder command

$ php artisan db:seed --class=MainUserSeeder

Now you can start with the frontend project setup.

TDD with phpunit

All API endpoints has been developed applying TDD. To make these tests run, please execute the following command in your project root directory

$ vendor/bin/phpunit

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published