Coder Social home page Coder Social logo

story-squad-be-archived's Introduction

Maintainability Test Coverage

API Documentation

Getting started

Check the wiki for a setup guide

Backend framework

Express

  • Useful libraries such as helmet and CORS.
  • Well documented.

TypeORM

  • Simplifies database creation, connections, queries, etc
  • Plays well with Typescript
  • Simple seeding.

Jest

  • Maintains consistency with front-end testing

SuperTest

  • Simplifies endpoint testing
  • Integration testing

Endpoints

Postman Documentation

Authorization Routes

Method Endpoint Access Control Description
POST /auth/register all users Creates parent account and Stripe customer.
USE /auth/login adult users Returns parent token.

Admin Routes

Method Endpoint Access Control Description
GET /admin/ admin users Returns list of admins/moderators
GET /admin/me admin users Returns self information
GET /admin/:id admin users Returns matching admins/moderator
POST /admin admin users Returns added admin/moderator id
POST /admin/login admin users Returns admin token
PUT /admin/register admin users Returns admin token

Parent Routes

Method Endpoint Access Control Description
GET /parents/me adult users Returns logged in parent.

Child Routes

Method Endpoint Access Control Description
GET /children/list adult users Returns a list of child accounts associated with logged in parent
POST /children/list adult users Adds a new child account
GET /children/list/:id adult users Returns specified child account
PUT /children/list/:id adult users Updates specified child account
DELETE /children/list/:id adult users Deletes specified child account
GET /children/me child users Returns logged in child
GET /children/preferences child users Returns child's preferences
GET /children/progress child users Returns Progress of current week
POST /children/progress child users Updates progress of current week
GET /children/cohort adult users Returns cohort the child is in
GET /children/parent child users Returns the child's parent
POST /children/:id/login adult users Returns JWT for Child

Canon Routes

Method Endpoint Access Control Description
GET /canon/ admin users Returns a list of pdf
GET /canon/:week all users Returns a matching pdf
POST /canon admin users Creates a new pdf

Cohort Routes

Method Endpoint Access Control Description
GET /cohort/ all users Returns Cohort ID of logged in child
GET /cohort/list/ admin users Returns a list of all Cohorts
POST /cohort/list/ admin users Creates a new Cohort
PUT /cohort/list/:id/ admin users Updates specified Cohort
DELETE /cohort/list/:id/ admin users Deletes specified Cohort

Payment Routes

Method Endpoint Access Control Description
GET /cards adult users json list of user's cards
POST /cards adult users adds card as payment source to Stripe
POST /subscribe adult users creates a subscription
DELETE /cards/:id adult users deletes a payment method

Submissions Routes

Method Endpoint Access Control Description
GET /submissions child users json list of user's submissions
GET /submissions/:week child users json object of a user's submission for a specific week
POST /submissions child users upload image and receive json object of a user's new submission and the transcribed text
DELETE /submissions/:week child users delete and receive json object of a user's removed submission

Versus Routes

Method Endpoint Access Control Description
GET /versusRoutes/versus child Gets a childs full match data

Voting Routes

Method Endpoint Access Control Description
GET /votingRoutes/voting child Gets a random match to vote on
POST /votingRoutes/voting child Submits a vote

Story Routes

Method Endpoint Access Control Description
GET /storyRoutes/:week child Returns a story based on week
GET /storyRoutes/children/:id admin Returns all stories for child with :id
GET /storyRoutes/children/:id/week/:week admin Returns story based on week for child with :id
PUT /storyRoutes/stories/:id admin edits isFlagged value for story with :id. Body needs {"isFlagged": boolean}

Illustration Routes

Method Endpoint Access Control Description
GET /illustrationRoutes/:week child Returns a picture based on week
GET /illustrationRoutes/children/:id admin Returns all pictures for child with :id
GET /illustrationRoutes/children/:id/week/:week admin Returns picture based on week for child with :id
PUT /illustrationRoutes/illustration/:id admin edits isFlagged value for picture with :id. Body needs {"isFlagged": boolean}

Final Routes

Method Endpoint Access Control Description
GET /finalRoutes/time child Returns true or false, depending on whether or not voting time is over
POST /finalRoutes/results child Returns the results of the match for the child that is logged in. assumes voting time is over

Game Walkthrough from Labs24

Known issues at the end of Labs24 6/24/20

Contributing

When contributing to this repository, please first discuss the change you wish to make via issue, email, or any other method with the owners of this repository before making a change. Please note we have a code of conduct. Please follow it in all your interactions with the project.

Attribution

These contribution guidelines have been adapted from this good-Contributing.md-template.

Documentation

See Frontend Documentation for details on the frontend of our project.

For information on database entities and environment variables, see the backend documentation.

story-squad-be-archived's People

Contributors

b-griffinn avatar berniedurfee avatar bnmoyers avatar dani-digital avatar deusexmashima avatar ericbanker12 avatar forrestdarabian avatar grifmang avatar itshui3 avatar jgpico avatar lgv-0 avatar nwkendall avatar ryan-hamblin avatar youngw417 avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

story-squad-be-archived's Issues

Match allocation edge cases

Currently, the matchMaking and versusRoutes endpoints handle matchmaking for four individuals, 2 teams of 2 correctly.

Although DS will allocate players to matches with less than 4 players, BE cannot dynamically handle matches if one, two or three players are left out, or what to do if child.id = 0 is present in a match object.

Possibly 2 vs 1 scenario, 1 vs 1 scenario, or duplicate some submissions to be used multiple times to fill in for the missing players.

*Stakeholder aware of issue

Pages need to request browser to deny caching

While working with the voting-component, due to the large size Chrome began caching the webpages, which then caused the pages to return the same error message constantly.

The temporary fix is to visit the cached URL in a new tab and refresh until it updates, then you can continue.

Unidentified Matchmaking Bug

Unknown replication steps, using specifically child ID's 9-16, when attempting to generate the matches, the "not enough submissions" error was given back, even though all children had illustrations and stories tied back.

Full reset resolved the problem.

Possibly the wrong ID values being checked in the matchmaking route? Unknown.

New canon data inconsistencies

If a new canon is set for a week, previous match-ups still exist. Previous story submissions seem to stay too. However, it also allows generating another set of the same match-up now for some reason.

Stories disappearing mysteriously

There's a case I'm currently unable to replicate where story submissions will sometimes disappear. illustrations are safe for some reason. Match-ups that pre-exist stay but due to no stories, the allocation page won't render successfully.

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.