Skip to content

lsthisloss/lara-react

Repository files navigation

🚀 Laravel + React SPA

Modern full-stack application with admin panel

Laravel React TypeScript PostgreSQL


🎯 Features

  • 🔐 Sanctum SPA Auth - CSRF protected sessions
  • 📝 Posts CRUD - Full content management
  • 👑 Admin Panel - User & content moderation
  • 📱 Mobile Responsive - Touch-friendly UI for all devices
  • 🏪 Content Store - Digital content marketplace with CRUD
  • ⚡ MobX State - Atomic transactions with runInAction
  • 🐳 Docker Setup - One-command development

🚀 Quick Start

git clone https://github.com/lsthisloss/lara-react.git
cd lara-react
chmod +x run.sh && ./run.sh
./run.sh
# Select 1
Первый сетап считается успешно запущенным если вы увидели вывод такого типа:
[+] Building 2/2
 ✔ frontend  Built                                                                                                                                                                                     0.0s 
 ✔ backend   Built                                                                                                                                                                                     0.0s 
Starting containers...
[+] Running 6/6
 ✔ Network laravel-react-app_app-network  Created                                                                                                                                                      0.0s 
 ✔ Volume "laravel-react-app_dbdata"      Created                                                                                                                                                      0.0s 
 ✔ Container laravel-db                   Healthy                                                                                                                                                      9.1s 
 ✔ Container laravel-backend              Healthy                                                                                                                                                     14.7s 
 ✔ Container laravel-nginx                Started                                                                                                                                                      9.4s 
 ✔ Container react-frontend               Started                                                                                                                                                     14.9s 
Generating application key...

   INFO  Application key set successfully.  


✅ First setup complete!
Frontend: http://localhost:3000
Backend: http://localhost:8000
Database: localhost:5432

📊 API Endpoints

Auth:

  • POST /api/register - User registration
  • POST /api/login - User authentication
  • POST /api/logout - User logout

User Management:

  • GET /api/user - Get current user info
  • PUT /api/user/profile - Update user profile
  • PUT /api/user/password - Change user password
  • GET /api/users - Get all users list
  • GET /api/users/{id}/profile - Get specific user profile

Posts:

  • GET /api/posts - List posts (with pagination)
  • POST /api/posts - Create post
  • GET /api/posts/{id} - Get post
  • PUT/PATCH /api/posts/{id} - Update post
  • DELETE /api/posts/{id} - Delete post

Admin:

  • GET /api/admin/dashboard - Dashboard stats
  • GET /api/admin/users - User management
  • PATCH /api/admin/users/{user}/toggle-admin - Toggle admin status

🧪 API Testing with Postman

Ready-to-use Postman collection for testing all API endpoints:

📁 Collection Location: backend/postman_collection.json

Import Steps:

  1. Open Postman
  2. Click ImportUpload Files
  3. Select backend/postman_collection.json
  4. Collection "Laravel React SPA API" will be added

Pre-configured:

  • ✅ Base URL: http://localhost:8000/api
  • ✅ Authentication token variable
  • ✅ All endpoints with sample requests
  • ✅ Environment variables for easy switching

Usage:

  1. Register/Login to get auth token
  2. Token automatically saves to {{auth_token}} variable
  3. All protected routes use Bearer authentication
  4. Test all CRUD operations with sample data

👑 Admin Access

Email: admin@dev.pro
Password: password

🛠 Tech Stack

Layer Technology
Frontend React 19 + MobX + TypeScript + Ant Design
Backend Laravel 11 + Sanctum Auth
Database PostgreSQL
DevOps Docker Compose
Mobile Responsive Design + Touch UI

📱 Mobile Responsive

  • 📱 Mobile-First Design - Optimized for all screen sizes
  • 🎯 Touch-Friendly UI - Ant Design responsive components
  • 📊 Adaptive Tables - Horizontal scroll on mobile devices
  • 🔧 Modal Optimization - Dynamic sizing for small screens
  • ⚡ Fast Performance - Optimized for mobile networks
  • 🔄 MobX Reactivity - Atomic state updates with runInAction for smooth UI

🎨 Demo Screenshots

Admin Dashboard

Screenshot 2025-06-26 201116

Posts Management

Posts Page

User Profile

User Page


Built with ❤️ by sk8 for modern web development
Development Timeline 6h

About

Modern full-stack pet application with admin panel, posts, crud operations

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published