Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enh(ios): server implementation & doc edits #2

Merged
merged 49 commits into from
Nov 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
e3b4377
initial work
aymericbeaumet Nov 2, 2023
060061d
wip
aymericbeaumet Nov 2, 2023
c3c43cb
improvements
aymericbeaumet Nov 2, 2023
fc25b82
sse
aymericbeaumet Nov 2, 2023
a71a2a6
chaos middleware
aymericbeaumet Nov 2, 2023
4dea122
init
aymericbeaumet Nov 2, 2023
e62942f
chaos
aymericbeaumet Nov 2, 2023
4aa27e7
wip
aymericbeaumet Nov 2, 2023
31a6b63
wip
aymericbeaumet Nov 2, 2023
36344c8
ignore
aymericbeaumet Nov 2, 2023
44846bb
wip
aymericbeaumet Nov 2, 2023
443dee7
wip
aymericbeaumet Nov 2, 2023
aabe717
wip
aymericbeaumet Nov 2, 2023
7e9e86b
wip
aymericbeaumet Nov 2, 2023
7cfb6d7
wip
aymericbeaumet Nov 2, 2023
a3da547
wip
aymericbeaumet Nov 2, 2023
71955b2
wip
aymericbeaumet Nov 2, 2023
e655777
wip
aymericbeaumet Nov 2, 2023
82cfe49
wip
aymericbeaumet Nov 2, 2023
72496d0
wip
aymericbeaumet Nov 2, 2023
fa7b6f0
wip
aymericbeaumet Nov 2, 2023
c0b56ab
wip
aymericbeaumet Nov 2, 2023
be6d71c
wip
aymericbeaumet Nov 2, 2023
cd855a8
wip
aymericbeaumet Nov 2, 2023
133a537
wip
aymericbeaumet Nov 2, 2023
b6e93a8
wip
aymericbeaumet Nov 2, 2023
a39315a
wip
aymericbeaumet Nov 2, 2023
0dfa0f3
wip
aymericbeaumet Nov 2, 2023
8e61612
wip
aymericbeaumet Nov 2, 2023
54ada07
wip
aymericbeaumet Nov 2, 2023
17f1074
wip
aymericbeaumet Nov 2, 2023
076c364
wip
aymericbeaumet Nov 2, 2023
62a14de
wip
aymericbeaumet Nov 2, 2023
9fb6e59
wip
aymericbeaumet Nov 2, 2023
7296ff9
wip
aymericbeaumet Nov 2, 2023
ff5e2f4
wip
aymericbeaumet Nov 2, 2023
8fc4e59
wip
aymericbeaumet Nov 2, 2023
f90ce6d
wip
aymericbeaumet Nov 2, 2023
69ea6e6
wip
aymericbeaumet Nov 2, 2023
897d1ab
wip
aymericbeaumet Nov 2, 2023
3543649
wip
aymericbeaumet Nov 2, 2023
85a700b
wip
aymericbeaumet Nov 2, 2023
da19cae
wip
aymericbeaumet Nov 2, 2023
7d488ac
wip
aymericbeaumet Nov 2, 2023
6f61e2d
wip
aymericbeaumet Nov 2, 2023
333be11
wip
aymericbeaumet Nov 2, 2023
29230d7
wip
aymericbeaumet Nov 2, 2023
1393614
wip
aymericbeaumet Nov 2, 2023
8e721c4
wip
aymericbeaumet Nov 2, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: ci

on:
push:
branches: [main]
paths-ignore:
- "**.md"
pull_request:
branches: [main]
paths-ignore:
- "**.md"

env:
GO_VERSION: "1.21.3" # https://go.dev/dl/
GOLANGCI_LINT_VERSION: "v1.55.1" # https://github.com/golangci/golangci-lint/releases

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}
- name: Lint go code
uses: golangci/golangci-lint-action@v3
with:
version: ${{ env.GOLANGCI_LINT_VERSION }}
skip-cache: true
working-directory: ./ios/server

build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}
- name: Build go code
working-directory: ./ios/server
run: go build
Binary file added ios/design.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
62 changes: 39 additions & 23 deletions ios/readme.md
Original file line number Diff line number Diff line change
@@ -1,40 +1,56 @@
# iOS Challenge

This challenge is part of the iOS hiring process at [Heart Hands,
Inc](https://hearthands.tech/).
This challenge is part of the iOS hiring process at [Heart
Hands](https://hearthands.tech/).

## Why this challenge?

Heart Hands is operating with a small team of talented people. We are looking
for seasoned engineers with strong technical foundation, deep knowledge of their
technical stack, and good product intuitions, that enjoy working on consumer
apps.
Heart Hands is operating with a small team of dedicated and talented people. We
are looking for seasoned engineers with a deep technical knowledge, strong
understanding of their technical stack, and good product intuitions to join our
team.

This challenge has been designed to give a glimpse of what it might be like when
joining the team. And the kind of technical challenges we face and care about.
We are expecting you to spend no more than 48 hours on this.
This challenge has been designed to give a glimpse of what it is like to build a
messaging app, and the kind of technical challenges we face and care about. We
are expecting you to spend no more than 48 hours on this.

## Summary

You are tasked to develop a consumer application that allows you to converse
with a chatbot.
You are tasked to develop a messaging app that allows to send and receive
messages with several bots, each in their own chat.

A server is available, you can read more about it in [`./server`](./server). The
documentation contains informations on how to run the server and what kinds of
API endpoints are available.
A server is available for you to use, you can read more about it in
[`./server`](./server). The documentation contains informations on how it can be
run and what kinds of API endpoints are available.

## Requirements

- [ ] The application should be composed of a single screen that list messages
(imagine a WhatsApp conversation)
- [ ] This screen should display the messages as returned by the server
- [ ] The app should allow sending new messages
- [ ] The server will send you messages that you must display
What are we expecting you to build?

- [ ] The app should start on a screen showing the list of all chats
- [ ] The app should allow opening each chat individually
- [ ] The app should allow sending messages to a chat
- [ ] The app should reflect the messages sent to and received from the server

## Bonus

- [ ] Make your app work offline (both for app state and sending)
- [ ] Make your app resilient to bad network conditions (retries & timeouts)
- [ ] Make your app idempotent for both what you send and what you receive
- [ ] Make the app compatible to run on iPad and macOS
What could be implemented to improve the UX?

- [ ] Make the app work offline (both for app state and sending)
- [ ] Make the app resilient to bad network conditions (retries & timeouts)
- [ ] Make the app idempotent in regards to what you send and receive
- [ ] Integrate a splashscreen to hide chats while the app is loading
- [ ] Add support for optimisic sending to give instantaneity in the UI
- [ ] Add support for a local read/unread indicator
- [ ] Avoid block changing states so the app feels fluid & snappy
- [ ] Make the app compatible to run on iPad and macOS
- [ ] Make the app runnable on multiple devices
- [ ] _Anything_ that you feel could improve the UX!

## Design

We have prepared a design to help you during this challenge.

![design](./design.png)

Good luck, and enjoy!
1 change: 1 addition & 0 deletions ios/server/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
server
26 changes: 26 additions & 0 deletions ios/server/data.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
[
"How did the doctor revive the developer?",
"How did the web dev hurt Comic Sans feelings?",
"How do you comfort a JavaScript bug?",
"How do you make a Web App accessible?",
"What do you call __proto__? Dunder proto. Michael Scott was the regional manager where?",
"What does a React proposal mean?",
"Why couldn’t the React component understand the joke?",
"Why did Jason cover himself with bubble wrap?",
"Why did the C# developer fall asleep?",
"Why did the CoffeeScript developer keep getting lost?",
"Why did the JavaScript boxer goto the chiropractor?",
"Why did the React Higher Order Component give up?",
"Why did the Web A11y Dev keep getting distracted?",
"Why did the child component have such great self-esteem?",
"Why did the developer go broke?",
"Why did the functional component feel lost?",
"Why did the react class component feel relieved?",
"Why did the react developer have an addiction?",
"Why did the software company hire drama majors from Starbucks?",
"Why do C# and Java developers keep breaking their keyboards",
"Why was Ember.js turning red?",
"Why was the JavaScript developer sad?",
"Why was the react developer late to everything?",
"dev1 > What tool do you use to switch versions of node?"
]
13 changes: 13 additions & 0 deletions ios/server/go.mod
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
module github.com/hearthands/challenges/ios/server

go 1.21.3

require (
github.com/go-chi/chi/v5 v5.0.10
github.com/go-chi/render v1.0.3
github.com/r3labs/sse/v2 v2.10.0
golang.org/x/exp v0.0.0-20231006140011-7918f672742d
)

require (
github.com/ajg/form v1.5.1 // indirect
golang.org/x/net v0.0.0-20191116160921-f9c825593386 // indirect
gopkg.in/cenkalti/backoff.v1 v1.1.0 // indirect
)
27 changes: 27 additions & 0 deletions ios/server/go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
github.com/ajg/form v1.5.1 h1:t9c7v8JUKu/XxOGBU0yjNpaMloxGEJhUkqFRq0ibGeU=
github.com/ajg/form v1.5.1/go.mod h1:uL1WgH+h2mgNtvBq0339dVnzXdBETtL2LeUXaIv25UY=
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/go-chi/chi/v5 v5.0.10 h1:rLz5avzKpjqxrYwXNfmjkrYYXOyLJd37pz53UFHC6vk=
github.com/go-chi/chi/v5 v5.0.10/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8=
github.com/go-chi/render v1.0.3 h1:AsXqd2a1/INaIfUSKq3G5uA8weYx20FOsM7uSoCyyt4=
github.com/go-chi/render v1.0.3/go.mod h1:/gr3hVkmYR0YlEy3LxCuVRFzEu9Ruok+gFqbIofjao0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/r3labs/sse/v2 v2.10.0 h1:hFEkLLFY4LDifoHdiCN/LlGBAdVJYsANaLqNYa1l/v0=
github.com/r3labs/sse/v2 v2.10.0/go.mod h1:Igau6Whc+F17QUgML1fYe1VPZzTV6EMCnYktEmkNJ7I=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/exp v0.0.0-20231006140011-7918f672742d h1:jtJma62tbqLibJ5sFQz8bKtEM8rJBtfilJ2qTU199MI=
golang.org/x/exp v0.0.0-20231006140011-7918f672742d/go.mod h1:ldy0pHrwJyGW56pPQzzkH36rKxoZW1tw7ZJpeKx+hdo=
golang.org/x/net v0.0.0-20191116160921-f9c825593386 h1:ktbWvQrW08Txdxno1PiDpSxPXG6ndGsfnJjRRtkM0LQ=
golang.org/x/net v0.0.0-20191116160921-f9c825593386/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
gopkg.in/cenkalti/backoff.v1 v1.1.0 h1:Arh75ttbsvlpVA7WtVpH4u9h6Zl46xuptxqLxPiSo4Y=
gopkg.in/cenkalti/backoff.v1 v1.1.0/go.mod h1:J6Vskwqd+OMVJl8C33mmtxTBs2gyzfv7UDAkHu8BrjI=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
Loading
Loading