Coder Social home page Coder Social logo

kabupaten's Introduction

Kabupaten

The kabupaten application is an online resource for anyone interested in Indonesian regional development. Your assistance in developing this project is most welcome.

Getting Started

Ensure you switch to ruby 1.9.3.

– Install postgres ——————–

brew install postgresql ln -sfv /opt/boxen/homebrew/opt/postgresql/*.plist ~/Library/LaunchAgents launchctl load ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist # Note that the installation creates a postgres database # Initialise database, which creates a role for your username with superuser privileges initdb /opt/boxen/homebrew/var/postgres

When installing the postgres gem, including ARCHFLAGS is recommended:

ARCHFLAGS="-arch x86_64" gem install pg

To have launchd start postgresql at login:

ln -sfv /opt/boxen/homebrew/opt/postgresql/*.plist ~/Library/LaunchAgents

Then to load postgresql now:

launchctl load ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist

Or, if you don’t want/need launchctl, you can just run:

postgres -D /opt/boxen/homebrew/var/postgres

# Create a postgres user ‘root’ with create db privilege createuser -U your-user -d root

# To login to postgres psql postgres

– Setup repo and gems

git clone [email protected]:eddieridwan/kabupaten.git
cp config/database{.example,}.yml
cp config/app_config{.example,}.yml
bundle install

Set up the development database:

bundle exec rake db:create
bundle exec rake db:schema:load
bundle exec rake db:seed

Application Technical Background

We are currently using:

  • Rails 3.2

  • Ruby 1.9.3

The app uses subdomains to set the locale (no subdomain: English, ‘id’: Indonesian). To run the app locally, set the following in /etc/hosts:

127.0.0.1 id.kabupaten.local
127.0.0.1 kabupaten.local
127.0.0.1 www.kabupaten.local

In the browser, set the address to one of those local host names, eg

kabupaten.local:5000

Use foreman to run the app locally, to mimic heroku:

  • github.com/ddollar/foreman

    gem install foreman
    
  • set environment variables in the file .env

    cp .env{.example,}
  • put the following line in the file Procfile

    web: bundle exec rails server -p $PORT
  • foreman start (defaults to port 5000)

Notes:

Translations

Static translations are managed using the tolk gem. See github.com/tolk/tolk for usage details. The primary locale is :en. Add new translations to en.yml.

rake tolk:sync     # sync tolk database with en.yml

Then make edits using tolk. When finished, dump back to locale files:

rake tolk:dump_all

Locally, the url for the tolk UI is:

kabupaten.local:<port>/tolk

There is basic authentication for tolk. Username and password is in the .env file.

Deploy to heroku

Install heroku toolbelt (for deploying to heroku): toolbelt.heroku.com

  • Login to heroku

heroku login

heroku apps

  • Check info on existing app

heroku apps:info –app kabupaten

  • Add heroku git to git remote

git remote add heroku [email protected]:kabupaten.git

  • Show current app config variables (some of which would be replicated in .env for the dev environment)

heroku config

git push heroku master

kabupaten's People

Stargazers

 avatar  avatar  avatar Eddie Ridwan avatar

Watchers

Eddie Ridwan avatar

Forkers

ayes123

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.