Framework : Yii2, Template : /~https://github.com/forecho/yii2-rest-api
#Project Setup (Using Docker)
- Install vendor packages using command
docker-compose run --rm php composer install
- Start the container using command
docker-compose up -d
- Run the migration using command
php yii migrate
The following migration will be running :m220926_103206_create_user_table
m220926_122855_create_timezone
m220926_122921_create_week_days
m220926_122945_create_appointment
m220927_043928_appointment_booking
- Seed the test data using below commands (The data is stored in csv file: /~https://github.com/vikasmb123/rooftop-challenge/blob/master/init/data/seed-data.csv)
php yii generate/user-data
=> Seed the users dataphp yii generate/timezone-data
=> Seed the timezone dataphp yii generate/week-days-data
=> Seed the week days dataphp yii generate/appointment-data
=> Seed the appointments data
#APIs :
- Get List of coaches
curl --request GET \ --url http://localhost:8000/v1/user
- 30 minutes slots available for a particular coach
curl --request GET \ --url http://localhost:8000/v1/appointment/slots \ --header 'Content-Type: application/json' \ --header 'user_id: 1'
- Create appointment booking
curl --request POST \ --url http://localhost:8000/v1/appointment-booking/create \ --header 'Content-Type: application/json' \ --data '{ "from":"5:00:00", "to": "3:00:40", "appointment_id": 2 }'
#Test Suite Execution :
Run the below command to run the test suit
codecept run api
#TODO:
- Code refactoring
- API Documentation
- Authentication and Authorization
- Improve API structure
- Improve Performance
- API level validation
- Docker file to run install composer dependencies when container is initialized
Screen Snaps :
- Migration: