Skip to content

it490-wizards/web-frontend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

web-frontend

Installation

Install the PHP dependencies using composer.

composer install

Create an initialization file rabbitmq.ini which contains your RabbitMQ credentials. For example:

[rabbitmq]
HOST="localhost"
PORT=5672
USER="guest"
PASSWORD="guest"
VHOST="/"

Database Integration

A design constraint of this project was to isolate the database from the webserver. Instead of issuing SQL queries directly to the database, the webserver makes indirect requests through RabbitMQ.

Suppose that the database server provides a function login that takes as parameters a username and password. The following code would access login indirectly, just like calling any other function.

$db_client = new DatabaseRpcClient();
$db_client->call("login", $username, $password); // example

This design pattern is known as remote procedure calling (RPC). The files rpc_client.php and rpc_server.php were adapted from this official RabbitMQ tutorial.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages