Skip to content

A pokémon trade system made in python that can use three communication between process methods.

Notifications You must be signed in to change notification settings

pedrohso7/PokeTroca

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

poketroca_logo

GitHub stars

Project    |    Technologies    |    Overview    |    PokeTroca UseCase Views    |    Usage

✦ Project

PokeTroca is a distributed system of pokemon trade. This project gives to each registered user, ten random pokémons and you have to make the best team you can through good trades on the platform. With this project we could use three different communication between process for study reasons.

The methods are:

  • Socket
  • RMI
  • Rest

Authors:

  • Pedro Oliveira
  • Samuel Costa Silva Nascimento

✦ Technologies

This project was made using the tecnologies below:

✦ Overview

PokeTroca is composed by an architeture model on the physical layer as follows:

PokeTroca physycal architeture

In other words, our system follows the client-server approach, where the client was made in Python using Kivy and Kivymd to create beauty and friendly views and the server using Python and SQLite as database.

The logical layer (code part) of the server follows the Clean Architeture model:

Server logic layer

And about the client logical layer, it was made inspired on the traditional MVC architeture:

Client logic layer

What about the communication?

First of all, before make PokeTroca, we planned to use a simple route system created by us to simulate, even in Sockets or RMI methods, the request-response approch. In other words, we always send a route and params from client and we always expect this on the server side too and the reciprocal is true. Doing like this, we only had to be worry with the communication, the study object of this repository.

This project implements, as we said, different kinds of comunication. At a first time, we used Sockets that works sending bytes from each process. So we decided to use an external representation that is a known way of data in both client and server, the JSON representation, to avoid any possibility of wrong behaviour.

The second communication method was RMI (Remote Method Invocation) that instead of make a requisition and wait for some response, the client execute a pré defined remote call procedure shared between client and server through .proto archives. The gRPC (Google Remote Procedure Call) framework helps us use this archives and call the remote methods.

Finally, the most used communication method, Rest (Representational state transfer) is implemented here with an API using Flask. In the client side was used a python library to use the http methods and make requests to server.

PokeTroca platform wants to show you there are so many ways to plane an application and we have to consider the context and the goals it wants to reach. Make sure, before starts a new project, to keep in mind the plane phase have the same importance as the code phase to boost your success accuracy. For more details, you can acess the project doc in root path.

✦ PokeTroca UseCase Views

Login View Register View Home View Inventory View Trade View Barter's View

✦ Usage

First you need to install Python3 to run the commands below, most times linux OS's already have this.

Make sure you're on the root path and follow the instructions below:

Server

Go to backend root path:

cd backend

Install the server dependencies with:

make setup

Finally, choose the communication you want for the server and start running with the following:

Socket Server

make run-socket

gRPC Server

make run-grpc

Rest Server

make run-rest

Client

Socket Client

Go to socket client root path:

cd frontend-socket

Install dependencies with:

make setup

Then run using:

make run

gRPC Client

Go to gRPC client root path:

cd frontend-grpc

Install dependencies with:

make setup

Then run using:

make run

Rest Client

Go to rest client root path:

cd frontend-rest

Install dependencies with:

make setup

Then run using:

make run

✦ Start to use

Clone this and use as example to study this mentioned communication methods.

About

A pokémon trade system made in python that can use three communication between process methods.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published