We have a text document with a description of the game and a layout. Based on these materials, it is necessary to create a database schema and documentation for the REST API. The next stage requires implementation in Node.js.
Documentation is needed before implementation so that we can work on the frontend in parallel.
Users can:
- Enter the game, a record is created in the database on the first login, if they came through a referral link, this should be taken into account.
User uniqueness is checked based on telegram_user_id, telegram_username + a certain hash should be generated to prevent registration through manual requests, for example, through Postman. After authorization, an API Token is issued, which is passed in the Bearer token header in all subsequent requests.
- See data from the server within the game.
- their balance, info, fuel reserve, level, etc. according to the document - GET request.
- can go to the upgrades section, see their lists, and buy available ones - GET, POST requests.
- can go to the tasks section, complete them, and claim the reward - GET, POST requests.
- can go to the referrals section, where there is information about the referral system and the number of invited users - GET request.
- Play - the essence of the game is to repeat the same actions - swiping on the screen. The player swipes a certain number of times, after which a request is sent to the server, which transfers the quantity and the current timestamp to the server. The server checks for fraud protection and credits resources for each action according to the level - POST request.