Skip to content

Commit c2afe48

Browse files
committed
first commit
0 parents  commit c2afe48

File tree

176 files changed

+20674
-0
lines changed

Some content is hidden

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

176 files changed

+20674
-0
lines changed

.bundle/config

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
BUNDLE_PATH: "vendor/bundle"
2+
BUNDLE_FORCE_RUBY_PLATFORM: 1

.env.example

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
API_URL='https://google.com/api'

.eslintrc.js

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
module.exports = {
2+
root: true,
3+
extends: '@react-native',
4+
rules: {
5+
'react-native/no-inline-styles': 'off',
6+
'react/no-unstable-nested-components': 'off',
7+
},
8+
};

.github/workflows/coverage.yml

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: Test Coverage
2+
3+
on: [push]
4+
5+
jobs:
6+
test:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v2
10+
- name: Install Dependencies
11+
run: npm install
12+
- name: Run Tests and Generate Coverage
13+
run: npm run test -- --coverage
14+
- name: Upload Coverage to Codecov
15+
uses: codecov/codecov-action@v3

.gitignore

+76
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# OSX
2+
#
3+
.DS_Store
4+
5+
# Xcode
6+
#
7+
build/
8+
*.pbxuser
9+
!default.pbxuser
10+
*.mode1v3
11+
!default.mode1v3
12+
*.mode2v3
13+
!default.mode2v3
14+
*.perspectivev3
15+
!default.perspectivev3
16+
xcuserdata
17+
*.xccheckout
18+
*.moved-aside
19+
DerivedData
20+
*.hmap
21+
*.ipa
22+
*.xcuserstate
23+
**/.xcode.env.local
24+
25+
# Android/IntelliJ
26+
#
27+
build/
28+
.idea
29+
.gradle
30+
local.properties
31+
*.iml
32+
*.hprof
33+
.cxx/
34+
*.keystore
35+
!debug.keystore
36+
37+
# node.js
38+
#
39+
.env
40+
coverage
41+
node_modules/
42+
npm-debug.log
43+
yarn-error.log
44+
45+
# fastlane
46+
#
47+
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
48+
# screenshots whenever they are needed.
49+
# For more information about the recommended setup visit:
50+
# https://docs.fastlane.tools/best-practices/source-control/
51+
52+
**/fastlane/report.xml
53+
**/fastlane/Preview.html
54+
**/fastlane/screenshots
55+
**/fastlane/test_output
56+
57+
# Bundle artifact
58+
*.jsbundle
59+
60+
# Ruby / CocoaPods
61+
**/Pods/
62+
/vendor/bundle/
63+
64+
# Temporary files created by Metro to check the health of the file watcher
65+
.metro-health-check*
66+
67+
# testing
68+
/coverage
69+
70+
# Yarn
71+
.yarn/*
72+
!.yarn/patches
73+
!.yarn/plugins
74+
!.yarn/releases
75+
!.yarn/sdks
76+
!.yarn/versions

.prettierrc.js

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module.exports = {
2+
arrowParens: 'avoid',
3+
bracketSameLine: true,
4+
bracketSpacing: false,
5+
singleQuote: true,
6+
trailingComma: 'all',
7+
};

.watchmanconfig

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

.yarn/releases/yarn-3.6.4.cjs

+874
Large diffs are not rendered by default.

.yarnrc.yml

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
nodeLinker: node-modules
2+
3+
yarnPath: .yarn/releases/yarn-3.6.4.cjs

App.test.tsx

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
import React from 'react';
2+
import {render} from '@testing-library/react-native';
3+
import {Provider} from 'react-redux';
4+
import {PersistGate} from 'redux-persist/integration/react';
5+
import configureMockStore from 'redux-mock-store';
6+
import {NavigationContainer} from '@react-navigation/native';
7+
import App from './App';
8+
import {persistor} from './app/core/store/store';
9+
10+
// Mock necessary parts of the app
11+
jest.mock('redux-persist/integration/react', () => ({
12+
PersistGate: ({children}: {children: React.ReactNode}) => children,
13+
}));
14+
15+
jest.mock('@react-navigation/native', () => ({
16+
NavigationContainer: ({children}: {children: React.ReactNode}) => children,
17+
}));
18+
19+
// Create a mock store
20+
const mockStore = configureMockStore();
21+
const store = mockStore({});
22+
23+
describe('App', () => {
24+
it('renders correctly', () => {
25+
const {} = render(
26+
<Provider store={store}>
27+
<PersistGate loading={null} persistor={persistor}>
28+
<NavigationContainer>
29+
<App />
30+
</NavigationContainer>
31+
</PersistGate>
32+
</Provider>,
33+
);
34+
35+
expect(true).toBe(true);
36+
});
37+
});

App.tsx

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import React from 'react';
2+
import { SafeAreaProvider } from 'react-native-safe-area-context';
3+
import { NavigationContainer } from '@react-navigation/native';
4+
import { Provider } from 'react-redux';
5+
import { PersistGate } from 'redux-persist/integration/react';
6+
import store, { persistor } from './app/core/store/store';
7+
import RootNavigation from './app/core/navigation/root-navigation';
8+
9+
function App() {
10+
return (
11+
<SafeAreaProvider>
12+
<PersistGate loading={null} persistor={persistor}>
13+
<Provider store={store}>
14+
<NavigationContainer>
15+
<RootNavigation />
16+
</NavigationContainer>
17+
</Provider>
18+
</PersistGate>
19+
</SafeAreaProvider>
20+
);
21+
}
22+
23+
export default App;

Gemfile

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
source 'https://rubygems.org'
2+
3+
# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
4+
ruby ">= 2.6.10"
5+
6+
# Exclude problematic versions of cocoapods and activesupport that causes build failures.
7+
gem 'cocoapods', '>= 1.13', '!= 1.15.0', '!= 1.15.1'
8+
gem 'activesupport', '>= 6.1.7.5', '!= 7.1.0'

Gemfile.lock

+105
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
GEM
2+
remote: https://rubygems.org/
3+
specs:
4+
CFPropertyList (3.0.7)
5+
base64
6+
nkf
7+
rexml
8+
activesupport (6.1.7.8)
9+
concurrent-ruby (~> 1.0, >= 1.0.2)
10+
i18n (>= 1.6, < 2)
11+
minitest (>= 5.1)
12+
tzinfo (~> 2.0)
13+
zeitwerk (~> 2.3)
14+
addressable (2.8.7)
15+
public_suffix (>= 2.0.2, < 7.0)
16+
algoliasearch (1.27.5)
17+
httpclient (~> 2.8, >= 2.8.3)
18+
json (>= 1.5.1)
19+
atomos (0.1.3)
20+
base64 (0.2.0)
21+
claide (1.1.0)
22+
cocoapods (1.15.2)
23+
addressable (~> 2.8)
24+
claide (>= 1.0.2, < 2.0)
25+
cocoapods-core (= 1.15.2)
26+
cocoapods-deintegrate (>= 1.0.3, < 2.0)
27+
cocoapods-downloader (>= 2.1, < 3.0)
28+
cocoapods-plugins (>= 1.0.0, < 2.0)
29+
cocoapods-search (>= 1.0.0, < 2.0)
30+
cocoapods-trunk (>= 1.6.0, < 2.0)
31+
cocoapods-try (>= 1.1.0, < 2.0)
32+
colored2 (~> 3.1)
33+
escape (~> 0.0.4)
34+
fourflusher (>= 2.3.0, < 3.0)
35+
gh_inspector (~> 1.0)
36+
molinillo (~> 0.8.0)
37+
nap (~> 1.0)
38+
ruby-macho (>= 2.3.0, < 3.0)
39+
xcodeproj (>= 1.23.0, < 2.0)
40+
cocoapods-core (1.15.2)
41+
activesupport (>= 5.0, < 8)
42+
addressable (~> 2.8)
43+
algoliasearch (~> 1.0)
44+
concurrent-ruby (~> 1.1)
45+
fuzzy_match (~> 2.0.4)
46+
nap (~> 1.0)
47+
netrc (~> 0.11)
48+
public_suffix (~> 4.0)
49+
typhoeus (~> 1.0)
50+
cocoapods-deintegrate (1.0.5)
51+
cocoapods-downloader (2.1)
52+
cocoapods-plugins (1.0.0)
53+
nap
54+
cocoapods-search (1.0.1)
55+
cocoapods-trunk (1.6.0)
56+
nap (>= 0.8, < 2.0)
57+
netrc (~> 0.11)
58+
cocoapods-try (1.2.0)
59+
colored2 (3.1.2)
60+
concurrent-ruby (1.3.4)
61+
escape (0.0.4)
62+
ethon (0.16.0)
63+
ffi (>= 1.15.0)
64+
ffi (1.17.0)
65+
fourflusher (2.3.1)
66+
fuzzy_match (2.0.4)
67+
gh_inspector (1.1.3)
68+
httpclient (2.8.3)
69+
i18n (1.14.5)
70+
concurrent-ruby (~> 1.0)
71+
json (2.7.2)
72+
minitest (5.25.1)
73+
molinillo (0.8.0)
74+
nanaimo (0.3.0)
75+
nap (1.1.0)
76+
netrc (0.11.0)
77+
nkf (0.2.0)
78+
public_suffix (4.0.7)
79+
rexml (3.3.7)
80+
ruby-macho (2.5.1)
81+
typhoeus (1.4.1)
82+
ethon (>= 0.9.0)
83+
tzinfo (2.0.6)
84+
concurrent-ruby (~> 1.0)
85+
xcodeproj (1.25.0)
86+
CFPropertyList (>= 2.3.3, < 4.0)
87+
atomos (~> 0.1.3)
88+
claide (>= 1.0.2, < 2.0)
89+
colored2 (~> 3.1)
90+
nanaimo (~> 0.3.0)
91+
rexml (>= 3.3.2, < 4.0)
92+
zeitwerk (2.6.18)
93+
94+
PLATFORMS
95+
ruby
96+
97+
DEPENDENCIES
98+
activesupport (>= 6.1.7.5, != 7.1.0)
99+
cocoapods (>= 1.13, != 1.15.1, != 1.15.0)
100+
101+
RUBY VERSION
102+
ruby 2.6.10p210
103+
104+
BUNDLED WITH
105+
1.17.2

README.md

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# Merchant Abnk
2+
[![Codecov](https://codecov.io/gh/M-Julius/Merchant-Abnk/branch/main/graph/badge.svg)](https://codecov.io/gh/M-Julius/Merchant-Abnk)
3+
4+
[<img src="screenshoot/abnk.png" />](screenshot/abnk.png)
5+
Merchant Abnk is a mobile application that displays a list of merchants at abnk, with authentication by phone number, and verify by code otp.
6+
7+
## Currently includes:
8+
- [Demo](https://drive.google.com/file/d/1PPFvwRib2ypZCatcYbmaPnB2K08P4d0X/view?usp=sharing)
9+
- Built with React Native CLI
10+
- React Navigation for routing and navigation
11+
- Redux Toolkit for state management
12+
- TypeScript for type safety
13+
- Unit Testing with coverage of 88%
14+
- And more!
15+
16+
17+
## Installation
18+
19+
1. Clone this repository
20+
21+
```bash
22+
git clone https://github.com/M-Julius/Merchant-Abnk.git
23+
```
24+
25+
2. Install dependencies
26+
27+
```bash
28+
cd Merchant-Abnk
29+
yarn install
30+
```
31+
3. Setup environment in ```.env```
32+
```bash
33+
API_URL='https://api.your.com/api' # add your API_URL in here
34+
```
35+
36+
4. Run a
37+
38+
for android
39+
```bash
40+
yarn android
41+
```
42+
for ios
43+
```bash
44+
cd ios
45+
bundle install # you need to run this only once in your project.
46+
bundle exec pod install
47+
cd ..
48+
```
49+
```bash
50+
yarn ios
51+
```
52+
53+
## Feature App:
54+
- [x] Splashscreen
55+
- [x] Login with mobile number
56+
- [x] Verify OTP
57+
- [x] Homescreen - Merchant list
58+
- [x] Profile Screen
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
export default {
2+
setItem: jest.fn(),
3+
getItem: jest.fn(),
4+
removeItem: jest.fn(),
5+
};

__mocks__/api.js

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
export default {
2+
post: jest.fn(),
3+
get: jest.fn(),
4+
};

__mocks__/fileMock.js

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = 'test-file-stub';

0 commit comments

Comments
 (0)