Skip to content

PewPewPewTuring/back-end

Repository files navigation

Contributors Issues Stargazers Forks Build Badge


PewPewPew is a simple grid-based puzzle game designed to give you a few minutes cool-down between activities. Try to top our leaderboard!

This repository is for the API that stores our game data and manages our leaderboard.


Contributors

Jacq Whitmer Dane Brophy Kevin Mugele Joshua Horner Logan Vincent

Table of Contents

Links
Tools Used
Setup
Learning Goals
Database Schema
API Endpoints

Tools Used

Development Development Testing Deployment

Setup

This project requires Python3

  • Fork this repository

  • From the command line, install dependencies and set up your DB:

    • python3 -m venv venv
    • source venv/bin/activate
    • pip3 install -r requirements.txt
    • export FLASK_APP=pewpewpew.py
    • python3 -m flask db migrate -m "games table"
    • python3 -m flask db upgrade
    • flask seed run
  • Run the test suite with pytest

  • Run test coverage report with pytest --cov=pewpewpew tests/

  • Run your development server with flask run to see the app in action.

  • Heroku Deployment, for production

Learning Goals

    ⭐     Demonstrate knowledge you’ve gained throughout Turing
    ⭐     Use an agile process to turn well defined requirements into deployed and production ready software
    ⭐    Gain experience dividing applications into components and domains of responsibilities to facilitate multi-developer teams. Service oriented architecture concepts and patterns are highly encouraged.
    ⭐     Explore and implement new concepts, patterns, or libraries that have not been explicitly taught while at Turing
    ⭐     Practice an advanced, professional git workflow using Git Rebase
    ⭐     Gain experience using continuous integration tools to build and automate the deployment of features
    ⭐     Build applications that execute in development, test, CI, and production environments
    ⭐     Focus on communication between front-end and back-end teams in order to complete and deploy features that have been outlined by the project spec

Database Schema

API Endpoints

  • POST to /api/v1/games
    • accepts the following body:
    "body": {
      {
        "player_name": "name",
        "time_lapsed": "time",
        "moves_taken": "num of moves",
        "hidden_items_found": "num of items"
      }
    }
    
    • returns the following body:
    {
      "player_name": "name",
      "score": "score"
    }
    
  • GET to /api/v1/leaderboard
  • returns the following body:
  {
   "games": [
     {
       "player_name": "name",
       "score": "score"
     },
     {
       "player_name": "name",
       "score": "score"
     },
     {
       "player_name": "name",
       "score": "score"
     },
     {
       "player_name": "name",
       "score": "score"
     },
     {
       "player_name": "name",
       "score": "score"
     },
     {
       "player_name": "name",
       "score": "score"
     },
     {
       "player_name": "name",
       "score": "score"
     },
     {
       "player_name": "name",
       "score": "score"
     },
     {
       "player_name": "name",
       "score": "score"
     },
     {
       "player_name": "name",
       "score": "score"
     }
   ]
 }
  • DELETE to /api/v1/games/<id>
  • deletes one game from database by id
no request body or headers