Monday, September 26, 2016

Setting up NGINX as server for Ionic and reverse proxy for Rails on AWS

For Assignment 3, we implemented a RESTful application, Wishes (www.wishful.tk), with Ionic as front-end framework and Rails as back-end server. Regrading the deployment, there is very limited resource on how to setup Ionic and Rails with NGINX on Ubuntu and make them work together. After days of searching and a few trials, I come up with the following steps.

  1. Install NGINX on Ubuntu 14-04
    1. https://www.digitalocean.com/community/tutorials/how-to-install-nginx-on-ubuntu-14-04-lts
  2. Install letsencrypt to get CA certificate
    1. https://certbot.eff.org/#ubuntutrusty-nginx
  3. Update NGINX config to enable HTTPS connection
    1. https://certbot.eff.org/#ubuntutrusty-nginx
    2. http://nginx.org/en/docs/http/configuring_https_servers.html
  4. Setup Ionic
    1. http://ionicframework.com/docs/guide/installation.html
  5. Install git
    1. sudo apt-get install git
    2. sudo npm install gulp -g
  6. Clone frontend repo onto server
    1. git clone https://github.com/Wishes-CS3216/Wishes-Frontend.git
  7. Update NGINX configuration (located at /etc/nginx/sites-avaiable/default)
    1. http://nginx.org/en/docs/beginners_guide.html
    2. restar NGINX
  8. Setup Rails
    1. https://gorails.com/setup/ubuntu/14.10
  9. Clone backend repo
    1. git clone https://github.com/Wishes-CS3216/Wishes-Backend.git
  10. Update NGINX configuration
    1. https://www.digitalocean.com/community/tutorials/how-to-deploy-a-rails-app-with-puma-and-nginx-on-ubuntu-14-04 (We are using Puma here. Other alternatives are Passenger and Unicorn)
    2. git clone https://github.com/Wishes-CS3216/Wishes-Backend.git
    3. update Rails configurations if necessary (under repo/config/ folder)
    4. start Puma
    5. restart NGINX
Links to relevant resource are attached here. Hope it can be useful. If you are still confused about the detailed configurations please feel free to comment below. Cheers =)

Monday, September 19, 2016

Lessons learnt from pitches

1. The word "free" has magic power in attracting people. The experiment mentioned by Patrick was quite inspiring. I think the strategy could be applied for onboarding users.

2. People will be more willing to donate money / free stuff if they know that it is for charity purpose rather than for some random strangers. For assignment 3, our group is doing something related to help fulfilling other people's wishes. And one of our main concern is on how to activate users. I think maybe we can reconsider the project scope to add in element like "help local charity organisations". It indeed sounds more attractive and it is more likely to get support from the society.

3. "Don't find target users for your app; find app for your target users". There were two great examples mentioned that indicated such principle. The first one is the Show My Turban site and the second one is the marriage agency for Indian. During my past barnstorming I mainly focus on the pain in my personal life which made my ideas limited. In the future I will also consider the problems faced by people whose life I truly understand. For example. students and teachers in Chinese high schools and NUS, people living in my hometown, etc.. Since I have a deep insight on their lives I guess I am able to come up with something that will make their life better.

4. Users may not use the app as you planned. I personally doesn't believe that the "anonymous Facebook Message“ idea will be successful. Similar functionality was implemented by Tecent QQ a few years ago and the feedback was quite negative since people felt offended and annoyed by mischief. The idea failed mainly because user didn't use the app as expected. I think it is important to think about all use cases for an app during brainstorming to ensure that all of them doesn't contradict with the main purpose of the app. But the good thing is that if one of the use cases contradict with the original ideas and it sounds fun we may create an app for that as well ><

Monday, September 12, 2016

Reflection on Assignment 1

Assignment 1 is over but there are still lessons can be learnt through reflection. What can we have done better?

First of all, we should have cared about security from the very beginning. Two of us were taking CS3235 but yet we put security as our last concern. Not a good practice at all. Choosing a framework that implements more secure features can be a good start. Securing database access by avoiding raw query can be useful. We should have validated user input as well and we should did it when we still have enough time. I guess Quan Yang must feel quite boring hacking our website - "No challenge."

Second, when we split into two groups each focusing on a component of the website, it is important to know what the other group is doing and will the integration work in the end. In our case we implemented Student page and Company page separately but later we found that there was logic flow missing. It was not only the project manager's duty to see the big picture of the website.

Last but not least, since finishing the write-up is so much pain, it is better to answering each milestone once we finished it.