My-Contacts
A Prototype app using react native app to sync contacts from phone, edit contact details and add new contacts
Features | Demo |
---|---|
|
ContactsApp.mp4 |
Pre-requisites
- Android Studio
- Visual Code Editor
Setup
git clone git@github.com:rameshvishnoi90904/My-Contacts.git
cd My-Contacts
npm install
react-native run-android
Folder Structure
Project follows very simple folder structure
src
: This folder is the main container of all the code inside your applicationhelper
: Folder to store any common generic functions that can be reusedcomponents
: Folder to store any common component that you use through your app (such as a generic LoadingSpinner)context
: Folder that contains all your React Context Api files.mockdata
: Folder to store any mockData for testing purpose .screens
: Folder that contains all your application screens/features.HomeScreen.js
: A Functional component using hooks, context apis for maintaining logic for syncing contacts from phone + previewing contacts in list format using FlatListPreviewContact.js
: (Functional component with hooks) Preview contact details such as email id, phone number, first name and last nameEditContact.js
: (Functional component with hooks) This contains logic for creating new/edit contact and save changes into phone
App.js
: This contains navigation logic, syncing contacts from async storage__test__
: This folder contains all jest testcasesindex.test.js
: This contains function test case for helper functionsHomeScreen.test.js
: Test case for contact list preview using mockdataPreviewContact.test.js
: Test case for matching user name, email and phonenumberEditContact.test.js
: Snapshot test case
Global Store
Global store is maintained using React inbuild context api and hooks. I have used reducer like update
function to compute new state.
Offline usage
AsyncStore is used for retaining user actions, results such as contact list from contacts api.
Code/Commit readability
JSDocs is used to maintain comments across codebase, main reason for using JSDocs formatting standards is scope for creating and deploying documentation
Conventional Commits approach is used to maintain human and machine readable commit messages, this can be futher enhanced to create changelogs, trigger CI/CD pipeline, semantic version bump