SlideShare ist ein Scribd-Unternehmen logo
1 von 42
Agenda
1. Introduction to the Program
2. Basic Web Applications Concept
3. Web Development Concepts
4. Introduction to Ruby on Rails
5. Before Coding: Planning your application
6. Live Demo (Todo List)
7. Team Formation, networking and planning your own web
application
8. Moving ahead (and logistics)
INTRODUCTION TO THE PROGRAM
About the Program
This is a non-profit program that hope to build a community of
people who are interested in learning coding. We use Ruby on
Rails as the medium.
Learning to code alone is tough. So we will do it together.
Goal for you
At the end of the program, you will learn how to build a web application of
easy to moderate difficulty.
Vision for This Program
A sustainable initiative in encouraging beginners to learn how to
code. The first batch will contribute and work on a useful and
real-life projects which will help fund this initiative.
Example:
• A functioning web application where users are willing to pay.
We will use the funds to fund continue this initiative.
• Startup idea that is born out of this project
• Participate in Hackathon (and hopefully a donation if you win)
Members can also help non-profit organisation to build web
applications.
What happen after the 6 months?
This program will continue for a period of 6 months. At the end
of 6 months, we may:
• Restart this program for new learners or those who want to
reinforce their learning
• Continue to explore more advanced Ruby on Rails concept
• Branch off into specific sub-groups (e.g. Using React on Rails,
Rails API, Optimisation, etc)
Other opportunities?
Blend 3 kinds of learning: Online, Offline and Peer
Online Learning
Peer Learning Classroom Learning
About Me
• Ng Thiam Hock
• Accounting / Finance trained
• Work in tax and banking for a few years
• Self-learn web development skills
• Won IRAS Hackathon in 2016
• Went on to develop a TinkerTax – a cloud-based Singapore
corporate tax web application
About Your Team Projects
• Group of no more than 5
• Individual-Group Project
• Decide on the features and what to do as a team
• Code the project individually
Mindset
• You will be frustrated. Do not seek to understand 100%. What's
important is to move on. You will understand them better later. I
promise.
• Google and StackOverflow is your best friend. The documentation is
like your bible. Always consult them. Finding the answers yourself is
always the best way to learn.
• You can also share your findings or what you have learnt in writing. I
will publish it in our medium publication, under your name.
• Do not reinvent the wheel. If something that has been done before,
use it.
At the end of today…
Overwhelmed
Frustrated
Confused
Excited to start
WEB APPLICATION CONCEPTS
How websites and web applications work?
Browser
Server
Database
Domain Name Server (DNS)
URL
IP Address
Request
HTML/CSS/JS
Request Data
Data
Frontend and Backend Development
Browser
Server
Database
Request
HTML/CSS/JS
Request Data
Data
Front End Development Back End Development
Type of HTTP Requests
• GET
• POST
• PATCH/PUT
• DELETE
Database Structure
• 2 main types of database: Relational databases and NoSQL
• We will focus more on relational databases
• Think of database as a collection of tables with relationships
between those tables
• You need to define what table to create in the database, the
columns these tables should have, and the relationships
between them.
Database Structure: Example
WEB DEVELOPMENT CONCEPTS
Model-View-Controller (MVC)
• Model: Handle business logic, request data from database and
send data to controller.
• Controller: Decides what data to get, and which view to
render.
• View: What the user is going to see
Controller is like the middleman. Like an insurance agent. Client
(browser) ask for a quote. Agent (controller) go to the insurance
company (model) to request the quote. The insurance company
will then calculate the risks, then give the agent a quote (view),
which is then passed back to the client.
Model-View-Controller
Controller
View
Modelrequest
Processed Data
Raw Data
Processed
Data
Response
(html)
Database
Test-Driven Development
TDD
Red
GreenRefactor
1. Write a
failing test
2. Write the
code to pass
the test
3. Refactor your
code if necessary,
and run all the
tests again
INTRO TO RUBY ON RAILS
How Rails Applications work?
Controller
View
Model
request
Data
DataData
Response
(html)
Database
Routes
Rails File System
app/
assets (images, stylesheets, javascripts)/
controllers/
models/
views/
Others (helpers, mailers, jobs)
config/
initializers/
routes.rb
database.yml
db
migrate/
schema.rb
seeds.rb
Rails File System (Continued)
spec
MVC folders
requests/
features/
support/
spec_helper.rb / rails_helper.rb
Gemfile
README.md
Ruby Gems
• Gems are extensions / plugins / libraries
• You can implement common features using gems rather than
writing the code from scratch
• Common features include:
– User Authentication / Authorisation
– Import/Export from Excel / PDF
– Images/File uploading
• Manage the gems in the application using the Gemfile
LIVE DEMO
Steps in Planning an Application
1. Decide on the user stories
2. Plan database structure
3. Data Type, conditions and constraints
4. Application structure (more relevant for bigger projects)
5. Logic of the application (more relevant for complex projects)
User Stories for Todo List App
• As a user, I should be able to see the home page
• As a user, I should be able to view all my Todo lists
• As a user, I should be able to create Todo list
• As a user, I should be able to delete my Todo list
• As a user, I should be able to edit the name of the Todo list
• As a user, I should be able to view all my Todo list items in my
Todo list
• As a user, I should be able to delete a Todo list item
• As a user, I should be able to mark a Todo list item as done
Database Structure for Todo List App
Steps in Developing an Application
1. Based on the user story, write the relevant integration test
2. Write the routes
3. Generate the controller (rails generate controller)
4. Write requests / controller test if necessary
5. Write the controller code
6. Create and write a basic view file
7. Generate the model (rails generate model) and migrate DB
if necessary
8. Write model validation tests / Define factory file
9. Write model validation code
10. Fix your view or model if need be to pass the test
Steps in Developing an Application (Continued)
11. If you need additional business logic, work out the
computations and flow first
12. Then write the model test for the logic
13. Beautify your view
14. Refactor your code if need be
15. Run the all the test again to ensure no test is failing
Saving and Deploying Your Work
• Create a Github account
• Create a Heroku account
TEAM FORMATION, NETWORKING
AND DISCUSSIONS
Team Formation Structure
• No more than 5 persons per team
• List of project ideas:
– Job Board
– Project Management
– Customer Relationship Management
– Property listing (counter property guru)
– Marketplace (like Lazada, Qoo10, Amazon) – can start off from a
simple eCommerce site first
– Expense tracker
– Clones (Airbnb, Twitter, Facebook, LinkedIn, Instagram)
When Planning Your Project…
• Think of the simplest features that you want to do so that you
do not overwhelm yourself. These features will make it
minimally useful.
• For example, for 2 sided users, just think from the perspective
of one user. Complete the features for such user. Then plan
from another perspective.
• You have not learnt authentication. Do visit Devise on how to
implement it. I will write a guide on how to implement Devise
soon.
• If your application requires you to upload photos, you can just
plan it into your user stories first. I will find some resources
which you can use.
MOVING AHEAD
Future Meetups
1 meetup per month. Each meetup will consists of 3 portions:
• Clarification of things based on previous session and projects
• Sharing of Rails concepts, external speakers (maybe?) or
sharing by one of the participants.
• Coding your project onsite with your project teammates help
The whole meetup will take 3 to 3.5 hours.
Beyond Physical Meetups
• Webinars
• Guides in Medium Publications
Communication Channels
Discord Server for informal chat (Please message me for the invitation
link) – I am still thinking whether to continue using this.
Facebook Group: For better organization of discussions, sharing of
articles and resources.
(https://www.facebook.com/groups/learnrailssg/)
Medium Publication: Main publication of this learning group. Most
resources will be there.
(https://medium.com/singapore-rails-learning-group)
Slack/Whatsapp: For internal team communication
Asking for Help
If you do not know what to do, let us know (Discord or Facebook)
• what is your user story,
• which step in the development process are you at, and
• what have you done so far for that user story?
If you encounter error, show us the code that you got the error,
what do you expect, and what do you get (including the error
message, if any).
Always google your issues first. Most of the time you will get
your answers.
Volunteers
• Designer: To design the banner, logo and icon of this learning
group
• Logistics: Co-organize the logistics
• Curriculum
• Facilitator (with coding knowledge)

Weitere ähnliche Inhalte

Ähnlich wie Learning Web Development with Ruby on Rails Launch

Dev Learn Handout - Session 604
Dev Learn Handout - Session 604Dev Learn Handout - Session 604
Dev Learn Handout - Session 604Chad Udell
 
System design for Web Application
System design for Web ApplicationSystem design for Web Application
System design for Web ApplicationMichael Choi
 
Agile_SDLC_Node.js@Paypal_ppt
Agile_SDLC_Node.js@Paypal_pptAgile_SDLC_Node.js@Paypal_ppt
Agile_SDLC_Node.js@Paypal_pptHitesh Kumar
 
Search and navigation in Visual Studio
Search and navigation in Visual StudioSearch and navigation in Visual Studio
Search and navigation in Visual StudioDavid Shepherd
 
Ruby on Rails Plugins - Rich Collins
Ruby on Rails Plugins - Rich CollinsRuby on Rails Plugins - Rich Collins
Ruby on Rails Plugins - Rich CollinsRich Collins
 
scraplr presentation
scraplr presentationscraplr presentation
scraplr presentationanggikrisna
 
Near east university
Near east universityNear east university
Near east universityDerrickDusabe
 
The more information Website Design_New.pdf
The more information Website Design_New.pdfThe more information Website Design_New.pdf
The more information Website Design_New.pdfssuser088e5b
 
Neil Perlin - We're Going Mobile! Great! Are We Ready?
Neil Perlin - We're Going Mobile! Great! Are We Ready?Neil Perlin - We're Going Mobile! Great! Are We Ready?
Neil Perlin - We're Going Mobile! Great! Are We Ready?LavaConConference
 
Cloud Academy Webinar: Recipe for DevOps Success: Capital One Style
Cloud Academy Webinar: Recipe for DevOps Success: Capital One StyleCloud Academy Webinar: Recipe for DevOps Success: Capital One Style
Cloud Academy Webinar: Recipe for DevOps Success: Capital One StyleMark Andersen
 
Noman Khan Internship Report 2.pptx
Noman Khan Internship Report 2.pptxNoman Khan Internship Report 2.pptx
Noman Khan Internship Report 2.pptxNomanKhan869872
 
The 6k startup - How to Launch a Startup on a Budget
The 6k startup - How to Launch a Startup on a BudgetThe 6k startup - How to Launch a Startup on a Budget
The 6k startup - How to Launch a Startup on a BudgetCrystal Taggart
 
30 Skills to Master to Become a Senior Software Engineer
30 Skills to Master to Become a Senior Software Engineer30 Skills to Master to Become a Senior Software Engineer
30 Skills to Master to Become a Senior Software EngineerSean Coates
 
The Guide to becoming a full stack developer in 2018
The Guide to becoming a full stack developer in 2018The Guide to becoming a full stack developer in 2018
The Guide to becoming a full stack developer in 2018Amit Ashwini
 
Introduction to GraphQL (or How I Learned to Stop Worrying about REST APIs)
Introduction to GraphQL (or How I Learned to Stop Worrying about REST APIs)Introduction to GraphQL (or How I Learned to Stop Worrying about REST APIs)
Introduction to GraphQL (or How I Learned to Stop Worrying about REST APIs)Hafiz Ismail
 

Ähnlich wie Learning Web Development with Ruby on Rails Launch (20)

Dev Learn Handout - Session 604
Dev Learn Handout - Session 604Dev Learn Handout - Session 604
Dev Learn Handout - Session 604
 
System design for Web Application
System design for Web ApplicationSystem design for Web Application
System design for Web Application
 
Agile_SDLC_Node.js@Paypal_ppt
Agile_SDLC_Node.js@Paypal_pptAgile_SDLC_Node.js@Paypal_ppt
Agile_SDLC_Node.js@Paypal_ppt
 
Maruti gollapudi cv
Maruti gollapudi cvMaruti gollapudi cv
Maruti gollapudi cv
 
Search and navigation in Visual Studio
Search and navigation in Visual StudioSearch and navigation in Visual Studio
Search and navigation in Visual Studio
 
Ruby on Rails Plugins - Rich Collins
Ruby on Rails Plugins - Rich CollinsRuby on Rails Plugins - Rich Collins
Ruby on Rails Plugins - Rich Collins
 
scraplr presentation
scraplr presentationscraplr presentation
scraplr presentation
 
Near east university
Near east universityNear east university
Near east university
 
The more information Website Design_New.pdf
The more information Website Design_New.pdfThe more information Website Design_New.pdf
The more information Website Design_New.pdf
 
Neil Perlin - We're Going Mobile! Great! Are We Ready?
Neil Perlin - We're Going Mobile! Great! Are We Ready?Neil Perlin - We're Going Mobile! Great! Are We Ready?
Neil Perlin - We're Going Mobile! Great! Are We Ready?
 
Cloud Academy Webinar: Recipe for DevOps Success: Capital One Style
Cloud Academy Webinar: Recipe for DevOps Success: Capital One StyleCloud Academy Webinar: Recipe for DevOps Success: Capital One Style
Cloud Academy Webinar: Recipe for DevOps Success: Capital One Style
 
Noman Khan Internship Report 2.pptx
Noman Khan Internship Report 2.pptxNoman Khan Internship Report 2.pptx
Noman Khan Internship Report 2.pptx
 
Exploring My Career: an Exclusive Interview EN
Exploring My Career: an Exclusive Interview ENExploring My Career: an Exclusive Interview EN
Exploring My Career: an Exclusive Interview EN
 
The 6k startup - How to Launch a Startup on a Budget
The 6k startup - How to Launch a Startup on a BudgetThe 6k startup - How to Launch a Startup on a Budget
The 6k startup - How to Launch a Startup on a Budget
 
30 Skills to Master to Become a Senior Software Engineer
30 Skills to Master to Become a Senior Software Engineer30 Skills to Master to Become a Senior Software Engineer
30 Skills to Master to Become a Senior Software Engineer
 
The Guide to becoming a full stack developer in 2018
The Guide to becoming a full stack developer in 2018The Guide to becoming a full stack developer in 2018
The Guide to becoming a full stack developer in 2018
 
Session slides
Session slidesSession slides
Session slides
 
Session slides
Session slidesSession slides
Session slides
 
Session slides
Session slidesSession slides
Session slides
 
Introduction to GraphQL (or How I Learned to Stop Worrying about REST APIs)
Introduction to GraphQL (or How I Learned to Stop Worrying about REST APIs)Introduction to GraphQL (or How I Learned to Stop Worrying about REST APIs)
Introduction to GraphQL (or How I Learned to Stop Worrying about REST APIs)
 

Kürzlich hochgeladen

The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 

Kürzlich hochgeladen (20)

DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 

Learning Web Development with Ruby on Rails Launch

  • 1.
  • 2. Agenda 1. Introduction to the Program 2. Basic Web Applications Concept 3. Web Development Concepts 4. Introduction to Ruby on Rails 5. Before Coding: Planning your application 6. Live Demo (Todo List) 7. Team Formation, networking and planning your own web application 8. Moving ahead (and logistics)
  • 4. About the Program This is a non-profit program that hope to build a community of people who are interested in learning coding. We use Ruby on Rails as the medium. Learning to code alone is tough. So we will do it together. Goal for you At the end of the program, you will learn how to build a web application of easy to moderate difficulty.
  • 5. Vision for This Program A sustainable initiative in encouraging beginners to learn how to code. The first batch will contribute and work on a useful and real-life projects which will help fund this initiative. Example: • A functioning web application where users are willing to pay. We will use the funds to fund continue this initiative. • Startup idea that is born out of this project • Participate in Hackathon (and hopefully a donation if you win) Members can also help non-profit organisation to build web applications.
  • 6. What happen after the 6 months? This program will continue for a period of 6 months. At the end of 6 months, we may: • Restart this program for new learners or those who want to reinforce their learning • Continue to explore more advanced Ruby on Rails concept • Branch off into specific sub-groups (e.g. Using React on Rails, Rails API, Optimisation, etc) Other opportunities?
  • 7. Blend 3 kinds of learning: Online, Offline and Peer Online Learning Peer Learning Classroom Learning
  • 8. About Me • Ng Thiam Hock • Accounting / Finance trained • Work in tax and banking for a few years • Self-learn web development skills • Won IRAS Hackathon in 2016 • Went on to develop a TinkerTax – a cloud-based Singapore corporate tax web application
  • 9. About Your Team Projects • Group of no more than 5 • Individual-Group Project • Decide on the features and what to do as a team • Code the project individually
  • 10. Mindset • You will be frustrated. Do not seek to understand 100%. What's important is to move on. You will understand them better later. I promise. • Google and StackOverflow is your best friend. The documentation is like your bible. Always consult them. Finding the answers yourself is always the best way to learn. • You can also share your findings or what you have learnt in writing. I will publish it in our medium publication, under your name. • Do not reinvent the wheel. If something that has been done before, use it.
  • 11. At the end of today… Overwhelmed Frustrated Confused Excited to start
  • 13. How websites and web applications work? Browser Server Database Domain Name Server (DNS) URL IP Address Request HTML/CSS/JS Request Data Data
  • 14. Frontend and Backend Development Browser Server Database Request HTML/CSS/JS Request Data Data Front End Development Back End Development
  • 15. Type of HTTP Requests • GET • POST • PATCH/PUT • DELETE
  • 16. Database Structure • 2 main types of database: Relational databases and NoSQL • We will focus more on relational databases • Think of database as a collection of tables with relationships between those tables • You need to define what table to create in the database, the columns these tables should have, and the relationships between them.
  • 19. Model-View-Controller (MVC) • Model: Handle business logic, request data from database and send data to controller. • Controller: Decides what data to get, and which view to render. • View: What the user is going to see Controller is like the middleman. Like an insurance agent. Client (browser) ask for a quote. Agent (controller) go to the insurance company (model) to request the quote. The insurance company will then calculate the risks, then give the agent a quote (view), which is then passed back to the client.
  • 21. Test-Driven Development TDD Red GreenRefactor 1. Write a failing test 2. Write the code to pass the test 3. Refactor your code if necessary, and run all the tests again
  • 22. INTRO TO RUBY ON RAILS
  • 23. How Rails Applications work? Controller View Model request Data DataData Response (html) Database Routes
  • 24. Rails File System app/ assets (images, stylesheets, javascripts)/ controllers/ models/ views/ Others (helpers, mailers, jobs) config/ initializers/ routes.rb database.yml db migrate/ schema.rb seeds.rb
  • 25. Rails File System (Continued) spec MVC folders requests/ features/ support/ spec_helper.rb / rails_helper.rb Gemfile README.md
  • 26. Ruby Gems • Gems are extensions / plugins / libraries • You can implement common features using gems rather than writing the code from scratch • Common features include: – User Authentication / Authorisation – Import/Export from Excel / PDF – Images/File uploading • Manage the gems in the application using the Gemfile
  • 28. Steps in Planning an Application 1. Decide on the user stories 2. Plan database structure 3. Data Type, conditions and constraints 4. Application structure (more relevant for bigger projects) 5. Logic of the application (more relevant for complex projects)
  • 29. User Stories for Todo List App • As a user, I should be able to see the home page • As a user, I should be able to view all my Todo lists • As a user, I should be able to create Todo list • As a user, I should be able to delete my Todo list • As a user, I should be able to edit the name of the Todo list • As a user, I should be able to view all my Todo list items in my Todo list • As a user, I should be able to delete a Todo list item • As a user, I should be able to mark a Todo list item as done
  • 30. Database Structure for Todo List App
  • 31. Steps in Developing an Application 1. Based on the user story, write the relevant integration test 2. Write the routes 3. Generate the controller (rails generate controller) 4. Write requests / controller test if necessary 5. Write the controller code 6. Create and write a basic view file 7. Generate the model (rails generate model) and migrate DB if necessary 8. Write model validation tests / Define factory file 9. Write model validation code 10. Fix your view or model if need be to pass the test
  • 32. Steps in Developing an Application (Continued) 11. If you need additional business logic, work out the computations and flow first 12. Then write the model test for the logic 13. Beautify your view 14. Refactor your code if need be 15. Run the all the test again to ensure no test is failing
  • 33. Saving and Deploying Your Work • Create a Github account • Create a Heroku account
  • 35. Team Formation Structure • No more than 5 persons per team • List of project ideas: – Job Board – Project Management – Customer Relationship Management – Property listing (counter property guru) – Marketplace (like Lazada, Qoo10, Amazon) – can start off from a simple eCommerce site first – Expense tracker – Clones (Airbnb, Twitter, Facebook, LinkedIn, Instagram)
  • 36. When Planning Your Project… • Think of the simplest features that you want to do so that you do not overwhelm yourself. These features will make it minimally useful. • For example, for 2 sided users, just think from the perspective of one user. Complete the features for such user. Then plan from another perspective. • You have not learnt authentication. Do visit Devise on how to implement it. I will write a guide on how to implement Devise soon. • If your application requires you to upload photos, you can just plan it into your user stories first. I will find some resources which you can use.
  • 38. Future Meetups 1 meetup per month. Each meetup will consists of 3 portions: • Clarification of things based on previous session and projects • Sharing of Rails concepts, external speakers (maybe?) or sharing by one of the participants. • Coding your project onsite with your project teammates help The whole meetup will take 3 to 3.5 hours.
  • 39. Beyond Physical Meetups • Webinars • Guides in Medium Publications
  • 40. Communication Channels Discord Server for informal chat (Please message me for the invitation link) – I am still thinking whether to continue using this. Facebook Group: For better organization of discussions, sharing of articles and resources. (https://www.facebook.com/groups/learnrailssg/) Medium Publication: Main publication of this learning group. Most resources will be there. (https://medium.com/singapore-rails-learning-group) Slack/Whatsapp: For internal team communication
  • 41. Asking for Help If you do not know what to do, let us know (Discord or Facebook) • what is your user story, • which step in the development process are you at, and • what have you done so far for that user story? If you encounter error, show us the code that you got the error, what do you expect, and what do you get (including the error message, if any). Always google your issues first. Most of the time you will get your answers.
  • 42. Volunteers • Designer: To design the banner, logo and icon of this learning group • Logistics: Co-organize the logistics • Curriculum • Facilitator (with coding knowledge)