Coder Social home page Coder Social logo

backend's Introduction

๐Ÿšจ ๐Ÿ’ป ๐Ÿšจ

Roam (Backend)

An augmented reality game set in a futuristic post-apocalyptic world. Battle your enemies, team up with your friends, scavenge for inventory items and conquer bosses!

Purpose

Our backend server is in charge of data storage, GeoJSON location-based polygon shape generation, AI-based generation of items and bosses, user authentication, live multiplayer tallying (both of scores and positions), weather checkup (to augment game environment) and other sorts of stuff. Of course, this is all accessible both as a RESTful API and as a realtime websocket-based interface!

TechStack

We used the following technology stack for our game:

  • ๐Ÿ›„ Redis - quick in-memory key-value store for storing user location
  • ๐Ÿ›„ Postgres - good ol' relational database to store good ol' relational data. We'll also be using the Postgres PostGIS
  • ๐Ÿ Python - backend application server language of choice
  • ๐Ÿณ Docker - for containerizing our backend application

As we're using Docker, our backend is completely portable! Just make sure to have Docker and Docker-Compose installed and run docker-compose up!

API Routes

  • POST /signup

    • Request Body: {username:string, password:string, class_id:int}
    • Response: {status:int, message:"success"|"failure"}
  • POST /login

    • Request Body: {username:string, password:string}
    • Response: {jwt_token:string}
  • GET /user/me/account

    • Request Header: User's JWT Token
    • Response:
    {
        username: string, 
        hp: int, 
        xp: int, 
        inventory: [{
          id: int, quantity: int, 
          name: string, description: string 
        }]
    }
    
  • POST /user/me/account

    • Request Header: User's JWT Token
    • Request Body
    {
        username: string, 
        hp: int, 
        xp: int, 
        inventory: [{
          id: int, quantity: int
        }]
    }
    
  • POST /maprender

    • Request Header: User's JWT Token
    • Request Body:
    {
        x:int, 
        y:int, 
        {
          latitude: float, 
          longitude:float
        }
    }
    
    • Response:
    {
       image_url: string, 
       weather: "sunny"|"rainy"|"cloudy", 
       render_objects:[
          {
           type: "player"|"ai"|"marker"|"item", 
           description: string, 
           latitude: float,
           longitude: float,
           ...
          }
        ]
    }
    
  • GET /items

    • Response: items_schema as JSON
  • GET /experiences

    • Response: experiences_schema as JSON

Database Schema

The schema of the data, as represented in Postgres

  • classes - id:int, name:varchar, description:text
  • items - id:int, name:varchar, description:text
  • ais - id:int, name:varchar, description:text
  • experiences - id:int, name:varchar, description:text, xp:int
  • users - id:int, username:varchar, password:varchar, class_id:int, created_at:timestamp, xp:int, hp:int
  • users_items - user_id:int, item_id:int, quantity:int
  • users_experiences - user_id:int, experience_id:string

backend's People

Contributors

alastairparagas avatar mfajet avatar

Watchers

James Cloos avatar Siim Kivistik avatar Tony Gu avatar  avatar Camilo Alejandro Riviere avatar  avatar Kerlin Michel avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.