A modern investment platform demo built with Laravel 11, showcasing two distinct frontends:
- πΌ Guest Interface: React + Inertia.js + TailwindCSS
- π§ User/Admin Dashboard: Laravel Livewire + Alpine.js
Fully containerized with Docker for production-grade reliability, complete with automatic migrations, caching, and optimized builds.
π§ Designed to demonstrate a professional, multi-stack Laravel architecture ready for portfolio or real-world deployment.
β
Laravel 11 + PHP 8.3 (FPM)
β
React + Inertia.js (guest interface)
β
Livewire 3 + Alpine.js (admin & user dashboards)
β
TailwindCSS + Vite asset pipeline
β
MySQL 8 database container
β
Nginx web server optimized for Laravel
β
adminer database GUI container for viewing application's stored data
β
One-command build via Docker Compose
git clone https://github.com/Chukwusombiri/Investron.git cd investron
cp .env.example .env
composer install
php artisan key:generate && php artisan migrate --force
npm install && npm run dev
# open separate terminal in the same directory and start php server
php artisan serve
1οΈβ£ Frontend Stage (Node 18) β React/Vite/Tailwind build 2οΈβ£ Backend Stage (PHP 8.3 FPM) β Laravel application 3οΈβ£ Webserver Stage (Nginx) β Serves the application
text
βββββββββββββββ βββββββββββββββ βββββββββββββββ βββββββββββββββ β Nginx β β Laravel β β MySQL β β Adminer β β (Webserver)βββββΊβ (PHP-FPM) βββββΊβ (Database) βββββΊβ (DB GUI) β β :5000 β β :9000 β β :3307 β β :8080 β βββββββββββββββ βββββββββββββββ βββββββββββββββ βββββββββββββββ
text
- Docker & Docker Compose
- git
# Copy environment file
cp .env.example .env.dockerThe application will automatically generate Laravel key on first build
# Build and start all services in detached mode
docker compose up -d --build
docker compose exec app php artisan migrate
| Service | URL | Purpose |
|---|---|---|
| Main Application | http://localhost:5000 | Laravel application |
| Database Admin | http://localhost:8080 | Adminer (DB management) |
Docker Management
# Start services
docker compose up -d
# Stop services
docker compose down
# Stop and remove volumes (fresh start)
docker compose down -v
# View logs
docker compose logs -f
# Rebuild specific service
docker compose build app# Access app container
docker exec -it investron-app bash
# Run migrations
docker exec -it investron-app php artisan migrate
# Generate Laravel key
docker exec -it investron-app php artisan key:generate
# Install composer dependencies
docker exec -it investron-app composer install
# Run tests
docker exec -it investron-app php artisan test-
Connection Details
Property Value Host db (container name) or 127.0.0.1 Port 3307 (external) / 3306 (internal) Database investron_db Username investron_user Password secret_password Root Password root -
Accessing MySQL
# Direct access via MySQL client mysql -h 127.0.0.1 -P 3307 -u investron_user -p investron_db # Viewing Database Content After logging into MySQL SHOW TABLES; SELECT * FROM users LIMIT 10;
Or use Adminer web interface at http://localhost:8080
Services Breakdown
| Service | Container Name | Ports | Description |
| ---------------- | ---------------------- | ------------------------ | ---------------------------- |
| app | investron-app | 9000 | Laravel PHP-FPM application |
| nginx | investron-web | 5000:80 | Nginx web server |
| db | investron-db | 3307:3306 | MySQL 8.0 database |
| adminer | investron-adminer | 8080:8080 | Database management GUI |
Hot-reload: File changes are synchronized automatically
Persistent data: MySQL data persists in Docker volume
Optimized builds: Multi-stage Dockerfile for production readiness
text investron/ βββ docker/ β βββ nginx/ β βββ default.conf # Nginx configuration βββ resources/ β βββ js/ # React/Inertia components β βββ views/ # Blade templates β βββ css/ # Tailwind styles βββ public/ β βββ build/ # Compiled assets (from Docker build) βββ Dockerfile # Multi-stage build configuration βββ compose.yaml # Docker Compose services βββ .env.docker # Docker environment variables βββ vite.config.js # Vite configuration βββ tailwind.config.js # TailwindCSS configuration
-
app: Laravel backend with PHP 8.3, auto-reload on file changes
-
nginx: Optimized Laravel server configuration
-
db: MySQL 8.0 with persistent volume
-
adminer: Web-based database management
-
Optimized for Laravel applications
-
PHP-FPM integration with app container
-
Security headers enabled
-
Proper error handling and logging
Default passwords should be changed in production
.env.docker contains development credentials
Security headers are configured in Nginx
X-Powered-By header is hidden
CSRF protection enabled via Laravel
-
Code changes are automatically synced to the container
-
Composer dependencies trigger rebuild on composer.json changes
-
Frontend assets can be rebuilt inside container or locally
# Create new migration
docker exec -it investron-app php artisan make:migration create_users_table
# Run migrations
docker exec -it investron-app php artisan migrate
# Rollback migrations
docker exec -it investron-app php artisan migrate:rollbackCommon Issues
-
Port already in use Change ports in compose.yaml if 5000, 3307, or 8080 are occupied
-
Docker build fails
# Clear Docker cache
docker compose build --no-cache- Database connection issues
# Check if MySQL container is running
docker ps | grep investron-db
# View database logs
docker logs investron-db- Permission issues
# Fix Laravel storage permissions
docker exec -it investron-app chown -R www-data:www-data storage bootstrap/cache-
Fork the repository
-
Create a feature branch: git checkout -b feature/amazing-feature
-
Commit changes: git commit -m 'Add amazing feature'
-
Push to branch: git push origin feature/amazing-feature
-
Open a Pull Request
-
Follow Laravel coding standards
-
Include tests for new features
-
Update documentation accordingly
-
Ensure Docker setup remains functional
This project is open-sourced under the MIT License.
Laravel Community - For the excellent framework
Docker Team - Containerization platform
CORIENT - Platform adaptation for educational purposes
Disclaimer: This project is for educational and portfolio purposes only.
Bounty Tech - https://github.com/Chukwusombiri
"Code as if the next person to maintain it is a future version of you."