Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Wiingaard committed Aug 4, 2022
0 parents commit 69215a1
Show file tree
Hide file tree
Showing 104 changed files with 12,217 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .buckconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

[android]
target = Google Inc.:Google APIs:23

[maven_repositories]
central = https://repo1.maven.org/maven2
2 changes: 2 additions & 0 deletions .bundle/config
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
BUNDLE_PATH: "vendor/bundle"
BUNDLE_FORCE_RUBY_PLATFORM: 1
16 changes: 16 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
module.exports = {
root: true,
extends: '@react-native-community',
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint'],
overrides: [
{
files: ['*.ts', '*.tsx'],
rules: {
'@typescript-eslint/no-shadow': ['error'],
'no-shadow': 'off',
'no-undef': 'off',
},
},
],
};
61 changes: 61 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# OSX
#
.DS_Store

# Xcode
#
build/
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata
*.xccheckout
*.moved-aside
DerivedData
*.hmap
*.ipa
*.xcuserstate

# Android/IntelliJ
#
build/
.idea
.gradle
local.properties
*.iml
*.hprof

# node.js
#
node_modules/
npm-debug.log
yarn-error.log

# BUCK
buck-out/
\.buckd/
*.keystore
!debug.keystore

# fastlane
#
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
# screenshots whenever they are needed.
# For more information about the recommended setup visit:
# https://docs.fastlane.tools/best-practices/source-control/

*/fastlane/report.xml
*/fastlane/Preview.html
*/fastlane/screenshots

# Bundle artifact
*.jsbundle

# Ruby / CocoaPods
/ios/Pods/
/vendor/bundle/
9 changes: 9 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module.exports = {
arrowParens: 'avoid',
bracketSameLine: true,
bracketSpacing: false,
singleQuote: true,
semi: false,
trailingComma: 'none',
tabWidth: 4
}
1 change: 1 addition & 0 deletions .ruby-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2.7.5
1 change: 1 addition & 0 deletions .watchmanconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
84 changes: 84 additions & 0 deletions CHALLENGE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
# The Pleo Mobile Challenge

Here at Pleo we love space. For example, we name all our microservices after
moons of the solar system. But before you get to the moons, you have to go
through rockets. Welcome to our mobile challenge!

We've built a simple mobile app that displays information about rocket launches,
fetched from the unofficial SpaceX API V3 at
[spacexdata.com](https://docs.spacexdata.com/?version=latest). We want you to
make a few changes to the app.

## Tasks

### **1. Fix a bug**

The team discovered that the launch datetime on the launch details screen is displayed in the timezone of the app's user. However, the intent was to show it in the local timezone of the launch site while still displaying the timezone offset.

Consider the following example:
- A rocket is launched November 21, 2020 at 09:17 in local time California, US (timezone UTC-8)
- Currently, if the user of the app is located in Copenhagen (timezone GMT+1), they will see the launch time as "November 21, 2020, 6:17 PM GMT+1".
- Instead they should see the launch time displayed in the launch sites local time zone, as "November 21, 2020, 9:17 AM UTC-8"

After a discussion the team decided to make the change. You picked up that ticket.


#### Guidelines for Task 1

- Treat this as if you fixed a bug in an app you work on together with a team,
and the app is in production.

### **2. Build a feature**

We would like you to add a "favorites" feature to the app. The requirements are:

- A user can mark - "star" - launches or launch pads as favorites - both from
the list and details page for all items
- A list of favorites is available as a third tab in the tab bar.
- From the list, the user can navigate to the favorite items
- The user is able to remove items from the list (from within the list and on
the details page of an item that is currently in the list)
- The list is persisted after the app is closed (but everything is stored
locally for now)

#### Guidelines for Task 2

- Treat this as if you implemented a new feature in an app you work on together
with a team, and the app is in production.
- This app is not finished, there will be more pages added in the future, and
the feature you're implementing might be extended - consider that when
building your solution.
- When in doubt about the design or functionality, make a decision yourself.
- Try not to spend more than a few hours on this task. You can use the PR description
to list and discuss the things you decided to de-scope, potential next steps etc.

### **3. Impress us**

This last task is a chance for you to impress us. What you do is really up to
you - show us your best skills, be creative and try not to spend more than a few
hours. You can add a new feature (e.g. filtering of lists), or a whole new
section to the app (explore the API, there is a ton we haven't used yet), add a UI test suite,
improve the tooling or app's architecture, add beautiful animations, etc.

#### Guidelines for Task 3

- Treat this last task as a little hackathon - no need for covering
all edge cases - although the code quality still matters.
- Scope the work so you can finish within a few hours - you can use the PR
description to list and discuss the things you decided to de-scope.

## Practicalities

When you're ready to work on the challenge, clone (and not fork) the repo and
implement each task as a separate pull request against your version of the repo.
Prepare the PRs as if you would when contributing to a project you develop with
a team. Merge each PR when you're done with a task.

When you're ready to submit your challenge, share the link to your repo with us.
If you prefer to keep it private, we will provide you with some emails to invite
to the repo.

We're excited to have you take on this challenge and looking forward to seeing
your solution.

Happy coding!
6 changes: 6 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
source 'https://rubygems.org'

# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
ruby '2.7.5'

gem 'cocoapods', '~> 1.11', '>= 1.11.2'
100 changes: 100 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
GEM
remote: https://rubygems.org/
specs:
CFPropertyList (3.0.5)
rexml
activesupport (6.1.5)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
tzinfo (~> 2.0)
zeitwerk (~> 2.3)
addressable (2.8.0)
public_suffix (>= 2.0.2, < 5.0)
algoliasearch (1.27.5)
httpclient (~> 2.8, >= 2.8.3)
json (>= 1.5.1)
atomos (0.1.3)
claide (1.1.0)
cocoapods (1.11.3)
addressable (~> 2.8)
claide (>= 1.0.2, < 2.0)
cocoapods-core (= 1.11.3)
cocoapods-deintegrate (>= 1.0.3, < 2.0)
cocoapods-downloader (>= 1.4.0, < 2.0)
cocoapods-plugins (>= 1.0.0, < 2.0)
cocoapods-search (>= 1.0.0, < 2.0)
cocoapods-trunk (>= 1.4.0, < 2.0)
cocoapods-try (>= 1.1.0, < 2.0)
colored2 (~> 3.1)
escape (~> 0.0.4)
fourflusher (>= 2.3.0, < 3.0)
gh_inspector (~> 1.0)
molinillo (~> 0.8.0)
nap (~> 1.0)
ruby-macho (>= 1.0, < 3.0)
xcodeproj (>= 1.21.0, < 2.0)
cocoapods-core (1.11.3)
activesupport (>= 5.0, < 7)
addressable (~> 2.8)
algoliasearch (~> 1.0)
concurrent-ruby (~> 1.1)
fuzzy_match (~> 2.0.4)
nap (~> 1.0)
netrc (~> 0.11)
public_suffix (~> 4.0)
typhoeus (~> 1.0)
cocoapods-deintegrate (1.0.5)
cocoapods-downloader (1.6.2)
cocoapods-plugins (1.0.0)
nap
cocoapods-search (1.0.1)
cocoapods-trunk (1.6.0)
nap (>= 0.8, < 2.0)
netrc (~> 0.11)
cocoapods-try (1.2.0)
colored2 (3.1.2)
concurrent-ruby (1.1.10)
escape (0.0.4)
ethon (0.15.0)
ffi (>= 1.15.0)
ffi (1.15.5)
fourflusher (2.3.1)
fuzzy_match (2.0.4)
gh_inspector (1.1.3)
httpclient (2.8.3)
i18n (1.10.0)
concurrent-ruby (~> 1.0)
json (2.6.1)
minitest (5.15.0)
molinillo (0.8.0)
nanaimo (0.3.0)
nap (1.1.0)
netrc (0.11.0)
public_suffix (4.0.6)
rexml (3.2.5)
ruby-macho (2.5.1)
typhoeus (1.4.0)
ethon (>= 0.9.0)
tzinfo (2.0.4)
concurrent-ruby (~> 1.0)
xcodeproj (1.21.0)
CFPropertyList (>= 2.3.3, < 4.0)
atomos (~> 0.1.3)
claide (>= 1.0.2, < 2.0)
colored2 (~> 3.1)
nanaimo (~> 0.3.0)
rexml (~> 3.2.4)
zeitwerk (2.5.4)

PLATFORMS
ruby

DEPENDENCIES
cocoapods (~> 1.11, >= 1.11.2)

RUBY VERSION
ruby 2.7.5p203

BUNDLED WITH
2.3.17
26 changes: 26 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
![Drawing of a rocket launching with Pleo logo on the side](https://repository-images.githubusercontent.com/255552950/c9991080-ff11-11ea-8706-5d40322f68fe)

# Space Rockets app


### [🚀 See the app in action 🚀](https://user-images.githubusercontent.com/8324312/181737129-d3f98d82-219c-4139-8e1f-984f6e308bcb.mov)

### [👉 Go to the challenge 👈](./CHALLENGE.md)

---

## Build and run

Follow the [React Native CLI Quickstart](https://reactnative.dev/docs/environment-setup) guide to build and run the app.

## Technologies

This project was bootstrapped with the [React Native TypeScript Template](https://github.com/react-native-community/react-native-template-typescript) and the following technologies:
- [React Native](https://reactnative.dev/docs/0.68/getting-started) - The App is build with React Native.
- [TypeScript](https://www.typescriptlang.org/docs/handbook/intro.html) - Source code is written in TypeScript.
- [React Native Navigation](https://github.com/wix/react-native-navigation) - Navigation library based on native app behaviour.
- [SpaceX API](https://docs.spacexdata.com/?version=latest) - We use V3 of the unofficial SpaceX API. No credentials are needed.
- [SWR](https://swr.now.sh/) - Data fetching and caching library [for react native](https://swr.vercel.app/docs/advanced/react-native).
- [Material Community Icons](https://materialdesignicons.com) - Icons wrapped for React Native with [react-native-vector-icons](https://github.com/oblador/react-native-vector-icons)
- [timeago.js](https://timeago.org/) - Tiny library to display human-readable
relative time difference
14 changes: 14 additions & 0 deletions __tests__/App-test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/**
* @format
*/

import 'react-native'
import React from 'react'

// Note: test renderer must be required after react-native.
import renderer from 'react-test-renderer'
import {Text} from 'react-native'

it('renders correctly', () => {
renderer.create(<Text>{'hello'}</Text>)
})
55 changes: 55 additions & 0 deletions android/app/_BUCK
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# To learn about Buck see [Docs](https://buckbuild.com/).
# To run your application with Buck:
# - install Buck
# - `npm start` - to start the packager
# - `cd android`
# - `keytool -genkey -v -keystore keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US"`
# - `./gradlew :app:copyDownloadableDepsToLibs` - make all Gradle compile dependencies available to Buck
# - `buck install -r android/app` - compile, install and run application
#

load(":build_defs.bzl", "create_aar_targets", "create_jar_targets")

lib_deps = []

create_aar_targets(glob(["libs/*.aar"]))

create_jar_targets(glob(["libs/*.jar"]))

android_library(
name = "all-libs",
exported_deps = lib_deps,
)

android_library(
name = "app-code",
srcs = glob([
"src/main/java/**/*.java",
]),
deps = [
":all-libs",
":build_config",
":res",
],
)

android_build_config(
name = "build_config",
package = "com.spacerockets",
)

android_resource(
name = "res",
package = "com.spacerockets",
res = "src/main/res",
)

android_binary(
name = "app",
keystore = "//android/keystores:debug",
manifest = "src/main/AndroidManifest.xml",
package_type = "debug",
deps = [
":app-code",
],
)
Loading

0 comments on commit 69215a1

Please sign in to comment.