Git Product home page Git Product logo

league-for-good's Introduction

FCC League-For-Good

This is a free, open-source web application designed to help sports leagues track their player and team stats, and simplify the other day-to-day tasks involved with team management. It was designed to accommodate many popular sports.

Join Us On Slack!

You can now join us on slack. Get Invite Here

Getting Started

Prerequisites

In order for the authorization component of this app to work, it needs to be registered with Google. Here is a helpful walkthrough of that process: https://developers.google.com/identity/sign-in/web/devconsole-project.

You will want to register Type as Web application, set Authorized JavaScript origins to http://localhost:4000 (if you're running the application locally) and set the Authorized redirect URI to http://localhost:4000/auth/google/callback (this can be set through the Google API Console Dashboard under Credentials if not offered as an option during setup).

You will also need to enable the "Google+ API" on the Google API Console Dashboard - if you forget, Google will display an error message (with a link to the API) the first time you try to log in.

Steps

  • Fork and clone the repo
  • Run npm install
  • In the root directory, create a .env file and place the following:
    • MONGO_URI = Your database uri - typically mongodb://localhost:27017/your_project_name if your MongoDB is local
    • GOOGLE_CLIENT_ID = Client id assigned by Google
    • GOOGLE_CLIENT_SECRET = Client secret assigned by Google
    • SESSION_SECRET = Any random string of characters
    • GOOGLE_CALLBACK_URL = http://localhost:4000/auth/google/callback (Use for the callback url in the Google API console)
  • Open a new terminal session and run mongod if mongodb is on the local machine
  • Run npm run dev
  • Navigate to localhost:4000 in your browser

Available Scripts

In the project directory, the following commands are available:

npm install

Installs all the dependencies

npm run dev

Builds the app for development. It is watched by webpack for any changes in the front end.

How to Contribute

We warmly welcome contributions from anyone. Check out our how to contribute section to find out how you can do so.

league-for-good's People

Contributors

abdelrahman1 avatar afranco07 avatar ahstein3521 avatar ajgingrich avatar benhagan avatar bikrambhattacharya avatar domwakeling avatar fredwong-it avatar gonzajf avatar hcuffy avatar isaacraymond avatar lanesawyer avatar lieberscott avatar makkoli avatar patleong avatar paulywill avatar renestl avatar satyadeeproat avatar sbtn avatar vikramnr avatar

Stargazers

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

Watchers

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

league-for-good's Issues

Button and Dashboard is no longer working

Need some confirmation... but I have tried to generate a new clone from the repo and the dashboard does not appear to be working for any of the buttons.

Is anyone else having this issue with a fresh copy?

Setup Issue: Error after running "npm run dev"

I've cloned a copy of the project ran npm install and setup the Google sign in stuff. (created the .env file) after running 'npm run dev' I'm getting an error in registration.js. "Unexpected token ..."

Looks like node is not able to recognize the spread operator??? Is anyone else seeing this? Any Ideas?

screen shot 2017-08-29 at 8 45 20 pm

mongo driver is running @ mongodb://localhost:27017/league-for-good
mongo -version = 3.2.8
node --version = v6.11.1

Add source map to webpack

It would really help development in Chrome devtools if we set up webpack to emit a source map so that we can set breakpoints on the real lines of code, rather than what is transpiled into the bundle. Here's the documentation: https://webpack.js.org/configuration/devtool/#devtool

Essentially, it's just a one line add to the webpack.config.js of devtool: 'source-map'.

I figure we could add a "first-timers-only" label on it and post this issue somewhere in FreeCodeCamp for a camper to try! Open source can be intimidating, so why not save this task for someone wanting to try contributing for the first time?

Writing tests

We need tests to be written for server and client side.

There are example tests in server/models/__tests__ and client/reducers/__tests__

Switch to FCC's Eslint Config

I think it might be valuable to switch over to using FCC's eslint config to help standardize the styling guidelines used across the many FCC projects.

I've already ran it using the FCC config and there were over 1000 errors. I'm perfectly happy to go address all of them, but I wanted to check to see if that's something that's even desired for this project.

Clicking on settings generates prop type error

  • Log in to the league.
  • Open the console
  • Create a league -> open the league -> Click on settings.

In the setting this error will be generated

VM2888 checkPropTypes.js:19 Warning: Failed prop type: Invalid prop roles[0]of typestringsupplied toIcon, expected object. in Icon (created by Connect(Icon)) in Connect(Icon) (created by StaffList) in span (created by TableBody) in td (created by TableRowColumn) in TableRowColumn (created by TableBody) in tr (created by TableRow) in TableRow (created by TableBody) in tbody (created by TableBody) in ClickAwayListener (created by TableBody) in TableBody (created by TableBody) in TableBody (created by TableTemplate) in table (created by Table) in div (created by Table) in div (created by Table) in Table (created by TableTemplate) in div (created by TableTemplate) in TableTemplate (created by StaffList) in div (created by StaffList) in StaffList (created by Connect(StaffList)) in Connect(StaffList) (created by Route) in Route (created by SettingsRoutes) in div (created by SettingsRoutes) in SettingsRoutes in div (created by TabTemplate) in TabTemplate (created by Tabs) in div (created by Tabs) in div (created by Tabs) in Tabs (created by LeagueTabs) in LeagueTabs (created by Dashboard) in div (created by Dashboard) in div (created by Dashboard) in Dashboard (created by Connect(Dashboard)) in Connect(Dashboard) (created by Route) in Route (created by Content) in div (created by Paper) in Paper (created by Content) in div (created by Content) in div (created by Content) in Content (created by loadState) in loadState (created by Connect(loadState)) in Connect(loadState) (created by Route) in Route (created by App) in div (created by App) in Router (created by BrowserRouter) in BrowserRouter (created by App) in MuiThemeProvider (created by App) in App (created by Connect(App)) in Connect(App) (created by Root) in Provider (created by Root) in Root

Manually adding a player to a league bug

Players tab > Manually add a new player to league.

If the user submits an email that is a duplicate in the database, it should respond with an error. It currently responds with as successful(even though it wasn't)

Assign player form has no validation

Players tab > assign a player to team

The form does not validate for jersey, it currently allows for negative and very large numbers and should be between 0-99.

Issue with initialization script.

The initialization script is currently working somewhat. It will execute and do its task but hangs after it is completed since there is some problem with Promise.all.

In server/init/initRoles.js

Promise.all([ownerPromise, managerPromise, coachPromise])
         .then(() => console.log('Roles added'))
         .catch(err => console.log(err));

The then should be closing the database connection to finish the script. However putting mongoose.disconnect() or mongoose.connection.close() after the promises complete will cause the connection to drop before the unique index is created on the collection in the database and will spawn a topology error from mongodb.

The way it is now you have to manually end the script, but the indexes will be created in mongodb and will not allow duplicate roles. Any ideas on how to get mongoose to cooperate with closing the connection would be great.

Fix/Edit player form label misaligned

The "Team" field label in the edit player form under the player tab in the league dashboard is aligned center and needs to be aligned left.

This issue also affects the add player form under the players tab as well.

There is a player form template that will have to be changed. Any style added for select inputs should be in the style sheet under "client/src/components/style.js"

gulputil deprecation

Gulputil was deprecated (I'm not sure when) so now npm kills the install process.

What do I do from here?

(Using nodejs 6)

Webpack does not compile due to the following errors:

Webpack does not compile due to the following errors:

WARNING in ./client/src/actions/games.js

/home/ubuntu/workspace/league-for-good/client/src/actions/games.js
  33:38  error  'games' is defined but never used  no-unused-vars

✖ 1 problem (1 error, 0 warnings)

 @ ./client/src/actions/index.js 115:13-31
 @ ./client/src/hoc/requireAuthentication.jsx
 @ ./client/src/app.jsx
 @ ./client/index.js

WARNING in ./client/src/reducers/seasons.js

/home/ubuntu/workspace/league-for-good/client/src/reducers/seasons.js
  6:2  error  'SELECT_SEASON' is defined but never used  no-unused-vars

✖ 1 problem (1 error, 0 warnings)

 @ ./client/src/reducers/index.js 55:15-35
 @ ./client/index.js

WARNING in configuration
The 'mode' option has not been set, webpack will fallback to 'production' for this value. Set 'mode' option to 'development' or 'production' to enable defaults for each environment.
You can also set it to 'none' to disable any default behavior. Learn more: https://webpack.js.org/concepts/mode/

WARNING in asset size limit: The following asset(s) exceed the recommended size limit (244 KiB).
This can impact web performance.
Assets: 
  bundle.js (908 KiB)

WARNING in entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244 KiB). This can impact web performance.
Entrypoints:
  main (908 KiB)
      bundle.js


WARNING in webpack performance recommendations: 
You can limit the size of your bundles by using import() or require.ensure to lazy load some parts of your application.
For more info visit https://webpack.js.org/guides/code-splitting/

Team filter not working

The dropdown filter for all teams/active teams/archived teams(dashboard, teams tab, default "View your current teams") shows a blank list when "active teams" is selected regardless of teams actually being designated active.

Assign player form filter dropdowns

Players tab > assign player to team

The team and player fields should have dropdowns with that show all selectable teams and players and filters them as the user types.

Archiving of leagues

Background: FCC are not keen for there to be any ability to delete a league in it's entirety from the database

Issue: If you have a lot of leagues, it would be good to be able to "hide" them

Proposal: Include an 'archive' section in the left-hand NavBar, collapsed to just the title by default, and the ability in league settings to send a league to archive / return a league to active status

Menu show/hide not working?

Looking at the code I think that the 'hamburger' in the AppBar is intended to show/hide the left-hand NavBar? Not doing do on my local version.

Alternatives are to implement show/hide or remove the hamburger

Teams should not be allowed to play against each other

Seasons Tab > All seasons > Games

The new game form and edit game form after a game has been created currently allow the same team to be both the home and away team. When you select a team in one list, it should be removed from the other list.

Feat/View player needs to be styled

The view player page under the players tab in the league dashboard needs to be styled. There is currently no styling added to this page. As of right now, all styling is being placed in "client/src/components/style.js"

JSON Schema for game stats

We're going to introduce stat tracking on a sport-by-sport basis. We'll need a JSON schema for each sport. Please leave a comment with a proposed schema including any attributes you think we'd need to store that are important to stat-keeping for that sport.

The sports we're currently offering are:

  • Soccer

  • Football

  • Basketball

  • Baseball

  • Hockey

I'd be happy to answer any questions. Thanks in advance.

Can't run app

I'm having problems running the application, getting the following error:
SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode

I haven't used node much, I've tried googling the issue but so far I haven't found anything useful.. Will I have to edit every .js file, to change variables from let and so on to var?

It is not possible to add new staff member

  • Log in to the league.
  • Open the console
  • Create a league -> Open your league -> Click on settings -> Click add member icon.

The screen will go blank with several errors and warnings:

First error:
VM7000 react-dom.development.js:55 Uncaught Error: Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops. at invariant (VM7000 react-dom.development.js:55) at scheduleWork (VM7000 react-dom.development.js:16787) at Object.enqueueSetState (VM7000 react-dom.development.js:11478) at Connect.Component.setState (VM6995 react.development.js:364) at Connect.onStateChange (VM7011 connectAdvanced.js:215) at Object.notify (VM7014 Subscription.js:28) at Subscription.notifyNestedSubs (VM7014 Subscription.js:67) at Connect.notifyNestedSubsOnComponentDidUpdate (VM7011 connectAdvanced.js:226) at commitLifeCycles (VM7000 react-dom.development.js:14532) at commitAllLifeCycles (VM7000 react-dom.development.js:15738)

Login keeps looping

Able to get the login screen, but then when I select my google userid it attempts to redirect to:

http://localhost:4000/?code=4/XbD2kh3OWXu5K3O7HoXIrRjoQBb_yDycI6fcsmg--dk#

That does not look like like my GOOGLE_CLIENT_ID, GOOGLE_CLIENT_SECRET, SESSION_SECRET, or GOOGLE_CALLBACK_URL.

The loops back to login screen.

Unable to create league

I'm unable to create a league. Everything is running well without errors, however, when I click on create from the create league field, it looks like there's no action fired.

Feat/Add description to delete season modal

The delete modal under seasons tab in the league dashboard needs to have a child component added. This child component needs to says:

Are you sure you want to delete [season name]? This action cannot be undone.

Feature/Styling on New Staff form

On the 'new staff' form (dashboard Settings tab, "add a new member of staff ..."):

  • clicking on the 'more info' icon next to role should give a description of roles
  • the field for selecting role is too narrow (unless on an ultra-wide screen) compared to the text options presented

Styling review - mobile views

Have had a look at how the app looks on a mobile device using Responsinator; doubtful that anyone would want to use it on a phone but I think optimising for tablet viewing is probably a good idea?

Suggest immediate issue is width of the drawer (Menu.jsx) which is currently set at 15% for viewports above 'mobile' - means that it renders with cut-off text on everything from mobile-landscape through tablet-portrait, and (on my local version) is very tight on name even on tablet-landscape.

Unexpected token ...

I would like to contribute to this project but when using npm run dev I am thrown an error.

league-for-good\server\api\registration.js:25 const player = ({...req.body, ...{ leagueId }});

From what I understand ... is ES7 and/or experimental and Babel may not catching it. How should I proceed?

Fix/Remove the update column under team roster

On the roster view under the teams tab in the league dashboard, the update column needs to be removed from the array that is used to render the columns. We no longer want to update players through the teams.

Fix/Assign column in player registrations

The assign column in the player registrations link under players tab in the league dashboard needs to be changed from
Column name: Assign -> Approve
Column Icon: Edit Pencil -> Checkmark

Add a way to rename leagues

Under the settings tab, an icon needs to be added that will load a form that allows owners and admins of the league to rename it.

"Failed to compile" - Can't resolve './CreateLeagueButton.jsx'

Hi. I'm brand new to the project, or brand new to wanting to explore the project; but I cloned it yesterday, and failed to get it up and running...

Steps I followed:

  • Cloned master@28f8e33 on 4/28/2018.
  • Added .env to project...
  • Per Readme, added environment vars to .env (and provisioned Google+ Api)
  • npm install
  • npm run dev

Asciicast of terminal output:

ERROR in ./client/src/components/create_league/CreateLeagueSelector.jsx
Module not found: Error: Can't resolve './CreateLeagueButton.jsx' in '/Users/emjayess/Sources/freeCodeCamp/league-for-good/client/src/components/create_league'
 @ ./client/src/components/create_league/CreateLeagueSelector.jsx 17:26-61
 @ ./client/src/components/create_league/CreateLeagueForm.jsx
 @ ./client/src/components/Content.jsx
 @ ./client/src/app.jsx
 @ ./client/index.js

Login is not detecting existing user and does not load users league

I'm getting this error in the console when I log in to the app:

UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): WriteError({"code":11000,"index":0,"errmsg":"E11000 duplicate key error collection: league-for-good.users inde
x: email_1 dup key: { : \"[email protected]\" }","op":{"name":"Lane Sawyer","avatar":"https://lh5.googleusercontent.com/-U6Re7TML-ZA/AAAAAAAAAAI/AAAAAAAASu4/yfVVvz0Zxp0/photo.jpg?sz=50","email":"lanes
[email protected]","_id":"5946074fb9c1181d18e9de4f","__v":0}})

It still signs me and loads the app, but none of my existing leagues are shown.

Fix/Break up CSS file

The CSS file in the "client/src/components/style.js" needs to be broken up into smaller files.

These smaller files and themes.js can be placed in their own directory and referenced using a file that exports all the modules. These will make the css easier to maintain.

Unable to rename or delete league

The delete link for the league is not working.

image

I accidentally put a team name (ie Eagles) in the league entry. Unable to rename or delete the league.

Adding a new player to a league does not update the player list

Players tab > Manually adding a player to league

After successful insertion, the roster does not update with the new player. It is being added to the list of unapproved player registrations. If the admin manually adds a player it should be immediately added to the list of all players.

Feat/Change assign player form

The assign player form needs to be improved so it can handle assigning multiple players to a single team.

Currently, the assign player form only handles assigning a single player to a single team. It would be better to use something like the Material-UI stepper component.

Step 1: Display a list of all players in the league that are not in an active season and display the players with a checkbox so all checked players can be assigned to a single team.

Step 2: Display a list of all active teams that the players can be assigned to

Step 3: Have two fields, one for jersey numbers and one for positions for each player that is about to be added to the team

Submitting will then add all players on the back to that team with their jersey number and position attributes

Issue on setting up Google API credentials

I have set my .env file like this
MONGO_URI = 'mongodb://localhost:27017/league-for-good'
GOOGLE_CLIENT_ID = '932757790180-0ref2odnm0v9uemj93ib6n3mhr2hescn.apps.googleusercontent.com'
GOOGLE_CLIENT_SECRET = 'Gh4wqdrg1bnUfYHa2BsnXx3x'
SESSION_SECRET = 'xyz'
GOOGLE_CALLBACK_URL = 'http://localhost:4000/auth/google/callback'

still I am getting this error on choosing the account for login after clicking on login button at localhost:4000
screen shot 2017-08-17 at 2 57 07 am

Feat/Style player registration page

The view page under player registrations link under the player tab in the league dashboard needs to be styled. This could also be done in conjunction with issue #42

Any styles should be added to "client/src/components/style.js" for now.

Live Demo

Anyone having a running demo of application??

Client does not load (Only a blank screen is displayed)

To reproduce:

  • Fork and download the repo
  • Setup up environment as for README
  • Subdue errors associated with: #104
  • Run npm run dev

Result: A blank screen is displayed.

  • Check the console the following will be displayed:
    Uncaught TypeError: Cannot read property 'injection' of undefined at e.exports (injectTapEventPlugin.js:23) at Object.<anonymous> (app.jsx:24) at n (bootstrap:19) at Object.<anonymous> (index.js:9) at n (bootstrap:19) at bootstrap:83 at bootstrap:83

Confirmed on
OSX
Chrome : Version 68.0.3440.106 (Official Build) (64-bit)
Firefox : 62.0 (64-bit

screen shot 2018-09-09 at 5 51 42 pm

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.