Giter VIP home page Giter VIP logo

gladiator's Introduction

Gladiator ๐Ÿ›ก StyleCI

Welcome to Gladiator, the admin tool for DoSomething Competitions!

This application is built using the Laravel Framework.

Getting Started

Fork and clone this repository, and set it up as a local app running inside DS Homestead or regular Homestead.

After the initial Homestead installation ssh into the vagrant box, head to the project directory and run composer to install all the project dependencies:

$ composer install

Once all vendor dependencies are installed, run the migrations to setup the database and seed it:

$ php artisan migrate
$ php artisan db:seed

Next, if you already exist as a DoSomething user within [Northstar]((https://www.github.com/dosomething/northstar), our user and activity API, run the following command to set yourself up as an admin in your local Gladiator instance:

$ php artisan add:user [email protected] --role=admin

Finally, to setup the front-end build system, you can either be in the Homestead vagrant box or on your local.

Homestead already comes with node and npm, but if running on your local you will need to make sure both those dependecies are installed.

You need to install gulp globally using:

$ npm install --global gulp

Next, install all the npm dependencies:

$ npm install

Now you're all set to built the front-end assets by running:

$ gulp

All set!


Laravel PHP Framework

Build Status Total Downloads Latest Stable Version Latest Unstable Version License

Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable, creative experience to be truly fulfilling. Laravel attempts to take the pain out of development by easing common tasks used in the majority of web projects, such as authentication, routing, sessions, queueing, and caching.

Laravel is accessible, yet powerful, providing powerful tools needed for large, robust applications. A superb inversion of control container, expressive migration system, and tightly integrated unit testing support give you the tools you need to build any application with which you are tasked.

Official Documentation

Documentation for the framework can be found on the Laravel website.

Contributing

Thank you for considering contributing to the Laravel framework! The contribution guide can be found in the Laravel documentation.

Security Vulnerabilities

If you discover a security vulnerability within Laravel, please send an e-mail to Taylor Otwell at [email protected]. All security vulnerabilities will be promptly addressed.

License

The Laravel framework is open-sourced software licensed under the MIT license

gladiator's People

Contributors

angaither avatar blisteringherb avatar dfurnes avatar lindaortega avatar mshmsh5000 avatar sbsmith86 avatar scottpaillant avatar weerd avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gladiator's Issues

Leaderboard

Columns for leaderboard:

Rank Name Number of x's y'd Email Flagged Status
1 Jerome 50 [email protected] approved
2 Hils 35 [email protected] approved
3 Bernie 20 [email protected] approved

Sort by number of x's y'd.

If there is a pending file highlight the row in yellow, only show approved if there are NO PENDING files

Drop phone number

Implement API Transformers & API Key

Transformers, robots in disguise!
image

Implement the use of API response Transformers using Fractal and add an API key so POST can't be sent to Gladiator anonymously!

Relates to recent work completed in #44

Pull campaigns info from phoenix

As an admin I want these variables to be replaced in emails

  • campaign title
  • campaign_link#prove
  • repoortback_noun
  • reportback_verb

update db structure

New DB structure.

Overview: A Contest is the umbrella container for everything. Each Contest has one Waiting Room that has sign up dates tied to it that can be set and edited by an admin as needed. Waiting Rooms get split into Competitions. Competitions hold groups of users competing in a contest and store the date the competition starts and the date they will end based on the run period of the Contest.

Contests

  • contest_id
  • campaign_id
  • campaign_run_id
  • waiting_room_id
  • How long the contest runs for (duration)

Also has (currently undetermined) metadata such as:

  • title
  • description
  • prize (?)
  • rules

Waiting Rooms

  • waiting_room_id
  • contest_id
  • signup_start_date (admin can edit)
  • signup_end_date (admin can edit)

Waiting Room Users

NOTE: I think this table exists already and should still work with this new structure:
waiting_room_id
user_id

Competitions

  • competition_id
  • contest_id
  • competition_start_date (based on the day this competition was created)
  • competition_end_date (calculated based on run_period and set on creation

Competition Users

  • competition_id
  • user_id

messaging

  • easy way to pull users
  • or a queue to send messages

Update Waiting Rooms CRUD

Update the waiting room CRUD methods and views to work with the new DB structure.

After #56, we are now creating a waiting room automatically when a contest is created. We still need the option for admins to be able to view all waiting rooms, edit waiting rooms, etc.

I'm not sure we need to expose the create form anymore but open to thoughts on that.

implement user cache

store user info in cache

  • first name
  • last name
  • email
  • mobile

this part may be vNext

  • signup and rb data

Update Waiting Room Split functionality

Update the waiting room split functionality to work with the new DB structure, not sure how much of this needs to change, but this is a general outline of what should happen.

  • There is one waiting room per contest.
  • When the sign up period is over there is an option to split the room.
  • The room gets split in to competitions.
  • After split, the users get removed from that room and it can be reused if needed.

Create endpoint for Phoenix to get Contests

This endpoint can replace #26

Phoenix should be able to hit this endpoint to see if there is a contest on a node and the response should include if the signup period on that contest is open (based on the dates on the waiting room).

db structure

Create the following migrations:

  • users
  • roles
  • role_user
  • waiting_room [id | nid | run_nid | signup_dates]
  • competitions [id | nid | run_nid | comp_dates]
  • competition_user

update the contest create form

it would be a lot easier to create a waiting room at the same time as a contest, so let's add the waiting room start and end dates to the contest form

Varying "no cache" results as false or null

"Retrieving many" from the cache seems to vary how the results that are not found come back... as either false OR null which is confusing and seems like there's an underlying issue to look at.

Signing up for multiple contests with the same user causes app to fail

Illuminate\Database\QueryException">QueryException</abbr> in "/var/www/gladiator/releases/20160315170527/vendor/laravel/framework/src/Illuminate/Database/Connection.php line 669" 
SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry &#039;559442cfa59dbfc9578b4c14&#039; for key &#039;PRIMARY&#039; (SQL: insert into `users` (`id`, `role`, `updated_at`, `created_at`) values (559442cfa59dbfc9578b4c14, , 2016-03-15 17:14:30, 2016-03-15 17:14:30))

image

unit tests

refs #18

automatically running and tested before merging

Pull user info into a CSV

since we are holding off with messaging, need a way to get user info to mail merge send reminders and leaderboard updates
refs #23

Contest index

refs #77

  • add waiting room end date to the table index
  • create two tables of contest index
    • open contests show on the top
    • closed contests show under in a different table

add forge

because we <3 patterns ๐ŸŽจ

Split the waiting room

After the signup dates in a waiting room has ended an admin needs to be able to split users out into competitions

Create endpoint for Phoenix to post users

When a user confirms that they would like to sign up for a competition, Phoenix sends a post request, and need to implement an endpoint on Gladiator to receive this post and add the new user to the User tables and place in appropriate waiting room.

Sort/Filter Competitions

  • Should be able to view competitions based on the contest they are apart of. Add the ability to sort by Contest, and the ability to filter for a specific contest.
  • Sort competitions by start and end dates.

need view to see users in waiting room on the contest view

It'd be helpful to know how many users are in a waiting room (and ideally who they are) before deciding to split or not.

Ideally this could be a new column on https://qa-gladiator.dosomething.org/waitingrooms where the number of users displays in the table and links to a view of who those users are.

Number of people in the waiting room should be the priority. This way Hillary and Chris can know how much traction the competition has received and if they should split it sooner rather than later given demand.

Controller tests

I would like to take a stab at starting to write some tests for this app. Starting with some basic controller tests

remove waiting room routes and code

  • Hide contest id on edit of waiting room, this isn't super useful, especially if it's inherited on the contest form
  • remove routes to create/edit waiting rooms explicity
  • remove the waiting room link from the nav

updates to contest view

  • remove all competitions link from the nav
  • pull the filtered competitions table into the contest view
  • be able to access the list of users in the waiting room
    • show total number of users in waiting room
  • show list of competitions

Contest CRUD

Now that we have the concept of Contests, we need to create CRUD methods for them.

Update CSV export

  • First Name
  • Last Name
  • Email
  • Cell
  • Reportback admin link
  • Flagged Status
  • Quantity
  • Northstar User ID

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.