Skip to content

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

API Laravel — Full-stack blog (Laravel 12 + React + TypeScript)

A full-stack blog application: a Laravel 12 REST API (auth, posts, comments, likes) consumed by a React 19 + TypeScript frontend built with Inertia and shadcn/ui.

Overview

This project combines a modern Laravel backend with a React/TypeScript SPA frontend served through Inertia:

  • API — Laravel 12 with Sanctum token authentication, resource controllers and Gate policies.
  • Frontend — React 19 + TypeScript + Vite + Tailwind CSS, with shadcn/ui components.
  • QualityPest feature/unit tests and GitHub Actions CI (Pint, Prettier, ESLint).

Key features

  • Authentication: register, login, logout (Sanctum), email verification, password reset.
  • Blog API: posts CRUD (index/show public, create/update/delete authenticated), comments, likes.
  • Authorization: PostPolicy gates update/delete to the post owner.
  • Data model: users, posts, comments, likes with migrations, factories and seeders.
  • User settings UI: profile, password and appearance pages.
  • CI: tests.yml (Pest) and lint.yml (Pint + Prettier + ESLint) on push/PR to develop/main.

Tech stack

  • Backend: Laravel 12, Sanctum, Pest, Laravel Pint
  • Frontend: React 19, TypeScript, Inertia.js, Vite, Tailwind CSS 4, shadcn/ui (Radix UI)
  • Tooling: ESLint, Prettier, TypeScript (tsc --noEmit)
  • CI: GitHub Actions

API endpoints

Method Endpoint Auth Description
POST /api/register Create an account
POST /api/login Login, returns Sanctum token
POST /api/logout Revoke current token
GET /api/user Current user
GET /api/posts List posts (with author, comments, likes count)
POST /api/posts Create a post
GET /api/posts/{post} Show a post
PUT/PATCH /api/posts/{post} ✔ (owner) Update a post
DELETE /api/posts/{post} ✔ (owner) Delete a post
GET /api/posts/{post}/comments List a post's comments
POST /api/posts/{post}/comments Comment on a post
GET /api/posts/{post}/likes Like count for a post
POST /api/posts/{post}/like Toggle like on a post

Testing

composer install
cp .env.example .env
php artisan key:generate
php artisan migrate --seed

# Run the Pest test suite
composer test
# or
php artisan test

Local development

# Backend
composer install
php artisan serve

# Frontend (Vite dev server)
npm install
npm run dev

CI / code quality

vendor/bin/pint          # PHP code style
npm run format:check     # Prettier
npm run lint             # ESLint
npm run types            # tsc --noEmit

Project status

The backend API and authentication flow are complete. The frontend currently ships the starter-kit pages (auth, settings, dashboard); the blog browsing/posting UI is the natural next step (the API endpoints it needs already exist).

License

MIT

About

Full-stack blog: Laravel 12 API (Sanctum + policies) with a React 19 + TypeScript + Inertia frontend. Pest tests + GitHub Actions CI.

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages