Skip to content

bitemdev/RESTful-API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

One Piece RESTful API

A One Piece themed catalog built with Laravel 13, React, Inertia, Tailwind CSS, and MySQL.

The app has two main surfaces:

  • A public React frontend for browsing characters, crews, devil fruits, and seas.
  • A protected admin area for managing the catalog data.

Features

  • Public catalog with search and filters.
  • Character detail pages.
  • REST API for characters, crews, devil fruits, and seas.
  • Protected API write endpoints using Sanctum.
  • Admin CRUD for all catalog resources.
  • Laravel Breeze authentication.
  • Responsive Tailwind design.
  • Seeded One Piece data.
  • Local image assets for the public UI.
  • Docker Compose setup.
  • Feature tests for API, auth, admin CRUD, frontend routes, and error handling.

Tech Stack

  • PHP 8.3+
  • Laravel 13
  • Laravel Breeze
  • Laravel Sanctum
  • React 18
  • Inertia
  • Tailwind CSS
  • Vite
  • MySQL 8
  • Docker Compose
  • PHPUnit

Requirements

Local development:

  • PHP 8.3 or newer
  • Composer
  • Node.js 24 or newer
  • MySQL 8

Docker development:

  • Docker Desktop

Setup

Install dependencies:

composer install
npm install

Create the environment file:

cp .env.example .env
php artisan key:generate

Configure the database in .env, then run:

php artisan migrate --seed
npm run build

Start the local development server:

composer run dev

The app runs at:

http://localhost:8000

Demo Account

Email: admin@example.com
Password: password

Main Routes

Public:

/
/characters/monkey-d-luffy

Admin:

/login
/dashboard
/admin/characters
/admin/crews
/admin/devil-fruits
/admin/seas

API

Public read endpoints:

GET /api/characters
GET /api/characters/{slug}
GET /api/crews
GET /api/crews/{slug}
GET /api/devil-fruits
GET /api/devil-fruits/{slug}
GET /api/seas
GET /api/seas/{slug}

Protected write endpoints:

POST /api/characters
PATCH /api/characters/{slug}
DELETE /api/characters/{slug}

The same protected write pattern exists for:

/api/crews
/api/devil-fruits
/api/seas

Write endpoints use auth:sanctum.

API Filters

Characters:

/api/characters?q=luffy
/api/characters?crew=straw-hat-pirates
/api/characters?sea=east-blue
/api/characters?featured=true

Crews:

/api/crews?q=heart
/api/crews?active=true

Devil fruits:

/api/devil-fruits?type=Paramecia
/api/devil-fruits?claimed=true

Seas:

/api/seas?danger_level=5

Seed Data

The default seed creates:

  • 16 characters
  • 7 seas
  • 6 crews
  • 9 devil fruits
  • 1 admin user

Docker

Start the Docker environment:

docker compose up --build

Default database values:

Database: one_piece_api
User: sail
Password: password
Root password: password

Testing

Run the main checks:

npm run build
php artisan test

Latest validation:

52 tests passed
346 assertions

Useful route checks:

php artisan route:list --path=admin --except-vendor
php artisan route:list --path=api --except-vendor

Project Structure

app/Models
app/Http/Controllers
app/Http/Requests
app/Http/Resources
database/migrations
database/seeders
resources/js/Pages
resources/views/admin
routes
tests/Feature

Additional implementation notes are available in:

docs/implementation-notes.md

Assets

The public UI uses local image assets stored in public/images. Character records store:

  • image_url for frontend rendering.
  • official_url for the source profile page.

Local files are used so the app does not depend on remote image hotlinking during demos.

About

A One Piece themed catalog built with Laravel 13, React, Inertia, Tailwind CSS, and MySQL.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors