arrow_back Back to Projects
laravel

Laravel Authentication + Crud Api

A complete full-stack web application demonstrating modern development practices with Laravel 8 powering a robust REST API and Vue.js 3 providing a dynamic frontend experience. Features secure authentication, file upload management, and comprehensive testing suites. Perfect for developers who want to learn or implement a scalable CRUD system with clean separation between backend API and frontend SPA architecture.

Timeline

2024

Links

deployed_code

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

  1. Authentication Layer (AuthController) handles user registration, login, and logout
  2. Resource Controller (PostController) manages CRUD operations for posts
  3. Sanctum Middleware (auth:sanctum) protects all post endpoints
  4. File Storage System handles uploads with unique naming and automatic cleanup
  5. API Resources (PostResource) provide consistent JSON response formatting


Technical Stack

code laravel
code php
code mysql