7 languages in 7 days - Instructions

You can read the article here. Below you'll find the github links and relevant instructions for each implementation of Granny's Address book.

Skip to your favorite language


Language: Scala


Repository: https://github.com/osintegrators/ScalaGranny
Developer: Michael Brush
Instructions

  1. Install the Postgres database software if it is not installed
    a. sudo apt-get install postegresql
  2. Start the postgresql instance
    a. sudo service postgresql start
  3. Create a new schema for the granny application. There is no need to create the tables, just the schema.
    a. sudo su postgres - To log in as the postgres user.
    b. createdb granny - To create the schema
    c. exit - To go back to being the user you are logged in as.
    d. sudo passwd postgres - and change the password to postgres. This is what the application is expecting. If you choose to use something different it can be changed in application.conf.
  4. Install Play - Official instructions can be found here
    To run Play, you need JDK 6 or later. (Check here for instructions if you do not have this)
    a. Download the Play binary here (I used version 2.10)
    b. Unzip it into the folder of your choice.
    c. Include the play executable in your path in order to allow it to be used
    from the command line
    i. cd /usr/bin
    ii. sudo ln -s /play/installation/dir/play
    d. To verify play is working. Type play help. You should get a play screen
  5. Download the code here. (There is a zip button towards the top left of the screen
  6. Change directory to the directory that you would like the code to reside and unzip the code
    a. unzip ~/Downloads/ScalaGranny-master.zip
  7. Run the program
    a. cd ScalaGranny-master
    b. play run
  8. Go to a browser and type http://localhost:9000 to get to the site. If all is successful, you will get a screen prompting you to Apply a script to the database. Run this script and the application is now up and running.

Langauge: Go


Repository: https://github.com/osintegrators/GoGranny
Developer: Brian Crucitti
Instructions

  1. Requirements for Installation
    • Linux OS or bash capable shell
    • Linux packages: golang-go, git , mysql, mysql-server
  2. Installation Instructions
    • If you have all required Linux packages, you can skip to step 7.
    • In Linux terminal, enter 'sudo apt-get install git
    • In Linux terminal, enter 'sudo apt-get install golang-go
    • In Linux terminal, enter go get "github.com/Go-SQL-Driver/MySQL"
    • In Linux terminal, enter 'sudo apt-get install mysql'
    • In Linux terminal, enter 'sudo apt-get install mysql-server'
    • When prompted to create a password, make one or leave it blank
    • Navigate to the GoGranny directory.
    • Run './install_local.sh', entering the required information at the prompt.
    • In Linux terminal, enter 'go run ./granny.go"
    • Open a browser to 'http://localhost:8080' to test the site.

Langauge: Ruby


Repository: https://github.com/osintegrators/RubyGranny
Developer: Brian Crucitti
Instructions

  1. Requirements for Installation
    • Linux OS or bash capable shell
    • Linux packages: ruby1.9.3 or later, rails
  2. Installation Instructions
    • If you have all required Linux packages, you can skip to step 4.
    • In Linux terminal, enter 'sudo apt-get install ruby1.9.3’
    • In Linux terminal, enter 'sudo apt-get install rails’
    • Navigate to RubyGranny.
    • In Linux terminal, enter 'rails s’
    • Open a browser to 'http://localhost:3000' to test the site.

Langauge: Kotlin


Repository: https://github.com/osintegrators/kotlinGranny
Developer: Lifford Pinto
Instructions

  1. Database instruction
    • Install PostgreSQL
    • Create database
      > sudo su postgres
      > createdb -T template0 kotlingranny
    • Create user
      > psql
      # CREATE USER kotlingranny;
      # ALTER USER drupaldbuser PASSWORD 'kotlingranny';
      # GRANT ALL ON DATABASE kotlingranny TO kotlingranny;
      # \q
    • Log in to database and create table
      > psql -U kotlingranny kotlingranny
      # create table foo (id int primary key, name varchar(100), address varchar(100), phone varchar(100), email varchar(100))");
  2. Application Instructions

Langauge: JavaScript


Repository: https://github.com/osintegrators/JSGranny
Developer: Deep Mistry
Instructions

  • Requirements
    1. Download Webstorm here
    2. Install node.js and npm with
      sudo apt-get install nodejs npm
    3. Install git
      sudo apt-get install git
  • Install the database.
     sudo apt-get install postgresql-9.1
  • make a user called postgres and Start the postgresql server. Documentation regarding this can be found here
  • Create a database called granny by following command
     CREATE DATABASE granny;
  • Create a user/role called granny by following command
     CREATE USER granny WITH password 'granny';
  • Grant all privileges to the granny user/role by following command
     GRANT ALL PRIVILEGES ON DATABASE granny to granny; 
  • Create a table by the following command
     CREATE TABLE phonebook(_id SERIAL PRIMARY KEY, name VARCHAR(32), address VARCHAR(64), phone VARCHAR(32), email VARCHAR(32));
     
  • Get project into Webstorm
    1. To open WebStorm, cd into the bin dir and execute
       sudo ./webstorm.sh 
    2. Alternatively, you can just checkout directly into the IDE from Github. ( Of course you need git and the plugin installed for this. See this for help )
    3. Simply Press Run at the top ( You may need to specify app.js path on the system)
    4. At this point your server should be running on http://localhost:3000/
    5. Browse to that url in any browser.
  • Without using Webstorm
    1. check out the application via command line
      git clone https://github.com/osintegrators/JSGranny.git
    2. after you checkout the project from command line. You can simply execute the command to get it to run.
       node app.js 

Language: Java

Repository: https://github.com/osintegrators/JavaSpringGranny
Developer: Mark Pettit
Instructions
  1. Install the database.
    • NOTE: You may need to setup trusted authentication for localhost. This is done by editing the [pg_hba.conf](http://www.postgresql.org/docs/devel/static/auth-pg-hba-conf.html) file.
       sudo apt-get install postgresql-9.1
    • make a user called postgres and Start the postgresql server. Documentation regarding this can be found here
    • Create a database called granny by following command
       CREATE DATABASE granny;
    • Create a user/role called granny by following command
       CREATE USER granny WITH password 'granny';
    • Grant all privileges to the granny user/role by following command
       GRANT ALL PRIVILEGES ON DATABASE granny to granny; 
  2. Checkout Project from git
  3. Build
    • Perform a Project -> Clean
    • 5. Right click on the pom.xml and do a Maven -> clean, and a Maven -> install.
    • Right click on Project and Run As -> Run On server.
    • You might need to create a new server environment.
  4. Run
    • This project can be deployed on any of the following

      Tomcat

      vFabric tcServer

      JBoss Application Server
    • After you create a server, Deploy the project on the server.
    • Note: If your IDE does not have the facility to run on an server from within, you can do a mvn package from the command line and deploy the .war file directly on an external server
    • Browse to http://localhost:8080/JavaSpringGranny/


Langauge: Clojure

Repository: https://github.com/osintegrators/clojuregranny
Developer: Shameem Ali
Instructions

  1. Install postgres
  2. Start the postgres instance
  3. Create database, table schema, user and grant privileges on the table to the created user
    • CREATE USER clojureuser;
    • ALTER USER clojureuser PASSWORD 'password'
    • CREATE database grannyclojure;
    • Grant ALL on grannyclojure to clojureuser;
    • Login to database as the user : psql -U clojureuser grannyclojure
    • CREATE TABLE granny(id INT PRIMARY KEY, name varchar(100), email varchar(100), phone varchar(100), email varchar(100));
  4. Install Leiningen
  5. cd into the project directory
  6. Run the application
  7. lein ring server

Comments

Post new comment

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options

CAPTCHA
Are you for real?
Image CAPTCHA
Enter the characters shown in the image.