Coder Social home page Coder Social logo

karkranikhil / trailhead-leaderboard Goto Github PK

View Code? Open in Web Editor NEW

This project forked from gidich/trailhead-leaderboard

0.0 1.0 0.0 106 KB

Simple Node.js App for Maintaining a Leaderboard for a team learning Saleforce using Trialhead

Home Page: https://sample-trailhead-leaderboard.herokuapp.com/

License: MIT License

JavaScript 73.28% HTML 26.72%

trailhead-leaderboard's Introduction

Salesforce Trailhead Leaderboard

About:

This is a simple application to help gain adoption of trailhead by allowing your team to see stats in the same manner as a gaming leaderboard.

Demo URL:

https://sample-trailhead-leaderboard.herokuapp.com/

This entire application can run for free on Heroku.

Quickstart:

  1. Click the Deploy to Heroku button

    Deploy

    • For App Name, specify a name for your application. For example, if you specify sample-trailhead-leaderboard, your application will be available at http://sample-trailhead-leaderboard.herokuapp.com. Your app name has to be unique on the herokuapp.com domain.
    • Click the Deploy App button
  2. Configure the schedule: (this keeps the leaderboard up to date daily)

    • Navigate to the heroku dashboard https://dashboard.heroku.com/apps and select your app.
    • Choose Resources > Heroku Scheduler (a new browser tab will appear)
    • Click Create Job (the Job Editor side panel will display)
    • In the Schedule area, choose Every day at... and 1:00 PM UTC
    • In the Run Command area next to the dollar sign ($), type in node scheduled-refresh.js
    • Click Save Job

Contributing:

Pull Requests are Welcome!

Additional Details, how to run locally

It is good to follow Heroku's node.js tutorial to get an understanding of how node.js works on Heroku and to configure your local environment.

Grab a copy of the code

You'll want to create your own .env file with the MongoDB URI in it:

MONGODB_URI=mongodb://<<username>>:<<password>>@<<your instance>>.mlab.com:<<port number>>/<<your instance>>

Run npm install in the directory you've downloaded

There is a launch.json file part of the project to make it easy to debug with VSCode, run in VS code and look at the Debug Console to see what port it is running at (typically 5000) open your web browser to http://localhost:5000 and view it locally.

Troubleshooting Helpful notes:

Error Logs

To view error logs:

heroku logs --tail -a <<appname>>

Kill Local Instance

To kill the local development environment:

Sometimes the local heroku development enviornment may die in the background, this stackoverflow tip was helpful:

Lists all processes on port 5000:

lsof -i :5000 

Find the PID and then kill the process with this command:

sudo kill -9 <<pid>>

Best Performance

For best performance, ensure that the app is running in production mode (it should be already by default):

heroku config:set NODE_ENV=production -a <<your app aname>>

Special thanks to the following tools and utilities:

The puppeteer buildpack used to scrape trailhead profiles:

heroku buildpacks:set jontewks/puppeteer

Node JS:

heroku buildpacks:set heroku/nodejs

Additional Addons:

DeepScan grade

trailhead-leaderboard's People

Contributors

gidich avatar

Watchers

James Cloos avatar

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.