Skip to content

arashtajdar/sample-event-manager-api

Repository files navigation

Laravel API coding test

Arash Tajdar

About the project

This is a simple laravel api to manage events. Users can CRUD.

I used :

  • Sanctum for Auth
  • Laravel collections to display the results
  • Faker and factory for feature tests
  • Middleware to count product view count

Necessary improvements :

  • Avoid using eloquent inside controller (it's sample, and I used them inside for now)
  • feature tests can be extended.
  • Documentation can get improved.
  • Docker and related files need improvements.
  • Update down method of some migrations
  • Add policy to some controllers to manage who can edit products and category names
  • create statistics table and create command to collect some statistics and save it in that table

How to run the project

  1. Create .env file and Copy .env.example file to this new file
  2. Change variable like this or else you may encounter errors on running db-container
   DB_CONNECTION=mysql
   DB_HOST=db
   DB_PORT=3306
   DB_DATABASE=laravel
   DB_USERNAME=laravelUser
   DB_PASSWORD=@wn12341818

also

QUEUE_CONNECTION=database
  • It is important to :
    • change host variable to db
    • set a new username and password
      • change the name of the database to laravel (you can modify this in docker-compose/mysql/db_init.sql file)
  • The app will send an email after creating every product:
    you should change these settings in env file and set the variables with working smtp settings to be able to send email from inside the app
    (I can give you the settings)
MAIL_HOST=
MAIL_PORT=
MAIL_USERNAME=
MAIL_PASSWORD=

or if you want to disable this feature simply comment Line 31 in SendMailToAdminForNewProductListener.php

  1. Run ./init.sh bash file (* it may take a long time to generate autoload file*)
  2. Run localhost:8000 and use Postman collection (api.postman_collection.json) in root folder to send requests
  3. you can also test all functionalities by initializing this repo https://github.com/arashtajdar/VueJs-sample

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published