<h1>Build and deploy a web application</h1>
<ul>
<li>Add topics</li>
<li>Vote on a topic</li>
<li>Register and login</li>
</ul>
<p><img src="http://www.ultrasaurus.com/rubyworkshop/app_design/authenticated_home.jpg" width="934" height="436"/></p>
<h1>let's build a web app</h1>
<p><code>
rails suggestorama
</code></p>
<table>
<tr>
<th>File/Folder</th>
<th>Purpose</th>
</tr>
<tr>
<td><span class="caps">README</span></td>
<td>This is a brief instruction manual for your application.</td>
</tr>
<tr>
<td>Rakefile</td>
<td>This file contains batch jobs that can be run from the terminal.</td>
</tr>
<tr>
<td>app/</td>
<td>Contains the controllers, models, and views for your application. You will mostly work here.</td>
</tr>
<tr>
<td>config/</td>
<td>Configure your application’s runtime rules, routes, database, and more.</td>
</tr>
<tr>
<td>db/</td>
<td>Shows your current database schema, as well as the database migrations. </td>
</tr>
<tr>
<td>doc/</td>
<td>In-depth documentation for your application.</td>
</tr>
<tr>
<td>lib/</td>
<td>Extended modules for your application (not covered today).</td>
</tr>
<tr>
<td>log/</td>
<td>Application log files.</td>
</tr>
<tr>
<td>public/</td>
<td>The only folder seen to the world as-is. This is where your images, javascript, stylesheets (<span class="caps">CSS</span>), and other static files go.</td>
</tr>
<tr>
<td>script/</td>
<td>Scripts provided by Rails to do recurring tasks. We'll use some today.</td>
</tr>
<tr>
<td>test/</td>
<td>Unit tests, fixtures, and other test apparatus.</td>
</tr>
<tr>
<td>tmp/</td>
<td>Temporary files</td>
</tr>
<tr>
<td>vendor/</td>
<td>A place for third-party code. </td>
</tr>
</table>
<h1>run the web app</h1>
<pre><code>ruby script/server
http://localhost:3000
</code></pre>
<h1>make it your own</h1>
<ul>
<li>modify public/index.html</li>
<li>run it again</li>
</ul>
<h1>Awesome! Let's ship it!</h1>
<ul>
<li>we'll create a local git repository</li>
<li>then deploy to heroku</li>
</ul>
<p>. </p>
<pre><code>git init
git add .
git commit -m 'basic web application'
</code></pre>
<p>.</p>
<pre><code>heroku create
git push heroku master
</code></pre>
<h1>push code to github</h1>
<ul>
<li>create a repository</li>
<li>follow the instructions for existing repository</li>
</ul>
<p><code>
git config --global user.name "Your Name"
git config --global user.email you@whatever.com
git remote add origin git@github.com:yourgithubname/project.git
git push origin master
</code></p>
<h1>switch computers</h1>
<p>.</p>
<pre><code>git clone git://github.com/yourgitname/project.git
git pull
</code></pre>
<p>TODO: add Heroku collaborator? how to set up?</p>