Heroku Link: https://famble.herokuapp.com/
An app that allows people to gamble with no negative consequences.
Jay Rana - [email protected]
- Landing page
- Bet modal
- Linting and fixing frontend code
- Redirection based on login status
Steven Gardiner - [email protected]
- Helped setup MongoDB Schema
- Setup Base Application Structure
- Setup Persistent User State on Frontend
- Setup User Routes on Backend
- Setup Game Routes on Backend
Vivek Sreenivasan - [email protected]
- Created User dashboard
- Wrote wrapper functions to interact with API backend
- Linted backend/frontend code
- Researched potential APIs for sports data
Pedro Ramos - [email protected]
- Set up the MongoDB Schemas
- Set up Betting API along with the Betting Service
- Unit testing on the Backend
- Created the mockups
- Linebreak-Style: Every time it was fixed, it would somehow get reverted when pulled from Github.
- Prop-Types: It was not working properly since I could not determine the type of props being passed.
- No-undef: Browser localstorage was undefined but it was being used to store the login token
- No-underscore-dangle: '._id' needed to be accessed as userid for mongodb
- Node (version >= 12)
- MongoDB
- Clone the repo
git clone
- Install the Prerequisites (See Above)
- Install
npm
dependencies frompackage.json
$ npm install
- Run the following on your local machine (Runs on port 3000):
$ npm run dev
In order for the login to work, follow these steps:
- Copy your URL either from
Preview your running application
or from your Heroku deployment. - Go to
https://console.developers.google.com/apis/credentials/oauthclient/<CLIENT_ID>?project=<PROJECT_NAME>
(Replace <CLIENT_ID> and <PROJECT_NAME> with what you created in earlier steps) - Under
URIs
, paste your URL and remove everything after the.com
or whatever the end of your domain is. - Click
Save
In order for the login to work, follow these steps:
- Copy your URL either from
Preview your running application
or from your Heroku deployment. - Go to https://developers.facebook.com/apps and create an account with facebook.
- Set Up a Facebook Login under the Add a Product
- Under Valid OAuth Redirect URIs paste your URL and remove everything after the
.com
or whatever the end of your domain is.
- Copy the app ID that is given to you and paste it into your code after following this process.
- Getting Started:
$ yarn add react-facebook-login
or
$ npm install react-facebook-login
- will also need react-dom for Deployment so run:
$ npm install react react-dom react-facebook-login --save --force
- Sign up to Sportsdata.io by Clicking on Register on the Top right
- After you've signed up, Start a free trial subscription
- To retrieve your API key go under 'My Account' > 'Subscriptions' There you will find API Keys:
- Skip to 'Setting up .env..' and make sure to add the api key in your env file.
- Create a free Twitter user account, Head over to Twitter.com and register for a free account.
- Head over to the Twitter Dev Site and Create a New Application, Navigate to apps.twitter.com, sign in, and create a new application.
- You now should be able to access all the required API Keys and authorization credentials. You should be able to find everything under the “Keys and Access Tokens” Tab for all the Twitter API Key details. After that, fill out all the app details.
- Make sure to add these keys into your .env file, skip to 'Setting up .env...' for more information
The easiest way to get started with MongoDB is to use Atlas, MongoDB’s fully-managed database-as-a-service.
- If you don’t have the MongoDB Node.js Driver installed, you can install it with the following command.
npm install mongodb
- Create a free MongoDB Atlas by going to https://www.mongodb.com/cloud/atlas
- Get your cluster’s connection info:
- In Atlas, navigate to your cluster and click CONNECT. The Cluster Connection Wizard will appear.
- The Wizard will prompt you to whitelist your current IP address and create a MongoDB user if you haven’t already done so.
- Be sure to note NOTE the USERNAME and PASSWORD you use for the new MongoDB user as you’ll need them in a later step.
- Wizard will prompt you to choose a connection method. Select Connect Your Application.
- When the Wizard prompts you to select your driver version, select Node.js and 3.0 or later. Copy the provided connection string.
- Create a .env file
$ touch .env
- Enter these key variables and fill in with youre secret/api keys
NFL_API_TOKEN
MONGODB_URI
TWITTER_API_KEY
TWITTER_API_SECRET
TWITTER_ACCESS_TOKEN
TWITTER_ACCESS_TOKEN_SECRET
- Sign up for heroku at heroku.com
- Install heroku by running npm install -g heroku
- Go through the following steps: heroku login -i heroku create git push heroku master
- Navigate to your newly-created heroku site!
- Add your secret/API keys under settings in heroku (keys from sportsdata.io and mongodb.com) by going to https://sportsdata.io/members/subscriptions, by going to https://dashboard.heroku.com/apps and clicking into your app. Click on Settings, then scroll to "Config Vars." Click Reveal Config Vars" and add the key value pairs for each variable. Your config var key names should be:
NFL_API_TOKEN
MONGODB_URI
TWITTER_API_KEY
TWITTER_API_SECRET
TWITTER_ACCESS_TOKEN
TWITTER_ACCESS_TOKEN_SECRET
- Configure requirements.txt with all requirements needed to run your app.
- Configure Procfile with the command needed to run your app.
- If you are still having issues, you may use heroku logs --tail to see what's wrong.
- Navigate to https://circleci.com/signup/ and Sign up with Github
- Authorize CircleCI.
- Make sure you're in the right repo in the top right hand corner
- Once you've verified that, click "Set Up Project"
- Confirm that the language is set to Javascript and click "Add Config"
- CircleCI might ask if you want to see the new UI. If it does, click "yes" and it should redirect you.
- All you need to do to deploy to Heroku from CircleCI is to configure your Heroku credentials in circleCI UI, add a simple config.yml file to the project, and push.
- Jay Rana - [email protected]
- Steven Gardiner - [email protected]
- Vivek Sreenivasan - [email protected]
- Pedro Ramos - [email protected]
Project Link: https://github.com/stevegardiner26/famble