harry2909 / qotsa-api

An API to return QOTSA lyrics
MIT License
1 stars 0 forks source link

API Layers WIP #7

Closed harry2909 closed 1 year ago

harry2909 commented 1 year ago

:bulb: Description

Following @lambert-o 's advice, I have implemented the REST API with best practices in mind.

This is a WIP. I believe we may need separate interfaces, services, and repos for each model I've created. At the moment, I am just trying to implement/learn the principles.

Now, when starting the project, run sail php artisan migrate:fresh and then sail php artisan db:seed --class=AlbumSongLyricsSeeder

image

With relationships:

image

Next steps

:hammer_and_wrench: Type of change

codecov-commenter commented 1 year ago

Codecov Report

Merging #7 (ab29bed) into dev (43f9554) will increase coverage by 0.65%. The diff coverage is 84.00%.

@@             Coverage Diff              @@
##                dev       #7      +/-   ##
============================================
+ Coverage     70.17%   70.83%   +0.65%     
- Complexity       20       29       +9     
============================================
  Files            12       17       +5     
  Lines            57       72      +15     
============================================
+ Hits             40       51      +11     
- Misses           17       21       +4     
Impacted Files Coverage Δ
app/Models/Album.php 0.00% <0.00%> (ø)
app/Models/Song.php 50.00% <50.00%> (ø)
app/Http/Controllers/APIController.php 100.00% <100.00%> (ø)
app/Http/Resources/LyricsResource.php 100.00% <100.00%> (ø)
app/Models/Lyrics.php 100.00% <100.00%> (ø)
app/Providers/AppServiceProvider.php 100.00% <100.00%> (ø)
app/Repositories/LyricsRepository.php 100.00% <100.00%> (ø)
app/Services/LyricsService.php 100.00% <100.00%> (ø)

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more