Last updated: Mon Sep 27 11:19:35 PDT 2021

CS 124-Lab 1

Design an interface for a mobile web app that manages a list of items to complete. The app should support these tasks (not necesarily carried out in this order): Make sure your interface can handle all these tasks in a reasonable manner.

The interface should be presented as a series of html pages designed for a 360x640 pixel portrait-mode mobile display. The easiest way to test this is with Chrome. Open the Developer Tools (View->Developer->Developer Tools), and then click on the Toggle Device icon (image of Toggle Device icon in Chrome Developer Tools toolbar) in the developer tools tab. It'll change the viewport of the webpage. Select "Moto G4" to get a viewport of size 360x640).

For each task, show a webpage containing:

Initial, intermediate, and/or alternative designs can be done however you'd like: for example, paper, electronic sketches, prototyping tools. However, your final design should be presented as a series of HTML pages, along with associated CSS and any needed images.

The final design is done in this fashion so that you have a target for lab 2 as to the HTML your application will need to generate.

Git Setup

We'll be using Git as a way to manage your labs and GitHub as a mechanism for submitting your labs. To learn more about Git, take a look at the Git user's manual, or, if you are already familiar with other version control systems, you may find this CS-oriented overview of Git useful.

  1. Create a GitHub account
  2. If you don't already have a GitHub account, you'll need to create one. Go to github.com and create an account.
  3. Setup SSH keys to avoid providing username and password to git each time you use it on the command line.
  4. In order to push changes to your GitHub repository you'll need to provide credentials to GitHub. That can be done by providing your GitHub username and password each time you interact with the remote repository. A simpler way, though, is to provide an SSH public key to GitHub. Follow the directions at Connecting to GitHub with SSH.
  5. Only one person per pair programming team should do this part!
    1. Create a new public repository named cs124
    2. On GitHub, click on the + menu item at the top right, and select "New Repository". Set the following fields:
      • Your new repository details (name): cs124
      • Privacy: Public
      Then, click "Create repository". Once it's created, you can go to https://www.github.com/<your username>/cs124.
    3. Add instructor as collaborator
    4. You'll need to add me as a collaborator (so that I can see your repository in order to do grading and provide comments on your labs). To do so, click on the "Settings" tab for your repository. On the left-hand-side, click Manage access and click on "Invite a collaborator. Type "nrhodes-hmc", select "nrhodes-hmc" from the resulting popup, and click the Add button.
    5. Add your teammate as a collaborator
    6. You'll need to add your teammate as a collaborator (so that they can check code in and out of the repository). Follow the same procedure as above.
  6. Clone the repository onto your local machine
  7. To install the files in your local machine, you need to clone the course repository, one person should run the commands below.
    $ mkdir ~/cs124
    $ cd ~/cs124
    $ git clone git@github.com:{USERNAME}/cs124.git lab #where {USERNAME} is your GitHub user name.
    Cloning into lab...
    $ cd lab
    $ git branch lab1 # creates a branch for lab1	
    $ git push -u origin lab1 # pushes the new branch to the origin
    
  8. Now, the other teammate can do:
    $ mkdir ~/cs124
    $ cd ~/cs124
    $ git clone git@github.com:{USERNAME}/cs124.git lab #where {USERNAME} is  GitHub user name containing the repository.
    Cloning into lab...
    $ cd lab
    $ git checkout lab1 # switches to the empty lab1 branch.
    
From this point on, try to work on the repository in one team member's machine at a time (pair programming session where you're sharing a screen). When you're done, you can commit and push, and then pull from the other team member's machine.

You can work separately on individual repositories, but then will likely need to figure out how to resolve conflicts when doing a git pull if your teammate has made changes to the main repository. So there are now three repositories:

As you are working, you'll:

Git allows you to keep track of the changes you make to the code. For example, if you are finished with one task from a lab, and want to checkpoint your progress, you can commit your changes by running:

$ git commit -am 'My explanatory comment for the code I am checking in'
Created commit 60d2135: My explanatory comment for the code I am checking in
 1 files changed, 1 insertions(+), 0 deletions(-)
$ 
Those changes will be only in your local repository. In order to push them to your GitHub repository, you'd use:
$ git push

You can keep track of your changes by using the git diff command. Running git diff will display the changes to your code since your last commit.

So that I can tell who the team-members are (because GitHub usernames aren't always clear), create a file named team.txt and, on separate lines, add GitHub username followed by your full names. When you're done, add it to the repository:

$ git add team.txt
$ git commit team.txt -m "Add team.txt file"
$ git push
$

Hand-In Procedure

You will turn in your labs using git and GitHub.

$ git commit -am "my last commit"
[lab1 c2e3c8b] my last commit
 2 files changed, 18 insertions(+), 2 deletions(-)

$ git push

You will then need to go to GitHub.com and create a pull request (this is how you'd normally submit changes to projects on GitHub). This pull request will be reviewed by me and I'll provide comments. At this point, you can give up on the pull request, or, you can simulate what happens in industry and respond to those comments (updating your files or disagreeing with my comments) and, once we've gone back and forth, I'll eventually approve the request.

Deliverables

You'll submit a GitHub branch named lab1 containing: In order to setup GitHub Pages, go the project settings (Settings pane), and then to the Pages subpanel. Select the source as lab1, and the folder as /(root). Then, click Save.

Before creating your pull request, go to GitHub and verify that: