Skip to content

Commit

Permalink
fixed deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
phucd5 committed Dec 2, 2023
1 parent 05a4211 commit fdec744
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 1 deletion.
7 changes: 6 additions & 1 deletion API-Documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ Below you will find detailed descriptions of each endpoint, including the HTTP m
- [Reply Endpoints](#reply-endpoints)
- [Like Reply](#like-reply)
- [Add Reply](#add-reply)
- [Metrics Endpoints](#metrics-endpoints)
- [Create Metrics](#create-metrics)
- [Get Metrics by Name](#get-metrics-by-name)
- [Increment Likes](#increment-likes)
- [Update Total Distribution](#update-total-distribution)




Expand Down Expand Up @@ -297,7 +303,6 @@ Creates a new metrics record.
}
```


### Get Metrics by Name

Retrieves a metrics record by its name.
Expand Down
46 changes: 46 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -299,3 +299,49 @@ Overall, due to the inherent complexity of unit testing in Xcode in Swift with X
- Challenges of mocking environments that rely on hardware interactions.
Thus, we were told not to worry about getting 80% statement coverage for the frontend tests, especially since we've met the requirement for back-end tests. We were told to document this issue in detail, which we did above.
# Metrics Milestone
For the metrics milestone, we are implementing 3 different versions of the "screenshot" button in our app.
Unfortunately, as of right now, Swift has no API tools that help us automatically display the most optimal version of your app to your users. This is because with iOS applications, the user needs to update the app to get the most optimal version of the app. However, this does not prevent us from measuring user behavior and adapting the app for future versions with the implementation that people prefer the most.
## Version and Deployment
We have 3 TestFlight builds, each representing a different icon for the screenshot feature. We will distribute these builds evenly across our user pools using special links generated from the TestFlight website.
<div style="display: flex; justify-content: space-between;">
<img src="docs/test.png" alt="Image 1" style="flex: 1; max-width: 30%;">
<img src="docs/test.png" alt="Image 2" style="flex: 1; max-width: 30%;">
<img src="docs/test.png" alt="Image 3" style="flex: 1; max-width: 30%;">
</div>
## Tracking
To implement tracking of how many users tap on each icon, we have implemented a backend model called "Metrics" with the following schema fields:
- `metrics_name`: Unique name identifier for the metrics record.
- `clicks`: Count of clicks, used for tracking user interactions.
- `total_distribution`: Represents the distribution value, defaulting to 50.
When a user clicks on the icon, the respective API call will be made to increment the metric for that API.
## Evaluation
After our user testing, we will go into the backend and calculate the percentage of users that tap on the screenshot feature for each icon. To do that, we will use this formula:
```javascript
percent_interaction = clicks / total_distribution
```
The icon with the highest percent_interaction will be selected as the final icon to be deployed to everyone in the app.
## Coresponding Code
- server/controllers/metrics.js
- server/model/Metrics.js
- server/routes/metrics.js
- app/newHere/Views/Home/Home.swift
Binary file added docs/test.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions server/vercel.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@
{
"src": "/user/(.*)",
"dest": "/server.js"
},
{
"src": "/metrics/(.*)",
"dest": "/server.js"
}
]
}
Expand Down

0 comments on commit fdec744

Please sign in to comment.