https://github.com/literat/gamee-mission
https://github.com/literat/gamee-mission
Last synced: 27 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/literat/gamee-mission
- Owner: literat
- License: mit
- Created: 2017-09-27T20:23:13.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-10-18T21:29:03.000Z (over 7 years ago)
- Last Synced: 2025-02-12T17:53:16.004Z (3 months ago)
- Language: PHP
- Size: 23.4 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Gamee Mission
Implementation of test case for [Gamee App](https://www.gameeapp.com/).
You should create two API endpoits - one for storing a gamescore, second for providing top 10 players in particular game (game ID is specified in request parameters).
Client (JavaScript) creates a xhr request on this api endpoint and uses jsonrpc schema (http://www.jsonrpc.org/specification).
Request payload is carrying game ID (int), user ID (int) and game score (int),
PHP application receives this request, stores gameplay data into the game leaderboard and returns a success response.
It doesn't matter whether the application runs on php fpm, some php server or anything different
Technical requirements:
* Use nette/di
* Storing leaderboards into suitable Redis (screw data persistency) structureInput data validation:
* It is required of you to validate input data
* Again, use jsonrpc in validation (and other) error responsesBonus points:
* It would be cool for use to just clone a git repo, write `docker-compose up`
* It would be even more cool for the players to have the same ranking as other people with the same score :P## Instalation
Run `composer install` after cloning this project.
## Development
### API
Read `postman_collection.json` for more information.
* `/scores` - Endpoint for data storing.
* `/games` - Endpoint for data fetching.### Servers
#### Local
Require installed docker engine and docker-compose [release notes](https://docs.docker.com/release-notes/)
**Url**
* `localhost:8080`**Composer scripts**
* `composer drun` run local dev server
* `composer drb` rebuild local dev server
* `composer dkill` kill local dev server
* `composer drm` remove local dev server
* `composer dps` list instances on local dev server