Skip to content

Commit f4174e1

Browse files
committed
feat: import initial project
0 parents  commit f4174e1

85 files changed

Lines changed: 30842 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules
2+
libs

README.md

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
This project contains a simplified [server](server) and [mobile app](mobile) that enable a user to step-by-step complete what we call a Know Your Customer (KYC) questionnaire.
2+
3+
## Prerequisites
4+
5+
- A recent version of [mise-en-place](https://mise.jdx.dev/), which will install and configure the required toolchain to build and run the server and apps.
6+
- For iOS, have setup XCode and an iOS Simulator or device in Developer Mode. [See here](https://reactnative.dev/docs/set-up-your-environment).
7+
- For Android, have setup the Android SDK and either an physical or virtual Android Device. [See here](https://reactnative.dev/docs/set-up-your-environment?platform=android).
8+
9+
10+
## Quick Start
11+
12+
First, setup the toolchain
13+
14+
```sh
15+
mise use
16+
```
17+
18+
## Protobuf
19+
20+
You need to compile the [Protobuf](https://protobuf.dev/) definitions
21+
22+
```sh
23+
cd ./api
24+
buf generate
25+
```
26+
27+
## Server
28+
29+
First, install the servers dependencies
30+
31+
```sh
32+
go mod tidy
33+
```
34+
35+
You can then start the server using...
36+
```sh
37+
go server/main.go
38+
```
39+
40+
## Mobile
41+
42+
First, install dependencies
43+
44+
```bash
45+
cd ./mobile
46+
npm i
47+
cd ios
48+
pod install
49+
cd ../
50+
```
51+
52+
Then, for iOS...
53+
54+
```bash
55+
npm run ios
56+
```
57+
58+
Or, for Android...
59+
60+
```bash
61+
npm run android
62+
```
63+
64+
The app should build, install and launch on your respective device/emulator ready for development.
65+
66+
## What to do?
67+
68+
Review the PR in the interview by talking through the changes.
69+
Do not comment on the PR in GitHub.

api/buf.gen.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
version: v2
2+
clean: true
3+
managed:
4+
enabled: true
5+
override:
6+
- file_option: go_package_prefix
7+
path: thirdfort
8+
value: github.com/thirdfort/thirdfort-mobile-fullstack-code-review/server/libs/genproto
9+
plugins:
10+
- remote: buf.build/protocolbuffers/go:v1.36.2
11+
out: ../server/libs/genproto
12+
opt: paths=source_relative
13+
- remote: buf.build/connectrpc/go:v1.18.1
14+
out: ../server/libs/genproto
15+
opt: paths=source_relative
16+
- remote: buf.build/bufbuild/es:v2.2.3
17+
out: ../mobile/libs/genproto
18+
opt: target=ts
19+
include_imports: true
20+
- remote: buf.build/connectrpc/es:v1.6.1
21+
out: ../mobile/libs/genproto
22+
opt: target=ts

api/buf.lock

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Generated by buf. DO NOT EDIT.
2+
version: v2

api/buf.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# For details on buf.yaml configuration, visit https://buf.build/docs/configuration/v2/buf-yaml
2+
version: v2
3+
lint:
4+
use:
5+
- STANDARD
6+
breaking:
7+
use:
8+
- FILE
9+
deps:
10+
- buf.build/protocolbuffers/wellknowntypes:v21.12
11+
- buf.build/googleapis/googleapis:f52d4f76a8434cc5966798b1d3b4f110
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
syntax = "proto3";
2+
3+
package thirdfort.consumer.tasksteps.type.v1;
4+
5+
import "thirdfort/consumer/v1/resources.proto";
6+
7+
message TaskCompletionTaskStepParams {
8+
// The display name of the task.
9+
string display_name = 1;
10+
11+
// The description of the task.
12+
string primary_description = 2;
13+
14+
// The text to display on the submit button.
15+
string submit_button_text = 3;
16+
}
17+
18+
message TaskCompletionTaskStepData {}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
syntax = "proto3";
2+
3+
package thirdfort.consumer.tasksteps.type.v1;
4+
5+
import "thirdfort/consumer/v1/resources.proto";
6+
7+
message TaskDescriptionTaskStepParams {
8+
// The display name of the task.
9+
string display_name = 1;
10+
11+
// The description of the task.
12+
string primary_description = 2;
13+
14+
// The secondary description of the task.
15+
string secondary_description = 3;
16+
17+
// A list of things the user must know/gather in order to complete this task.
18+
repeated string requirements = 4;
19+
20+
// Indicates if this task is skipable.
21+
bool skipable = 5;
22+
}
23+
24+
message TaskDescriptionTaskStepData {
25+
// Indicates whether the task was skipped.
26+
bool skipped = 1;
27+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
syntax = "proto3";
2+
3+
package thirdfort.consumer.tasksteps.type.v1;
4+
5+
import "thirdfort/consumer/v1/resources.proto";
6+
7+
// This task step is used to display information to the user.
8+
message TaskInformationTaskStepParams {
9+
// The display name of the task.
10+
string display_name = 1;
11+
12+
// The description of the task.
13+
string primary_description = 2;
14+
15+
// The secondary description of the task.
16+
string secondary_description = 3;
17+
18+
// The text to display on the button used to continue to the next task.
19+
string button_text = 4;
20+
}
21+
22+
message TaskInformationTaskStepData {}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
syntax = "proto3";
2+
3+
package thirdfort.consumer.v1;
4+
5+
import "google/protobuf/any.proto";
6+
import "google/protobuf/timestamp.proto";
7+
8+
message TaskStep {
9+
string name = 1;
10+
11+
string type = 2;
12+
13+
enum State {
14+
STATE_UNSPECIFIED = 0;
15+
NOT_COMPLETED = 1;
16+
COMPLETED = 3;
17+
CANCELLED = 4;
18+
}
19+
20+
State state = 3;
21+
22+
google.protobuf.Timestamp create_time = 4;
23+
24+
google.protobuf.Timestamp update_time = 5;
25+
26+
google.protobuf.Any params = 6;
27+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
syntax = "proto3";
2+
3+
package thirdfort.consumer.v1;
4+
5+
import "google/protobuf/any.proto";
6+
import "thirdfort/consumer/v1/resources.proto";
7+
8+
service ConsumerService {
9+
// Returns the requested [TaskStep][thirdfort.consumer.v1alpha1.TaskStep].
10+
rpc GetTaskStep(GetTaskStepRequest) returns (TaskStep) {}
11+
12+
// Completes the specified [TaskStep][thirdfort.consumer.v1alpha1.TaskStep] by providing the required data.
13+
rpc CompleteTaskStep(CompleteTaskStepRequest) returns (CompleteTaskStepResponse) {}
14+
}
15+
16+
message GetTaskStepRequest {
17+
string name = 1;
18+
}
19+
20+
message CompleteTaskStepRequest {
21+
string name = 1;
22+
google.protobuf.Any data = 2;
23+
}
24+
25+
message CompleteTaskStepResponse {
26+
string name = 1;
27+
TaskStep next_step = 2;
28+
}

0 commit comments

Comments
 (0)