/gameofdrones-frontend

Frontend builded in Angular 18 for Test of the Game: Paper, Rock, Scissors

Primary LanguageTypeScript

Rock, Paper, Scissors Game

Visit the Rock, Paper, Scissors Game Site

Enter to players: image

Game Option for Pedro Player: image

Game Option for Juana Player: image

Game Option for Pedro Player registering the round: image

Game Option for Juana Player registering the round: image

Show the winner: image

Retrieve all winners history.

GET https://gameofdronesapi-h7gshrfmc8g4cmbs.northeurope-01.azurewebsites.net/api/game/winners

Result:

[
    {
        "datePlayed": "2024-11-07T10:16:25.653",
        "winnerId": 1,
        "winnerName": "Pedro"
    }
]


Config the game moves

Retrieve all moves:

GET https://gameofdronesapi-h7gshrfmc8g4cmbs.northeurope-01.azurewebsites.net/api/game/moves

Result:

[
    {
        "kills": "Rock",
        "moveId": 1,
        "name": "Paper"
    },
    {
        "kills": "Scissors",
        "moveId": 2,
        "name": "Rock"
    },
    {
        "kills": "Paper",
        "moveId": 3,
        "name": "Scissors"
    }
]
image

Create a new move:

POST https://gameofdronesapi-h7gshrfmc8g4cmbs.northeurope-01.azurewebsites.net/api/game/move

Example body:

	{
		"Name": "String",
		"Kills": "Dog"
	}

Result:

{
    "kills": "Dog",
    "moveId": 20,
    "name": "String"
}
image

Update a move

PUT https://gameofdronesapi-h7gshrfmc8g4cmbs.northeurope-01.azurewebsites.net/api/game/move/{id}

Example:

PUT https://gameofdronesapi-h7gshrfmc8g4cmbs.northeurope-01.azurewebsites.net/api/game/move/20

Example body:

	{
		"Name": "Cadena",
		"Kills": "Dog"
	}

Result:

{
    "kills": "Dog",
    "moveId": 20,
    "name": "Cadena"
}
image

Delete a move by ID:

DELETE https://gameofdronesapi-h7gshrfmc8g4cmbs.northeurope-01.azurewebsites.net/api/game/move/{id}

Example

DELETE https://gameofdronesapi-h7gshrfmc8g4cmbs.northeurope-01.azurewebsites.net/api/game/move/20
image

Technical Info

This project was generated with Angular CLI version 18.2.11.

Install

npm install

Development server

Run ng serve for a dev server. Navigate to http://localhost:4200/. The application will automatically reload if you change any of the source files.

Code scaffolding

Run ng generate component component-name to generate a new component. You can also use ng generate directive|pipe|service|class|guard|interface|enum|module.

Build

Run ng build to build the project. The build artifacts will be stored in the dist/ directory.

Running unit tests

Run ng test to execute the unit tests via Karma.

Running end-to-end tests

Run ng e2e to execute the end-to-end tests via a platform of your choice. To use this command, you need to first add a package that implements end-to-end testing capabilities.

Further help

To get more help on the Angular CLI use ng help or go check out the Angular CLI Overview and Command Reference page.


Config

To avoid troubles with cors, change the port in the target of the api in the src/proxy.conf.json file:

{
  "/api": {
    "target": "http://localhost:5073",
    "secure": false
  }
}

Parametrize the url api on the src/environments/environment at apiUrl varieble: Example:

export const environment = {
  apiUrl: 'http://localhost:5073/api/game'
};