# Introduction

{% hint style="danger" %}
The following information is outdated for previous semesters of Hack Challenge! For FA20, in which Hack Challenge is online, please refer to the information in our Discord channel #announcements for timelines and requirements!
{% endhint %}

## Introduction

Whether it’s developing a mobile app, building a robust backend system, or designing a user-friendly product, we strongly believe that the best way to learn something is by doing. Our hope is that you will not only learn some practical skills regarding design and development, but also to leave the course with tangible projects you can showcase on your resume or portfolio.

The AppDev Hack Challenge will span three weeks (1 week for team matching / project brainstorming, 2 weeks for design / development) and involve students across all our courses (iOS, backend, and design). Each group must consist of **3-4 students** from any one of our courses. We want every team to  have a diverse set of skills, so each team should not have no more than 2 backend developers, 2 iOS developers, or 1 designer. If you are in both the iOS and backend course, you can count for either or both roles.

Participating in the AppDev Hack Challenge will be the **required final project for iOS, Android, and Backend students** and is optional (but highly encouraged) for Design students. As an added incentive, we have a few challenges with prizes (see the Challenges section below for more details)!

## Mentorship

We’ll be pairing groups with two mentors, one iOS and one backend, who will help guide you through developing your app for the hack challenge. These mentors are teaching assistants and AppDev team members, so use them as a resource!

## Communication

All communication regarding the Hack Challenge will be handled through the Hack Challenge Piazza. All students enrolled in the iOS and backend courses will be automatically enrolled. If you are a student in the digital product design class, you can add the course by looking up “AppDev Hack Challenge” on Piazza and self-enrolling. Communication between mentors and mentees will be up to you and your team (Messenger, Slack, GroupMe, etc.).

## Timeline

| **Deliverable**                  | **Date**                  | Details                |
| -------------------------------- | ------------------------- | ---------------------- |
| Team formation released          | 11/13                     | Google Sheet           |
| Midpoint submission              | 11/21 **·** 11:59pm       | CMS Submission         |
| Final submission                 | 12/3 **·** 11:59pm        | Google Form Submission |
| Finale event (winners announced) | 12/6  **·** 7:30pm-8:30pm | Gates G01              |

## Proposal

Before you get started your project, you will need to submit a proposal of an idea you might want to work on for the Hack Challenge. For the proposal, please submit a short writeup (1 page max) with:

1. A short summary of what your app does
2. At least two screens your app would have, with a basic overview of what UI elements you might need (UITextField, UILabel, UIButton, UITableView, UICollectionView, etc.)
3. How you might use an API, or how backend developers could create an API for your app (database storage, etc.)

The submission will be due on Google Forms, and the link [is available here](https://forms.gle/CAsfxAALnCr4EqH6A) and on Piazza.

When coming up with an app idea, please keep in mind that you only have two weeks to complete a working an app - however, this doesn’t mean you can get away with creating something super basic. Ideally, the scope of difficulty for this project should be more difficult than the weekly assignments you have done, as you will be working with others and will have two weeks to implement it. Additionally, since we have not covered game development in class, you may not implement a game.

## Challenges and Prizes

### Cornell Store: Best Backend Integration

We challenge you to build an app that features the best backend integration. We are looking for a system that is not only functional and efficient but also robust and scalable. For instance, it could be an app that has the best custom built API!

### Cornell Store: Best Media App

We challenge you to build an app that integrates any form of media (think photos, videos, social media). We are looking for an app that uses media creatively to produce a fun experience for the user.&#x20;

### Cornell AppDev: Best User Interface

We challenge you to build an app that has the best frontend design and implementation. More specifically, we are looking for an app that is not only visually stunning but also emphasizes a good user experience.

### Cornell AppDev: Judge’s Choice

We are looking for an app that has interesting features or uses new technology to create an amazing product. Think outside the box, we can’t wait to see what you create!<br>


# Midpoint

{% hint style="danger" %}
The following information is outdated for previous semesters of Hack Challenge! For FA20, in which Hack Challenge is online, please refer to the information in our Discord channel #announcements for timelines and requirements!
{% endhint %}

## Submission

In order to ensure that you and your team are on track to produce a final deliverable, you will submit a midpoint submission with what you have completed so far. **You’ll meet with your AppDev mentors to go over what you’ve worked on so far and any other questions you might have.**&#x20;

For the midpoint submission, you will need to implement certain minimum functionality in your app. **Midpoint submissions will be turned in to CMS.**

## Requirements

### iOS

1. Submit a working UI - the data in the app can be hard-coded (ie. creating your own objects in app, like earlier projects), but be sure that it is ready to be received as data from an API request (conform it to Codable).
2. Use a UICollectionView or UITableView
3. Use some form of navigation

### Android

### Backend

1. Use SQLAlchemy to model data in some way
2. Have at least one GET, POST, and DELETE request that interfaces with the database in some way
3. The app doesn’t have to be deployed yet, but should be able to be run on your machine


# Final

{% hint style="danger" %}
The following information is outdated for previous semesters of Hack Challenge! For FA20, in which Hack Challenge is online, please refer to the information in our Discord channel #announcements for timelines and requirements!
{% endhint %}

## Submission

You’ve put in a lot of hard work over the past few weeks, and now it’s time to showcase your final project! For the final project deliverable, your group will be required to **host all your code on open-sourced public GitHub** **(not** **Cornell GitHub) repo(s)** (feel free to reach out to your TA if your group needs Git / GitHub help). **There will be no CMS submission.** We request that you use the general Github and not the Cornell Enterprise Github to host your code, so that we may share all the cool projects that you create. If your group used more than one repo (i.e. one for iOS and one for backend), submit one repo link and in the README.md, link the other repo. For example, if you submit your iOS repository link, add a link to the backend repository and vice versa.\
In your GitHub repository, please include a README with the following:

1. App Name
2. App Tagline: short one-liner description of your app
3. Link(s) to any other public GitHub repo(s) of your app. If you have one repo for iOS and one for Backend, please link to your backend repo in your iOS README, and your iOS repo in your backend README.
4. Some screenshots of your app (highlight important features)
5. A short description of your app (its purpose and features)
6. A list of how your app addresses each of the requirements (iOS / Backend)
7. Anything else you want your grader to know
8. **Note:** The link, screenshots, and description will be used for the Hack Challenge website where we will showcase everyone’s final projects

## Requirements

### iOS

1. AutoLayout using NSLayoutConstraint or SnapKit
2. At least one UICollectionView or UITableView
3. Some form of navigation (UINavigationController or UITabBarController) to navigate between screens
4. Integration with an API - this API must provide some meaningful value to your app. For example, if you’re creating a music app, you could use the Apple Music API. Most of you will integrate with an API written by students in the backend course.

### Android

### Backend

1. Designing an API, using database modeling, and implementing it using the Flask boilerplate code provided - it’s totally fine to write a wrapper for an existing API. Consider what changes you will need to fit the iOS client’s needs and how to model the data appropriately in a database.
2. Deployment to Google Cloud - make sure you start on deployment early! It’s extremely easy to get wrong and can be tricky to debug.


# Git and Github

## What is Git?

Git is a version control system for tracking changes in files and coordinating work on those files among multiple people. We will be using it for source code management in this class.&#x20;

## Why use Git?

**Feature branching:** Each person working on a different aspect of your project can create a new branch off of your master branch. This allows for isolated work to be done in parallel without waiting for a teammate to complete their task.

**History:** Because Git keeps track of incremental changes as commits, we are able to look back at the change history to debug and revert back if needed.

**Local repositories:** As an example, Google Docs does not have local repositories. Everyone works on the same document. If a mistake is made, then everyone else’s work is also impacted. With Git, our source code is located among local and remote repositories that are not automatically synced.&#x20;

## What is GitHub?

GitHub, like DockerHub, is a cloud-based platform built around the Git tool. It is a platform that hosts remote repositories of code. Git itself is the version control tool that runs on our local computer.&#x20;


# Create a Repository

## Workflow

1. Add files to staging area (local)
2. Create a commit object from staged files (local)
3. Push commits to remote repository (remote)

![](https://paper-attachments.dropbox.com/s_D8F66C7FAD791038CDAF79C9D57B71B6A6E39E9EA9887D408A0733B042741000_1541311324474_Screen+Shot+2018-11-04+at+1.01.52+AM.png)

### Setup and Use

**Install Git**

<https://git-scm.com/book/en/v2/Getting-Started-Installing-Git>

**Set up Git**&#x20;

`>>> git config --global user.name "Alicia Wang"`

`>>> git config --global user.email "aw@gmail.com"`

Use the email you plan to sign up to Github with. You can check that the configuration was set properly with:

`>>> git config --list`

**Create new project folder**

`>>> mkdir git-demo>>> cd git-demo`

This is the local source code we will be working with in the demo.

**Create some files**

`>>> vim README.md`

**Initialize a new Git repository**

`>>> git init`

This will create a hidden `.git` folder that contains all the necessary Git metadata for Git to work. Essentially turns your working directory into one that allows you to start recording revisions for it.

**Set up the remote repository**

`>>> git remote add origin https://github.com/username/git-demo.git`

This will set the remote repository, i.e. the versions of your project that are hosted somewhere other than your local computer. You will be pushing and pulling from this remote repository.\
origin is a shorthand alias for the URL of the remote repository that a project was originally cloned from. It’s a standard convention, but could be renamed if you so desire (but don’t).&#x20;

**Add file to staging area**

`>>> git add README.md`

**Commit staged files locally**

`>>> git commit -m "Initialize README"`

Why is there a difference between add and commit? Suppose we created new files feature1.py and feature2.py. These two features may not have much in common. Then it is helpful to have two separate commits for each file instead of having one commit for both files in order to keep our commit history readable and useful.&#x20;

**Check commit log**

`>>> git log`

This will show a history of all the previous (local and remote) commits made on the current branch.

**Push to remote**

`>>> git push --set-upstream origin master`

`--set-upstream` sets the default remote branch to origin/master for the current local branch master. Any git pull in the future will bring in commits from origin/master.\
You can then see your changes on Github! What if we edit the README directly at the remote repository? How do we update locally?

**Pull in remote updates**

`>>> git pull`

This will update your local repository with new changes from the remote repository.

**Create feature branch**

`>>> git checkout -b new-feature`

`checkout` will allow you to switch between branches. The -b \[name] will create a new branch. To check out an existing branch, you can just do git checkout existing-branch.&#x20;

**Merge changes into master**

`>>> git checkout master`

`>>> git merge new-feature`


# Backend-Mobile Handoff


# Design-Mobile Handoff


# Working With Images

<https://stackoverflow.com/questions/11251340/convert-between-uiimage-and-base64-string>


