A modern cryptocurrency exchange mini-engine built with Laravel 12 (Backend) and Vue.js 3 (Frontend).
- User Authentication (Laravel Sanctum)
- Real-time Order Book
- Order Matching Engine
- Trading Interface
- Portfolio Management
- Queue-based Order Processing
The easiest way to get started is using Docker. Just run one command:
chmod +x run.sh
./run.shrun.batThat's it! The script will:
- ✅ Install all dependencies
- ✅ Set up the database
- ✅ Run migrations
- ✅ Start all services
- Frontend: http://localhost:5173
- Backend API: http://localhost:8000/api
- API Documentation: http://localhost:8000/docs (if Scramble is enabled)
- PHP 8.2+
- Composer
- Node.js 20+
- MySQL 8.0+ or SQLite
- Install dependencies:
composer install- Create
.envfile:
cp .env.example .env
php artisan key:generate- Configure database in
.env:
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=exchange_db
DB_USERNAME=your_username
DB_PASSWORD=your_passwordREVERB_APP_ID=my-app-id
REVERB_APP_KEY=my-app-key
REVERB_APP_SECRET=my-app-secret
REVERB_HOST="localhost"
REVERB_PORT=8080
REVERB_SCHEME=http
- Run migrations:
php artisan migrate- Start the server:
php artisan serve- Start queue worker (in another terminal):
php artisan queue:work- Navigate to frontend directory:
cd frontend- Install dependencies:
npm install- Create
.envfile:
echo "VITE_API_URL=http://localhost:8000/api" > .env- Start development server:
npm run devThe Docker setup includes:
- app: Laravel PHP-FPM application
- nginx: Web server (port 8000)
- mysql: MySQL database (port 3306)
- queue: Laravel queue worker
- frontend: Vue.js development server (port 5173)
# Start all services
docker-compose up -d
# View logs
docker-compose logs -f
# Stop all services
docker-compose down
# Restart a specific service
docker-compose restart app
# Execute commands in containers
docker-compose exec app php artisan migrate
docker-compose exec frontend npm run buildDetailed documentation is available in key directories:
- 📚 API Documentation:
routes/API_DOCUMENTATION.md- Complete API endpoint reference - 🏗️ Architecture (Backend):
app/Services/SERVICES_DOCUMENTATION.md- Business logic and services - 🗄️ Models Documentation:
app/Models/MODELS_DOCUMENTATION.md- Database models and relationships - 🎮 Controllers Documentation:
app/Http/Controllers/Api/CONTROLLERS_DOCUMENTATION.md- API controllers - 🎨 Frontend Architecture:
frontend/src/ARCHITECTURE.md- Frontend structure and patterns - 🚀 Quick Start Guide:
QUICKSTART.md- Fast setup instructions
exchange-mini-engine/
├── app/
│ ├── Http/Controllers/Api/ # API Controllers
│ │ └── CONTROLLERS_DOCUMENTATION.md
│ ├── Services/ # Business Logic
│ │ └── SERVICES_DOCUMENTATION.md
│ ├── Models/ # Eloquent Models
│ │ └── MODELS_DOCUMENTATION.md
│ └── Jobs/ # Queue Jobs
├── frontend/
│ ├── src/
│ │ ├── components/ # Vue Components
│ │ ├── stores/ # Pinia Stores
│ │ ├── views/ # Vue Views
│ │ └── ARCHITECTURE.md # Frontend docs
│ └── vite.config.ts
├── database/
│ ├── migrations/ # Database Migrations
│ └── seeders/ # Database Seeders
├── routes/
│ ├── api.php # API Routes
│ └── API_DOCUMENTATION.md # API docs
├── docker-compose.yml # Docker Configuration
├── QUICKSTART.md # Quick start guide
└── run.sh / run.bat # Setup Scripts
POST /api/auth/register- Register new userPOST /api/auth/login- Login userPOST /api/auth/logout- Logout user (requires auth)
GET /api/orderbook?symbol=BTCUSD- Get order bookGET /api/orders- Get user orders (requires auth)POST /api/orders- Create new order (requires auth)POST /api/orders/{id}/cancel- Cancel order (requires auth)
GET /api/profile- Get user profile (requires auth)
Backend:
- Laravel 12
- Laravel Sanctum (Authentication)
- Laravel Queue (Background Jobs)
- Laravel Telescope (Debugging)
Frontend:
- Vue.js 3
- TypeScript
- Pinia (State Management)
- Axios (HTTP Client)
- Tailwind CSS
- Vite
Infrastructure:
- Docker & Docker Compose
- Nginx
- MySQL 8.0
- PHP 8.2
php artisan test./vendor/bin/pintMIT License