- Run
compose installin order to install required packages. - Run below command to serve the project locally.
php -S localhost:8000 -t ./public
- The root directory of application contains a
.env.example. Rename the.env.examplefile to.env. - Set the application key (
APP_KEY) to a randomly generated 32 characters long string in.envfile. If the application key is not set, the user encrypted data will not be secure!
For the authentication, I decided to go with JWT.
- JWT works with a secret key. Add a 30 characters random string to the
JWT_SECRETas:JWT_SECRET=uflWMsDJdKFLge6pjX0qLBJvdDUHJK
-
Create a SQLite database by using the
touch database/database.sqlitecommand. Configure the environment variables to point to this newly created by using the database's absolute path and commenting unnecessary variables out.DB_CONNECTION=sqlite #DB_HOST=127.0.0.1 #DB_PORT=3306 DB_DATABASE=/absolute/path/to/database.sqlite #DB_USERNAME=homestead #DB_PASSWORD=secret -
Run all of the migration files by executing
migrateArtisan command:php artisan migrate
This project makes use of Redis queue driver to have faster redirection and defer processing clicks task. So make sure you have redis installed on your operating system. If not you can visit Redis Download page to have installed.
- Change Redis-related environment variable in
.envfile as stated below:andQUEUE_CONNECTION=redisREDIS_CLIENT=predis - Run
redis-serverin your terminal to start Redis. - Run Queue worker so as to process the jobs (here we have only one job and that is named
ProcessClick). You may run the worker using thequeue:workcommand:php artisan queue:work
Follow this Link to access API collection in Postman or this Published Documents Link in order to access it in your browser.