-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit cee4428
Showing
33 changed files
with
9,014 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
module.exports = { | ||
root: true, | ||
extends: '@react-native-community', | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
[ignore] | ||
; We fork some components by platform | ||
.*/*[.]android.js | ||
|
||
; Ignore "BUCK" generated dirs | ||
<PROJECT_ROOT>/\.buckd/ | ||
|
||
; Ignore polyfills | ||
node_modules/react-native/Libraries/polyfills/.* | ||
|
||
; These should not be required directly | ||
; require from fbjs/lib instead: require('fbjs/lib/warning') | ||
node_modules/warning/.* | ||
|
||
; Flow doesn't support platforms | ||
.*/Libraries/Utilities/LoadingView.js | ||
|
||
[untyped] | ||
.*/node_modules/@react-native-community/cli/.*/.* | ||
|
||
[include] | ||
|
||
[libs] | ||
node_modules/react-native/interface.js | ||
node_modules/react-native/flow/ | ||
|
||
[options] | ||
emoji=true | ||
|
||
esproposal.optional_chaining=enable | ||
esproposal.nullish_coalescing=enable | ||
|
||
module.file_ext=.js | ||
module.file_ext=.json | ||
module.file_ext=.ios.js | ||
|
||
munge_underscores=true | ||
|
||
module.name_mapper='^react-native/\(.*\)$' -> '<PROJECT_ROOT>/node_modules/react-native/\1' | ||
module.name_mapper='^@?[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> '<PROJECT_ROOT>/node_modules/react-native/Libraries/Image/RelativeImageStub' | ||
|
||
suppress_type=$FlowIssue | ||
suppress_type=$FlowFixMe | ||
suppress_type=$FlowFixMeProps | ||
suppress_type=$FlowFixMeState | ||
|
||
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native\\(_ios\\)?_\\(oss\\|fb\\)[a-z,_]*\\)?)\\) | ||
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native\\(_ios\\)?_\\(oss\\|fb\\)[a-z,_]*\\)?)\\)?:? #[0-9]+ | ||
suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError | ||
|
||
[lints] | ||
sketchy-null-number=warn | ||
sketchy-null-mixed=warn | ||
sketchy-number=warn | ||
untyped-type-import=warn | ||
nonstrict-import=warn | ||
deprecated-type=warn | ||
unsafe-getters-setters=warn | ||
inexact-spread=warn | ||
unnecessary-invariant=warn | ||
signature-verification-failure=warn | ||
deprecated-utility=error | ||
|
||
[strict] | ||
deprecated-type | ||
nonstrict-import | ||
sketchy-null | ||
unclear-type | ||
unsafe-getters-setters | ||
untyped-import | ||
untyped-type-import | ||
|
||
[version] | ||
^0.113.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
*.pbxproj -text |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
# 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 | ||
|
||
# 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 | ||
|
||
# CocoaPods | ||
/ios/Pods/ | ||
|
||
# Project exclude paths | ||
/android/ | ||
/app/ | ||
/ios/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
module.exports = { | ||
bracketSpacing: false, | ||
jsxBracketSameLine: true, | ||
singleQuote: true, | ||
trailingComma: 'all', | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# ![RealWorld Example App](logo.png) | ||
|
||
> #### This application is a port of [web version](https://github.com/jacekschae/conduit) for react native | ||
> ### [ClojureScript](https://clojurescript.org/) and [re-frame](https://github.com/Day8/re-frame) codebase containing real world examples (CRUD, auth, advanced patterns, etc) that adheres to the [RealWorld](https://github.com/gothinkster/realworld-example-apps) spec and API. | ||
### [App creation process and demo (youtube)]() [Demo APK]() [RealWorld](https://github.com/gothinkster/realworld) | ||
|
||
This codebase was created to demonstrate a fully fledged react native application built with | ||
[ClojureScript](https://clojurescript.org/) and [re-frame](https://github.com/Day8/re-frame) including CRUD operations, | ||
authentication, routing, pagination, and more. | ||
|
||
For more information on how this works with other frontends/backends, head over to the | ||
[RealWorld](https://github.com/gothinkster/realworld) repo. | ||
|
||
Learn how to build similar project with [Learn re-frame](https://www.learnreframe.com/) | ||
|
||
|
||
## Setup And Run | ||
|
||
#### Copy repository | ||
```shell | ||
git clone https://github.com/flexsurfer/conduitrn.git && cd conduitrn | ||
``` | ||
|
||
#### Install dependencies | ||
```shell | ||
yarn install || npm install | ||
``` | ||
|
||
#### Install pods for ios | ||
```shell | ||
cd ios; pod install; cd ../ | ||
``` | ||
|
||
#### Run dev server | ||
```shell | ||
yarn dev || npm run dev | ||
``` | ||
|
||
#### Run metro bundler | ||
|
||
```shell | ||
yarn start || npm run start | ||
``` | ||
|
||
#### Run the app | ||
|
||
```shell | ||
yarn ios || npm run ios | ||
``` | ||
OR | ||
```shell | ||
yarn android || npm run android | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"name": "conduitrn", | ||
"displayName": "conduitrn" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module.exports = { | ||
presets: ['module:metro-react-native-babel-preset'], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{:deps {org.clojure/clojure {:mvn/version "1.10.0"} | ||
org.clojure/clojurescript {:mvn/version "1.10.520"} | ||
reagent {:mvn/version "0.10.0"} | ||
re-frame {:mvn/version "0.10.7"} | ||
superstructor/re-frame-fetch-fx {:mvn/version "0.0.2"} | ||
rn-shadow-steroid {:mvn/version "0.2.5"} | ||
re-frame-steroid {:mvn/version "0.1.1"} | ||
cljs-bean {:mvn/version "1.3.0"}}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
import "./app/index.js"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/** | ||
* Metro configuration for React Native | ||
* https://github.com/facebook/react-native | ||
* | ||
* @format | ||
*/ | ||
|
||
module.exports = { | ||
transformer: { | ||
getTransformOptions: async () => ({ | ||
transform: { | ||
experimentalImportSupport: false, | ||
inlineRequires: false, | ||
}, | ||
}), | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
{ | ||
"name": "conduitrn", | ||
"version": "0.0.1", | ||
"private": true, | ||
"scripts": { | ||
"dev": "shadow-cljs watch app", | ||
"android": "react-native run-android", | ||
"ios": "react-native run-ios", | ||
"start": "react-native start", | ||
"test": "jest", | ||
"lint": "eslint .", | ||
"re-frisk": "shadow-cljs run re-frisk-remote.core/start" | ||
}, | ||
"dependencies": { | ||
"@react-native-community/async-storage": "^1.11.0", | ||
"@react-native-community/masked-view": "^0.1.10", | ||
"@react-navigation/bottom-tabs": "^5.5.1", | ||
"@react-navigation/native": "^5.5.0", | ||
"@react-navigation/stack": "^5.4.1", | ||
"react": "16.11.0", | ||
"react-dom": "16.13.0", | ||
"react-native": "0.62.2", | ||
"react-native-gesture-handler": "^1.6.1", | ||
"react-native-reanimated": "^1.9.0", | ||
"react-native-safe-area-context": "^3.0.2", | ||
"react-native-screens": "^2.8.0", | ||
"react-native-splash-screen": "^3.2.0", | ||
"react-native-vector-icons": "^6.6.0" | ||
}, | ||
"devDependencies": { | ||
"@babel/core": "^7.9.6", | ||
"@babel/runtime": "^7.9.6", | ||
"@react-native-community/eslint-config": "^1.1.0", | ||
"babel-jest": "^26.0.1", | ||
"eslint": "^7.1.0", | ||
"jest": "^26.0.1", | ||
"metro-react-native-babel-preset": "^0.59.0", | ||
"react-test-renderer": "16.11.0" | ||
}, | ||
"jest": { | ||
"preset": "react-native" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{:source-paths ["src"] | ||
|
||
:dependencies [[reagent "0.10.0"] | ||
[re-frame "0.12.0"] | ||
[superstructor/re-frame-fetch-fx "0.0.2"] | ||
[re-frisk-remote "1.3.3"] | ||
[rn-shadow-steroid "0.2.5"] | ||
[re-frame-steroid "0.1.1"] | ||
[cljs-bean "1.3.0"]] | ||
|
||
:builds {:app {:target :react-native | ||
:output-dir "app" | ||
:init-fn conduit.core/init | ||
|
||
:compiler-options {:closure-defines | ||
{re-frame.trace/trace-enabled? true}} | ||
|
||
:devtools {:after-load steroid.rn.core/reload | ||
:build-notify steroid.rn.core/build-notify | ||
:preloads [re-frisk-remote.preload]}}}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
(ns conduit.api | ||
(:require [clojure.string :as string])) | ||
|
||
(def api-url "https://conduit.productionready.io/api") | ||
|
||
(defn endpoint | ||
"Concat any params to api-url separated by /" | ||
[& params] | ||
(string/join "/" (concat [api-url] params))) | ||
|
||
(defn auth-header | ||
"Get user token and format for API authorization" | ||
[db] | ||
(when-let [token (get-in db [:user :token])] | ||
{"Authorization" (str "Token " token)})) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
(ns conduit.core | ||
(:require [steroid.rn.core :as rn] | ||
[conduit.ui.views :as views] | ||
conduit.events | ||
conduit.subs | ||
conduit.fx)) | ||
|
||
;; -- Entry Point ------------------------------------------------------------- | ||
;; shadow-cljs.edn :init-fn conduit.core/init | ||
|
||
(defn init [] | ||
(rn/register-comp "conduitrn" views/root-stack)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
(ns conduit.db) | ||
|
||
;; -- Default app-db Value --------------------------------------------------- | ||
;; | ||
;; When the application first starts, this will be the value put in app-db | ||
;; Look in: `events.cljs` for the registration of :initialise-app handler | ||
;; | ||
(def default-db {:active-page :home}) ;; what gets put into app-db by default. |
Oops, something went wrong.