Laravel Authentication + Crud Api
The Brief
This project is a modern web application that allows users to create, read, update, and delete posts with file attachments. Think of it as a foundation for any content management system - whether you're building a blog, a document management platform, or any application where users need to store and organize content with files. The system handles user accounts, secure login, and file storage automatically, so you can focus on customizing it for your specific needs.
Architecture & Technology Stack
This full-stack application showcases enterprise-grade development patterns using a decoupled architecture:
Backend (Laravel 8)
- Framework: Laravel 8 with PHP 8+ for robust server-side development
- Authentication: Laravel Sanctum providing stateless API token authentication
- Database: MySQL with Eloquent ORM for efficient data management
- File Storage: Laravel Storage facade with public disk for secure file handling
- API Design: RESTful endpoints following Laravel resource controller patterns
- Testing: PHPUnit for comprehensive backend testing
Frontend (Vue.js 3)
- Framework: Vue 3 with Composition API for reactive user interfaces
- Build Tool: Vite for lightning-fast development and optimized production builds
- State Management: Pinia for predictable application state management
- HTTP Client: Axios for seamless API communication
- Styling: Tailwind CSS for utility-first responsive design
- Testing: Vitest for unit testing, Cypress for end-to-end testing
Key Features
- Dual-Stack Architecture: Independent backend API and frontend SPA with clear separation
- Token-Based Authentication: Secure API authentication using Laravel Sanctum tokens
- File Upload System: Complete file management with unique naming and automatic cleanup
- RESTful API: Standards-compliant API with proper HTTP methods and status codes
- Responsive Design: Mobile-first approach with Tailwind CSS
- Comprehensive Testing: Multiple testing layers for reliability
- Docker Support: Containerized development environment with Laravel Sail
API Architecture
- Authentication Layer (
AuthController) handles user registration, login, and logout - Resource Controller (
PostController) manages CRUD operations for posts - Sanctum Middleware (
auth:sanctum) protects all post endpoints - File Storage System handles uploads with unique naming and automatic cleanup
- API Resources (
PostResource) provide consistent JSON response formatting