/webuild

Handpicked list of open events and open source for makers, designers and developers

Primary LanguageJavaScriptMIT LicenseMIT

Dependency Status

Build Status

We Build SG automatically curates a list of free public events (Facebook / Meetup / manual) and open source projects (Github / manual) for the curious folks who love to make things in a particular city. This repository is an example for Singapore.

###Please feel free to fork this for your choice of city/country too 😄

Who are we? We are techies - developers, designers, programmers, hackers or makers. And we want to connect various techies to come together and connect:

  • veteran techies to get introduced to the community of open events and open source
  • wannabe techies to get examples of great open source projects and events to meet mentors
  • traveling techies to drop by and connect with the local ones
  • existing techies to keep connecting, mentoring and growing the open community

Open Events are free events that are open for public and anyone can drop by.

Open Source are projects with free licenses.

#Websites

#API

The events, repositories and podcasts data feeds are available as JSON.

#Install for development

Chose either one of the 2 ways:

##1. Nitrous.IO / Your Host

  1. Clone this repo either with Nitrous.IO or in your local machine.

    1. Use Nitrous.IO to create your own We Build in seconds:

      Hack webuildsg/webuild on Nitrous.IO

    2. Clone the app:

      git clone git@github.com:webuildsg/webuild.git
      cd webuild
      
  2. Setup the necessary environment variables. Refer Environment Variables section for more details.

    cp .env-example .env
    
  3. Install required packages with npm and RubyGems.

    gem install sass compass
    npm install -g bower
    npm install -g grunt-cli
    npm install
    bower install
    
  4. Build frontend css and javascript files, along with other tasks with grunt

    grunt
    
  5. Run in command line ./run.sh to start the app.

  6. Open localhost:4000 in your browser.

  7. Run the following command in another terminal to update events and repos:

    ./update.sh
    

##2. Using Docker

  1. Clone this repo

    git clone git@github.com:webuildsg/webuild.git
    cd webuild
    
  2. Setup the necessary environment variables. Refer Environment Variables section for more details.

    cp .env-example .env
    
  3. Build with Docker

    docker build -t webuild .
    
  4. run docker with port mapping

    docker run -i -t -p 4000:4000 webuild
    
  5. Open <DOCKER_HOST>:4000 in your host browser e.g. http://localhost:4000/

  6. Run the following command in another terminal to update events and repos:

    ./update.sh
    

#Deploy to production

We used Heroku - thank you! These are the steps we took to deploy:

  1. Install Heroku command line

  2. Create new Heroku app for NodeJS

  3. Setup the following environment variables under the Heroku app settings:

    GITHUB_CLIENT_ID
    GITHUB_CLIENT_SECRET
    MEETUP_API_KEY
    PATH
    WEBUILD_API_SECRET
    WEBUILD_AUTH0_CLIENT_ID
    WEBUILD_AUTH0_CLIENT_SECRET
    
  4. Get Heroku Scheduler add on and add 2 tasks with an hourly frequency:

    • update events every hour

       curl -X POST --data "secret=<WEBUILD_API_SECRET>" <your_production_url>/api/events/update
      
    • update repos every hour

       curl -X POST --data "secret=<WEBUILD_API_SECRET>" <your_production_url>/api/repos/update
      

#Environment variables

Set the following environment variables on your system:

  • WEBUILD_API_SECRET (required) Used as a password when remotely refreshing the feeds.
  • MEETUP_API_KEY (required) Used to list available meetup events in Singapore.
  • WEBUILD_AUTH0_CLIENT_ID (required): Used to retrive facebook events in Singapore. Auth0 takes care of OAuth2 social logins.
  • WEBUILD_AUTH0_CLIENT_SECRET (required): Same as above.
  • PORT (optional, default: 4000) Configures the port used by the web server.
  • LOCATION (optional, default: Singapore) The GitHub feed shows only repositories owned by developers in this area. Matches the GitHub "Location" property in user profiles.
  • MAX_USERS (optional, default: 1000) Show only repositories belonging to developers in this ranking. Only the last updated repository of a user is shown.
  • MAX_REPOS (optional, default: 50) Show up to this many total repositories.
  • GITHUB_CLIENT_ID (optional) App OAuth client ID for GitHub.
  • GITHUB_CLIENT_SECRET (optional) App OAuth client secret for GitHub.

Use an external "web cron" service to periodically refresh the GitHub data feed. Keep in mind that due to GitHub API rate limiting it may take >15 minutes to retrieve the entire feed. Register a GitHub OAuth application and configure the GITHUB_CLIENT_* environment variables (see above) to increase the rate limit. Do not refresh the feed too often or the rate limit will cause it to take longer.

Create an Auth0 account (you get one free app) and a Facebook app and link them with these instructions. Configure the WEBUILD_AUTH0_CLIENT_* environment variables (see above) and add your callback url in auth0. Run the app and if all is configured well, add your fb aceess token by logging in at <localhost>/admin

###Newrelic

If you are integrating Newrelic for analytics, the following environment variables are required:

  • NEW_RELIC_APDEX (required, default: 0.010)
  • NEW_RELIC_APP_NAME (required): Use the Heroku app name
  • NEW_RELIC_LICENSE_KEY (required): Newrelic license key will be given upon creating a new application

Editing events and repos list

###Events

  1. Meetup and Facebook events in Singapore are automatically populated.
  2. White list events: To add additional events, edit events/whitelistEvents.json.
  3. Black list events: To remove a specific events (paid / duplicate), get the event id from http://webuild.sg/api/events endpoint and edit events/blacklistEvents.json.

###Repos

  1. Github repos from user's location Singapore are automatically populated.
  2. Repos with more than 200 watchers and pushed date less than 3 months ago are selected.
  3. White list users: To add additional users, edit repos/whitelistUsers.json.

#Customise for any location

Events

  1. /events/config.js - basic config for automatically fetching Meetup events
  2. /events/facebookGroups.json - list of facebook groups you want to automatically query to fetch their upcoming events
  3. /events/blacklistEvents.json - events you might want to remove based on the event id found in the api endpoint /api/events
  4. /events/whitelistEvents.json - manually add in an event not fetched automatically

Repos

  1. /repos/config.js - basic config for automatically fetching Github repositories
  2. /repos/whitelistUsers.json - manually add in usernames from Github if they are not included in the automatic query

#Contribute

Please see CONTRIBUTING.md for details.

#Versioning

Every production code has a version following the Semantic Versioning guidelines. Run the grunt bump command to bump the version accordingly and then push to production with git push production master.

#License

We Build is released under the MIT License.