Skip to content
This repository was archived by the owner on Aug 9, 2024. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
dc3d52f
refactor: make the app execute and init new folder structure
MatheusMassula Apr 18, 2024
be31782
refactor: move yelp repository to it's own package
MatheusMassula Apr 19, 2024
2e872c4
refactor: rename restaurant repository to yelp repository
MatheusMassula Apr 19, 2024
36700c2
refactor: create domain package
MatheusMassula Apr 22, 2024
f04b5b6
feat: lazy load restaurants
MatheusMassula Apr 22, 2024
89ac115
feat: WIP - restaurant card
MatheusMassula Apr 23, 2024
df0b70e
refactor: refactor restaurant card
MatheusMassula Apr 24, 2024
b5e6869
feat: WIP - restaurant detail base page
MatheusMassula Apr 29, 2024
b1fd1b5
refactor: add user data to review
MatheusMassula Apr 29, 2024
965e356
refactor: implement app router
MatheusMassula Apr 29, 2024
46ce82c
feat: add local storage
MatheusMassula May 2, 2024
67e666a
feat: enable app to be global
MatheusMassula May 4, 2024
a28d6d6
refactor: enable multi environment
MatheusMassula May 4, 2024
3ce0a5e
rerfactor: add app got lost page
MatheusMassula May 5, 2024
c90fa5e
refactor: allow user to start over on "app got lost" page
MatheusMassula May 5, 2024
2853b35
test: add tests to RestaurantDetailCubit
MatheusMassula May 5, 2024
ead9b2b
test: WIP - test set restaurant as favorite flow
MatheusMassula May 5, 2024
7f3154c
fix: display restaurant detail when reviews is empty
MatheusMassula May 8, 2024
240cc54
test: fix 'Set restaurant as favorite' test
MatheusMassula May 8, 2024
3a0ad60
style: create and apply app style
MatheusMassula May 9, 2024
08e4c2a
refactor: remove temporary references from read me
MatheusMassula May 9, 2024
b1ad046
chore: add necessecary code to execute app on iOS
MatheusMassula May 10, 2024
d409dac
docs: update readme with instructions
MatheusMassula May 10, 2024
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
4 changes: 0 additions & 4 deletions .fvm/fvm_config.json

This file was deleted.

3 changes: 3 additions & 0 deletions .fvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"flutter": "3.13.9"
}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
.pub-cache/
.pub/
/build/
**/build/
**/*.mocks.dart

# Web related
lib/generated_plugin_registrant.dart
Expand Down
25 changes: 22 additions & 3 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,28 @@
"version": "0.2.0",
"configurations": [
{
"name": "app",
"name": "app-dev",
"request": "launch",
"type": "dart"
}
"type": "dart",
"program": "${workspaceFolder}\/lib\/main_dev.dart",
},
{
"name": "app-prod",
"request": "launch",
"type": "dart",
"program": "${workspaceFolder}\/lib\/main_prod.dart",
},
{
"name": "app-dev-windows",
"request": "launch",
"type": "dart",
"program": "${workspaceFolder}\\lib\\main_dev.dart",
},
{
"name": "app-prod-windows",
"request": "launch",
"type": "dart",
"program": "${workspaceFolder}\\lib\\main_prod.dart",
},
]
}
14 changes: 8 additions & 6 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
{
"dart.flutterSdkPath": ".fvm/flutter_sdk",
"search.exclude": {
"**/.fvm": true
},
"files.watcherExclude": {
"**/.fvm": true
}
// Remove .fvm files from search
"search.exclude": {
"**/.fvm": true
},
// Remove from file watching
"files.watcherExclude": {
"**/.fvm": true
}
}
49 changes: 49 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,3 +181,52 @@ Just create a new issue in this repo and we will respond and get back to you qui
## Review

The coding challenge is a take-home test upon which we'll be conducting a thorough code review once complete. The review will consist of meeting some more of our mobile engineers and giving a review of the solution you have designed. Please be prepared to share your screen and run/demo the application to the group. During this process, the engineers will be asking questions.

---

## Clear documentation on the structure and architecture of your application.

I based the app structure on a mix of "package by layer" and "package by feature" called as "package by convenience" on [this book](https://www.kodeco.com/14214369-infinite-scrolling-pagination-in-flutter).

Basically follow similar rules:
### 1 Features get their own package

In this project a feature can be considered as any screen

### 2 Features don't know each other

The navigation responsability is designated to the [AppRouter](lib\app_router.dart)

### 3 Repositories get their own package

In this project, repository was understood as data sources and each one got their own package
- [YelpRepository](packages\yelp_repository\lib\src\yelp_repository.dart): Responsible to retrieve data from yelp api
- [LocalStorage](packages\local_storage\lib\src\local_storage.dart): Responsible to store data in the device

### 4 Specialized packages

Code that are meant for one specific purpose, but can be used in more than one place
- [Component Library](packages\component_library): Widgets that were made by design team and are meant to be used in more than one place
- [Domain Models](packages\domain_models): Data classes that will be used in the features (screens). Other packages that handle other data type must use the other data type only internally.

## Tests

The tests were made in the following files:
- [unit test](packages\features\restaurant_detail\test\unit\restaurant_detail_cubit_test.dart)
- [widget/flow test](test\widget_test.dart)

## Environment setup
If you are using a mac you can:
- update the [.env_prod](assets\env\/.env_prod) file with the yelp api key
- the other file was created to showcase the ability to work on a different environment and do not impact production
- open the terminal at the project folder and execute: `make setup;`
- execute the project
- the vs code is already setup to launch the correct files, so you can find the runner at the top left on yours and choose `app-prod` and run it
- in android studio is necessary to setup the corrent files:
- Open your project in Android Studio.
- Go to Run -> Edit Configurations....
- Click on the + button at the top left of the Run/Debug Configurations dialog to add a new configuration.
- Select Flutter.
- In the Name field, enter the name of the configuration (e.g., "app-dev").
- In the Dart entrypoint field, enter the path to the Dart file you want to run (e.g., "lib/main_dev.dart").
- Click OK to save the configuration.
2 changes: 1 addition & 1 deletion android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
compileSdkVersion flutter.compileSdkVersion
compileSdkVersion 34

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
Expand Down
6 changes: 3 additions & 3 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
buildscript {
ext.kotlin_version = '1.3.50'
ext.kotlin_version = '1.9.23'
repositories {
google()
mavenCentral()
}

dependencies {
classpath 'com.android.tools.build:gradle:4.1.0'
classpath 'com.android.tools.build:gradle:4.2.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
Expand All @@ -26,6 +26,6 @@ subprojects {
project.evaluationDependsOn(':app')
}

task clean(type: Delete) {
tasks.register("clean", Delete) {
delete rootProject.buildDir
}
8 changes: 7 additions & 1 deletion android/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
org.gradle.jvmargs=-Xmx1536M
# Fix made following instruction from: https://stackoverflow.com/a/69179997/10507546
org.gradle.jvmargs=-Xmx1536M \
--add-exports=java.base/sun.nio.ch=ALL-UNNAMED \
--add-opens=java.base/java.lang=ALL-UNNAMED \
--add-opens=java.base/java.lang.reflect=ALL-UNNAMED \
--add-opens=java.base/java.io=ALL-UNNAMED \
--add-exports=jdk.unsupported/sun.misc=ALL-UNNAMED
android.useAndroidX=true
android.enableJetifier=true
2 changes: 1 addition & 1 deletion android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-all.zip
1 change: 1 addition & 0 deletions assets/env/.env_dev
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
yelpApiKey=YOUR_API_KEY_HERE
1 change: 1 addition & 0 deletions assets/env/.env_prod
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
yelpApiKey=YOUR_API_KEY_HERE
Binary file added assets/fonts/Lora/Lora-Bold.ttf
Binary file not shown.
Binary file added assets/fonts/Lora/Lora-BoldItalic.ttf
Binary file not shown.
Binary file added assets/fonts/Lora/Lora-Italic.ttf
Binary file not shown.
Binary file added assets/fonts/Lora/Lora-Medium.ttf
Binary file not shown.
Binary file added assets/fonts/Lora/Lora-MediumItalic.ttf
Binary file not shown.
Binary file added assets/fonts/Lora/Lora-Regular.ttf
Binary file not shown.
Binary file added assets/fonts/Lora/Lora-SemiBold.ttf
Binary file not shown.
Binary file added assets/fonts/Lora/Lora-SemiBoldItalic.ttf
Binary file not shown.
Binary file added assets/fonts/OpenSans/OpenSans-Bold.ttf
Binary file not shown.
Binary file added assets/fonts/OpenSans/OpenSans-BoldItalic.ttf
Binary file not shown.
Binary file added assets/fonts/OpenSans/OpenSans-ExtraBold.ttf
Binary file not shown.
Binary file not shown.
Binary file added assets/fonts/OpenSans/OpenSans-Italic.ttf
Binary file not shown.
Binary file added assets/fonts/OpenSans/OpenSans-Light.ttf
Binary file not shown.
Binary file added assets/fonts/OpenSans/OpenSans-LightItalic.ttf
Binary file not shown.
Binary file added assets/fonts/OpenSans/OpenSans-Medium.ttf
Binary file not shown.
Binary file added assets/fonts/OpenSans/OpenSans-MediumItalic.ttf
Binary file not shown.
Binary file added assets/fonts/OpenSans/OpenSans-Regular.ttf
Binary file not shown.
Binary file added assets/fonts/OpenSans/OpenSans-SemiBold.ttf
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
1 change: 1 addition & 0 deletions assets/svg/app_got_lost.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading