Skip to content

Latest commit

 

History

History
167 lines (111 loc) · 3.56 KB

File metadata and controls

167 lines (111 loc) · 3.56 KB

🎮 php-rest-api-client

A PHP web application that consumes an external REST API using cURL and JSON to retrieve videogame data and display it dynamically in a responsive web interface.


✨ Features

  • Retrieves videogame information from a public REST API.
  • Uses cURL to perform HTTP requests from PHP.
  • Parses API responses in JSON format.
  • Displays game data dynamically in a clean responsive layout.
  • Organizes shared layout and logic into reusable includes.
  • Includes generated technical documentation with PHPDoc and PHPDocumentor.
  • Includes Apache JMeter test plans for load and concurrency testing.
  • Successfully handled concurrent HTTP requests during load testing.

🛠️ Technologies Used

  • PHP
  • cURL
  • JSON
  • HTML5
  • CSS3
  • Apache XAMPP
  • PHPDocumentor
  • Apache JMeter

📁 Project Structure

php-rest-api-client/
├── css/
├── doc/
├── includes/
├── jmeter/
└── index.php

Directory Overview

  • css/: Stylesheets for the responsive user interface.
  • includes/: Reusable PHP files such as functions, header, and footer.
  • doc/: Generated documentation created with PHPDocumentor.
  • jmeter/: Apache JMeter test plans for performance and load testing.
  • index.php: Main entry point of the application.

🚀 Installation and Execution with XAMPP

Requirements

  • XAMPP installed on your machine
  • Apache enabled in XAMPP
  • PHP with cURL enabled
  • Internet connection to access the external API

Steps

  1. Copy the project folder into:
C:\xampp\htdocs\
  1. Make sure the project folder is named:
php-rest-api-client
  1. Start Apache from the XAMPP Control Panel.

  2. Open your browser and visit:

http://localhost/php-rest-api-client/
  1. The application will connect to the external API and display the videogame information dynamically.

🌐 API Information

This application consumes the public FreeToGame API:

  • Base endpoint: https://www.freetogame.com/api/games
  • Response format: JSON
  • Request method: GET

API Data

The API provides:

  • Game title
  • Thumbnail image
  • Genre
  • Platform
  • Release date

Application Workflow

  • The application sends an HTTP GET request using cURL.
  • The JSON response is decoded into a PHP associative array.
  • The data is processed and displayed dynamically in the interface.

📚 PHPDocumentor Usage

The application was documented using PHPDoc comments and PHPDocumentor.

Generate Documentation

phpdoc -d . -t doc

Documentation Output

Generated documentation is stored in the doc/ directory.


🧪 Apache JMeter Load Testing

Load testing was performed with Apache JMeter using Concurrency Thread Group.

Test Configuration

  • Target Concurrency: 200 users
  • Ramp Up Time: 10 minutes
  • Ramp-Up Steps Count: 10
  • Hold Target Rate Time: 5 minutes

Test Results

  • The application handled concurrent HTTP requests successfully.
  • The tests confirmed stable behavior during concurrent access scenarios.

JMeter test plans are stored in the jmeter/ directory.


🔮 Future Improvements

  • Add search and filtering by genre or platform
  • Implement pagination for larger result sets
  • Improve API error handling
  • Add caching for external requests
  • Improve responsive design and accessibility
  • Add automated testing

👤 Author

Jesús Martínez Escobar


Built with PHP, REST APIs, and web technologies to demonstrate API consumption, documentation, and performance testing in a practical backend web project.