---
# System prepended metadata

title: SurfsUp

---

# SurfsUp

## Table of Contents
1. [Overview](#Overview)
2. [Product Spec](#Product-Spec)
3. [Wireframes](#Wireframes)

## Overview
### Description
Sends notifications when waves are projected to get over a certain high or quality. Extra feature would be having a social media aspect so users can post that they're going or the waves they caught.

### App Evaluation
- **Category:** Social, Forecasts, Tide, Winds
- **Mobile:** This app would be primarily developed for mobile but would perhaps be just as viable on a computer, such as tinder or other similar apps. Functionality wouldn't be limited to mobile devices, however mobile version could potentially have more features.
- **Story:** App has the surf conditions up to a week. Additionally, there will be accounts to follow your friends and create meetups. 
- **Market:** Surfers
- **Habit:** Everytime a user wants to surf, they will check the app and can message their friends to tag along
- **Scope:** World Wide

## Product Spec

### 1. User Stories (Required and Optional)

**Required Must-have Stories**

* User can see wave forecasts
* Send a notification of the surf report 
* User can create an account
* User can login
* User can logout

**Optional Nice-to-have Stories**

* User can add friends 
* User can create/delete posts
* User can view posts from friends
* User can like/comment on posts

### 2. Screen Archetypes

* Login
    * User can login
* Register 
   * User can create a new account 
* Profile Screen 
   * Allows user to upload a photo and fill in basic information
* Wave Forecasts
   * User can access weather and wave conditions
   * User will be given a notifications of the surf report  
* Stream
    * User can view a feed of posts
    * User can heart a headsUp to like the post
* Creation
    * User can post a new headsUp to their feed

### 3. Navigation

**Tab Navigation** (Tab to Screen)

* Wave Forecast
* HeadsUp Feed
* Profile

**Flow Navigation** (Screen to Screen)

* Login/Registration
   * Wave Forecast
* HeadsUp Feed
   * Post Creation

## Wireframes
<img src="https://github.com/CodePath-IOS-2022-Project/SurfsUp/blob/main/sketch.png" width=600>
https://app.sketchtogether.com/s/sketch/RWJtw.1.1/

### [BONUS] Digital Wireframes & Mockups
<img src="https://github.com/CodePath-IOS-2022-Project/SurfsUp/blob/main/FigmaWireframe.png" width=600>

### [BONUS] Interactive Prototype
<img src="https://github.com/CodePath-IOS-2022-Project/SurfsUp/blob/main/prototype.gif">

## Schema 
### Models

Login
| Property | Type | Desciption |
| -------- | -------- | -------- |
| objectId    |String    | unique id for user|
|username|ptr to string|user's username|
|password|ptr to string|user's password|

Home
| Property | Type | Description |
| -------- | -------- | -------- |
| objectId    | String     | unique id for weather conditions     |
|day|string| day of the week|
|location|string|Beach name/ cordinantes
|temperature| int | day's current temp|
|waveHeight | int | height of the wave|
|high|int|the day's max temp
|low|int|the day's low temp

Feed
| Property |Type | Description |
| -------- | -------- | -------- |
| objectId  | String     |unique id for the user post (default field)    |
|author|	Pointer to User	|image author|
|image|	File|	image that user posts|
|caption	|String	|image caption by author
|commentsCount|	Number|	number of comments that has been posted to an image|
|createdAt	|DateTime|	date when post is created (default field)|
|updatedAt|	DateTime|	date when post is last updated (default field)|


Post
| Property |Type | Description |
| -------- | -------- | -------- |
| objectId  | String     |unique id for the user post (default field)    |
|author|	Pointer to User	|image author|
|image|	File|	image that user posts|
|caption	|String	|image caption by author
|commentsCount|	Number|	number of comments that has been posted to an image|
|createdAt	|DateTime|	date when post is created (default field)|
|updatedAt|	DateTime|	date when post is last updated (default field)|

### Networking
* Login Screen
    - Creates new data on parse
    - Retrieves existing data on parse  

* Home 
    - Query wave height and weather from msw api

* Post
    - Adds to data base 

* Feed 
    - Query parse data base for image/comments
    ```swift
    let query = PFQuery(className:"Post")
    query.whereKey("author", equalTo: currentUser)
    query.order(byDescending: "createdAt")
    query.findObjectsInBackground { (posts[PFObject]?, error: Error?) in
       if let error = error { 
          print(error.localizedDescription)
       } else if let posts = posts {
          print("Successfully retrieved \(posts.count) posts.")
        }
    }
```
