Skip to content

ahmadhasannudin/three-body-problem

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DevOps Multi-API Project

A complete full-stack application demonstrating API development with Laravel, Go, and React frontend.

🏗️ Project Structure

devops/
├── laravel/          # Laravel API (PHP)
├── go/              # Go API 
├── frontend/        # React.js Frontend
├── compare_apis.sh  # API comparison script
└── README.md        # This file

🚀 How to Run Applications

🐘 Laravel API (Port 8001)

cd laravel
composer install
cp .env.example .env
php artisan key:generate
php artisan migrate --seed
php artisan serve --port=8001

🐹 Go API (Port 8080)

cd go
cp .env.example .env
go mod tidy
go run main.go

⚛️ React Frontend (Port 3000)

cd frontend
npm install
npm start

🌐 API Endpoints

Both Laravel and Go APIs provide identical endpoints:

  • GET /api/products - Get all products
  • GET /api/products/{id} - Get product by ID

🎯 Frontend Features

The React frontend provides:

  • 🐘 Laravel API Button - Hits Laravel API at http://127.0.0.1:8001
  • 🐹 Go API Button - Hits Go API at http://localhost:8080
  • 📊 Real-time Data Display - Shows API responses in formatted cards
  • Error Handling - User-friendly error messages
  • 📱 Responsive Design - Works on desktop and mobile

🔗 URLs

🛠️ Tech Stack

  • Backend: Laravel (PHP) + Go
  • Frontend: React.js
  • Database: MySQL (with SQLite fallback)
  • Styling: CSS3 with gradients and animations

✅ Quick Test

Run all applications and test:

# Terminal 1: Laravel API
cd laravel && php artisan serve --port=8001

# Terminal 2: Go API  
cd go && go run main.go

# Terminal 3: React Frontend
cd frontend && npm start

# Terminal 4: Test APIs
./compare_apis.sh

Access frontend at http://localhost:3000 and click both API buttons to see the results!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors