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.
- http://webuild.sg/api/repos
- http://webuild.sg/api/events
- http://webuild.sg/api/podcasts
http://webuild.sg/api/check/:checkdate
wherecheckdate
is in the formatDD-MM-YYYY
to check for clashed events withcheckdate
#Install for development
Chose either one of the 2 ways:
##1. Nitrous.IO / Your Host
-
Clone this repo either with Nitrous.IO or in your local machine.
-
Use Nitrous.IO to create your own We Build in seconds:
-
Clone the app:
git clone git@github.com:webuildsg/webuild.git cd webuild
-
-
Setup the necessary environment variables. Refer Environment Variables section for more details.
cp .env-example .env
-
Install required packages with npm and RubyGems.
gem install sass compass npm install -g bower npm install -g grunt-cli npm install bower install
-
Build frontend css and javascript files, along with other tasks with grunt
grunt
-
Run in command line
./run.sh
to start the app. -
Open localhost:4000 in your browser.
-
Run the following command in another terminal to update events and repos:
./update.sh
##2. Using Docker
-
Clone this repo
git clone git@github.com:webuildsg/webuild.git cd webuild
-
Setup the necessary environment variables. Refer Environment Variables section for more details.
cp .env-example .env
-
Build with Docker
docker build -t webuild .
-
run docker with port mapping
docker run -i -t -p 4000:4000 webuild
-
Open
<DOCKER_HOST>:4000
in your host browser e.g.http://localhost:4000/
-
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:
-
Install Heroku command line
-
Create new Heroku app for NodeJS
-
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
-
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
###Events
- Meetup and Facebook events in Singapore are automatically populated.
- White list events: To add additional events, edit
events/whitelistEvents.json
. - Black list events: To remove a specific events (paid / duplicate), get the event
id
from http://webuild.sg/api/events endpoint and editevents/blacklistEvents.json
.
###Repos
- Github repos from user's location Singapore are automatically populated.
- Repos with more than 200 watchers and pushed date less than 3 months ago are selected.
- White list users: To add additional users, edit
repos/whitelistUsers.json
.
#Customise for any location
Events
/events/config.js
- basic config for automatically fetching Meetup events/events/facebookGroups.json
- list of facebook groups you want to automatically query to fetch their upcoming events/events/blacklistEvents.json
- events you might want to remove based on the eventid
found in the api endpoint/api/events
/events/whitelistEvents.json
- manually add in an event not fetched automatically
Repos
/repos/config.js
- basic config for automatically fetching Github repositories/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.