This project is a incomplete online taxi backend which developed based on TDD So basically you should just fill the blank with simplest code that pass the tests.
Idea is simple. There are drivers and passengers:
-
Users register in the system. (
POST /register
) -
Some of users sign up for being a driver (
POST /driver
) -
Drivers send updates about their car's coordination and retreive availble travels. (
PUT /driver
) -
Passenger creates a travel with multiple stop spots with coordinates. (
POST /travels
) -
Driver accept the travel. (
POST /travels/{travelId}/take
) -
Driver go to coordinates of first spot and notify his arrival to passenger (
POST /travels/{travelId}/spots/{spotId}/arrived
). -
Driver save an event in the system when passenger got in the car (
POST /travel/{travelId}/passenger-on-board
). -
Driver take passenger to next destinations based on a predefined order by passenger and save an event for each arrival. (
POST /travels/{travelId}/spots/{spotId}/arrived
) -
Travel mark as done when all of spots are passed. (
POST /travels/{travelId}/done
)
Both parties can cancel travel (POST /travels/{travelId}/cancel
) in some situations:
- Passenger: no driver accept the travel.
- Passenger: driver does not arrived at origin of travel.
- Driver: passenger doesn't got in the car yet.
Also, passenger can add (POST /travels/{travelId}/spots
) or remove (DELETE /travels/{travelId}/spots/{spotId}
) destinations on the way.
We did it all before you then delete controllers method body codes, so these are included in the code and you don't need to write.
- Eloquent Models (
app/Models
) and Enums (app/Enums
) - Exceptions (
app/Exceptions
) - Authtorization policies (
app/Policies
) and service providers - Http form requests (
app/Http/Requests
) and Resources (app/Http/Resources
) - Database migrations (
database/migrations
) - Model Factories (
database/factories
) - Routes (
routes/api.php
) - Feature tests (
tests
)
You can put your mind on http controllers. Based on our implementation you need to write roughly < 200 lines of SMART code.
- Start coding wherever it's needed.
- Run
vendor/bin/phpunit
. - Send us a pull request when all tests are passed.
- Make sure CI run successfully.
- Wait for us!
- PHP >= 8.1
- Laravel > 9.19
Wish you best of luck.