Skip to content

Commit 854dcfe

Browse files
B3RN153kaseywrightJoel-Joseph-GeorgeLijuJacob08vipinpaul
authored
Task/architecture of project (#24)
* Initial commit * init commit This is a basic app scaffold from `bun create expo-app fluent-mobile` * Add architecture documentation with directory structure * bump version * Initial commit Generated by react-native@0.84.1 * Established a local enviroment in react native cli * Updated README * Updated README * Edited README * updated package.json * added fluent logo * Update bundle identifier * Added format * Basic Navigation * lint and github actions * lint and github actions * Updated readme * Handled deprecations * test fluent api integration (#13) * test fluent api integration * fixed lint and format error * fixed the test files * installed opsqlite * installed TanStack * Updated sqlite package * Database initialised * updations in read me * specified the node version * Added env * Api integrations * Wipe expo starter for PoC merge * Mvp poc mobile companion app (#11) * Initial commit Generated by react-native@0.84.1 * Established a local enviroment in react native cli * Updated README * Updated README * Edited README * updated package.json * added fluent logo * Update bundle identifier * Added format * Basic Navigation * lint and github actions * lint and github actions * Updated readme * Handled deprecations * test fluent api integration (#13) * test fluent api integration * fixed lint and format error * fixed the test files * installed opsqlite * installed TanStack * removed unwanted code * updations in read me * specified the node version --------- Co-authored-by: joel-joseph-george <joelpadeesseril@gmail.com> Co-authored-by: Liju M Jacob <93033055+LijuJacob08@users.noreply.github.com> Co-authored-by: vipinpaul <vipin.paul@bridgeconn.com> Co-authored-by: kaseywright <kasey.wright@biblionexus.org> * Defined types in place of any * Implemented logging * added logger test * Rearchtectured the project files structure * Fixed issues given in the comments * fix: prevent test crash by mocking env variables * Task/mobile api integration and initial datasync (#20) * Initial commit Generated by react-native@0.84.1 * Established a local enviroment in react native cli * Updated README * Updated README * Edited README * updated package.json * added fluent logo * Update bundle identifier * Added format * Basic Navigation * lint and github actions * lint and github actions * Updated readme * Handled deprecations * test fluent api integration (#13) * test fluent api integration * fixed lint and format error * fixed the test files * installed opsqlite * installed TanStack * Updated sqlite package * Database initialised * updations in read me * specified the node version * Added env * Api integrations * Defined types in place of any * Implemented logging * added logger test --------- Co-authored-by: joel-joseph-george <joelpadeesseril@gmail.com> Co-authored-by: Liju M Jacob <93033055+LijuJacob08@users.noreply.github.com> Co-authored-by: vipinpaul <vipin.paul@bridgeconn.com> * Remove unwanted files * removed files * remove .env file * Added files to eslint.config.ts * updated .gitignore' --------- Co-authored-by: Kasey Wright <kasey@kaseywright.com> Co-authored-by: kaseywright <kasey.wright@biblionexus.org> Co-authored-by: joel-joseph-george <joelpadeesseril@gmail.com> Co-authored-by: Liju M Jacob <93033055+LijuJacob08@users.noreply.github.com> Co-authored-by: vipinpaul <vipin.paul@bridgeconn.com>
1 parent 0a6bb45 commit 854dcfe

21 files changed

Lines changed: 247 additions & 314 deletions

File tree

.env

Lines changed: 0 additions & 5 deletions
This file was deleted.

.github/workflows/test.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,6 @@ jobs:
1818
run: npm ci
1919

2020
- name: Run tests
21+
env:
22+
FLUENT_USER_EMAIL: 'test@example.com'
2123
run: npm test -- --ci

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,3 +73,7 @@ yarn-error.log
7373
!.yarn/releases
7474
!.yarn/sdks
7575
!.yarn/versions
76+
77+
# Environment files
78+
.env
79+
.env.*

App.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { initializeDatabase } from './src/db/index';
55
import AppNavigator from './src/navigation/AppNavigator';
66
import { NavigationContainer } from '@react-navigation/native';
77
import { SafeAreaProvider } from 'react-native-safe-area-context';
8-
import { syncAllData } from './src/services/syncServices';
8+
import { syncAllData } from './src/services/sync';
99
import { FLUENT_USER_EMAIL } from '@env';
1010

1111
const log = logger.create('App');

__tests__/App.test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jest.mock('../src/navigation/AppNavigator', () => {
4343
const { View } = require('react-native');
4444
return () => MockReact.createElement(View, { testID: 'app-navigator' });
4545
});
46-
jest.mock('../src/api/fluent-api.test', () => ({
46+
jest.mock('../src/services/fluent-api.test', () => ({
4747
runApiIntegrationTest: jest.fn(() => Promise.resolve()),
4848
}));
4949

@@ -63,7 +63,7 @@ jest.mock('../src/db/index', () => ({
6363
initializeDatabase: jest.fn(() => Promise.resolve()),
6464
}));
6565

66-
jest.mock('../src/services/syncServices', () => ({
66+
jest.mock('../src/services/sync', () => ({
6767
syncAllData: jest.fn(() => Promise.resolve()),
6868
}));
6969

eslint.config.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,15 @@ export default [
6363
rules: {
6464
'jest/no-disabled-tests': 'warn',
6565
'jest/no-focused-tests': 'error',
66+
'no-console': 'off',
67+
'@typescript-eslint/no-explicit-any': 'off',
68+
},
69+
},
70+
{
71+
files: ['src/utils/logger.ts'],
72+
rules: {
73+
'no-console': 'off',
74+
'@typescript-eslint/no-explicit-any': 'off',
6675
},
6776
},
6877
];

src/app/appStyles.ts

Lines changed: 200 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,200 @@
1+
import { StyleSheet } from 'react-native';
2+
3+
export const appStyles = StyleSheet.create({
4+
container: {
5+
flex: 1,
6+
paddingHorizontal: 16,
7+
},
8+
centered: {
9+
justifyContent: 'center',
10+
},
11+
titleLg: {
12+
fontSize: 20,
13+
fontWeight: '700',
14+
},
15+
titleMd: {
16+
fontSize: 18,
17+
fontWeight: '700',
18+
},
19+
subtitle: {
20+
fontSize: 14,
21+
marginTop: 2,
22+
},
23+
sectionHeaderText: {
24+
fontSize: 16,
25+
fontWeight: '500',
26+
},
27+
cardTitle: {
28+
fontSize: 16,
29+
fontWeight: '600',
30+
},
31+
cardSubtitle: {
32+
fontSize: 14,
33+
marginTop: 3,
34+
},
35+
emptyText: {
36+
color: '#666',
37+
fontSize: 16,
38+
},
39+
noVersesText: {
40+
fontSize: 14,
41+
color: '#999',
42+
},
43+
listContent: {
44+
gap: 12,
45+
},
46+
scrollContent: {
47+
gap: 12,
48+
paddingBottom: 8,
49+
},
50+
cardRow: {
51+
flexDirection: 'row',
52+
alignItems: 'center',
53+
borderRadius: 12,
54+
borderWidth: 1,
55+
borderColor: '#d1d1d6',
56+
padding: 16,
57+
gap: 12,
58+
},
59+
cardColumn: {
60+
borderRadius: 12,
61+
borderWidth: 1,
62+
borderColor: '#d1d1d6',
63+
padding: 16,
64+
},
65+
cardText: {
66+
flex: 1,
67+
},
68+
backBtn: {
69+
flexDirection: 'row',
70+
alignItems: 'center',
71+
gap: 8,
72+
paddingVertical: 20,
73+
},
74+
logoContainer: {
75+
alignItems: 'center',
76+
paddingVertical: 28,
77+
},
78+
sectionHeader: {
79+
flexDirection: 'row',
80+
alignItems: 'center',
81+
justifyContent: 'center',
82+
gap: 10,
83+
borderWidth: 1,
84+
borderColor: '#d1d1d6',
85+
borderRadius: 12,
86+
padding: 14,
87+
marginBottom: 12,
88+
},
89+
playerRow: {
90+
flexDirection: 'row',
91+
alignItems: 'center',
92+
gap: 10,
93+
marginBottom: 12,
94+
},
95+
playBtn: {
96+
width: 36,
97+
height: 36,
98+
borderRadius: 18,
99+
backgroundColor: '#1a6ef5',
100+
alignItems: 'center',
101+
justifyContent: 'center',
102+
},
103+
progressTrack: {
104+
flex: 1,
105+
height: 4,
106+
backgroundColor: '#e0e0e0',
107+
borderRadius: 2,
108+
},
109+
progressFill: {
110+
width: '20%',
111+
height: 4,
112+
backgroundColor: '#1a6ef5',
113+
borderRadius: 2,
114+
},
115+
progressFillRecorded: {
116+
width: '40%',
117+
height: 4,
118+
backgroundColor: '#1a6ef5',
119+
borderRadius: 2,
120+
},
121+
accordionHeader: {
122+
flexDirection: 'row',
123+
justifyContent: 'space-between',
124+
alignItems: 'center',
125+
borderWidth: 1,
126+
borderColor: '#d1d1d6',
127+
borderRadius: 8,
128+
paddingHorizontal: 14,
129+
paddingVertical: 10,
130+
marginTop: 4,
131+
},
132+
accordionLabel: {
133+
fontSize: 14,
134+
},
135+
sourceTextScroll: {
136+
maxHeight: 120,
137+
marginTop: 10,
138+
borderRadius: 8,
139+
paddingHorizontal: 12,
140+
},
141+
sourceText: {
142+
fontSize: 14,
143+
lineHeight: 24,
144+
color: '#333',
145+
},
146+
recordBtn: {
147+
width: 64,
148+
height: 64,
149+
borderRadius: 32,
150+
backgroundColor: '#e53935',
151+
alignItems: 'center',
152+
justifyContent: 'center',
153+
alignSelf: 'center',
154+
marginVertical: 12,
155+
},
156+
deleteBtn: {
157+
width: 48,
158+
height: 48,
159+
borderRadius: 24,
160+
backgroundColor: '#e53935',
161+
alignItems: 'center',
162+
justifyContent: 'center',
163+
alignSelf: 'center',
164+
marginTop: 8,
165+
},
166+
chipsScroll: {
167+
flexGrow: 0,
168+
paddingVertical: 12,
169+
},
170+
chipsContent: {
171+
gap: 8,
172+
paddingHorizontal: 2,
173+
},
174+
chip: {
175+
minWidth: 48,
176+
paddingHorizontal: 14,
177+
paddingVertical: 12,
178+
borderRadius: 10,
179+
borderWidth: 1,
180+
borderColor: '#d1d1d6',
181+
alignItems: 'center',
182+
justifyContent: 'center',
183+
},
184+
activeChip: {
185+
borderWidth: 2,
186+
borderColor: '#1a6ef5',
187+
},
188+
chipText: {
189+
fontSize: 16,
190+
},
191+
activeChipText: {
192+
color: '#1a6ef5',
193+
fontWeight: '600',
194+
},
195+
chipMic: {
196+
position: 'absolute',
197+
top: 3,
198+
right: 4,
199+
},
200+
});
Lines changed: 4 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,17 @@ import {
44
Text,
55
FlatList,
66
TouchableOpacity,
7-
StyleSheet,
87
ActivityIndicator,
98
} from 'react-native';
109
import { logger } from '../../utils/logger';
11-
import { Project } from '../../types/dbTypes';
10+
import { Project } from '../../types/db/types';
1211
import { getProjects } from '../../db/queries';
1312
import { useNavigation } from '@react-navigation/native';
1413
import FluentLogo from '../../assets/icons/fluent-logo.svg';
15-
import { RootStackParamList } from '../../navigation/types';
14+
import { RootStackParamList } from '../../types/navigation/types';
1615
import { StackNavigationProp } from '@react-navigation/stack';
1716
import { Ionicons } from '@react-native-vector-icons/ionicons';
17+
import { appStyles as styles } from '../appStyles';
1818

1919
const log = logger.create('ProjectListScreen');
2020
type Nav = StackNavigationProp<RootStackParamList, 'Projects'>;
@@ -64,7 +64,7 @@ export default function ProjectsScreen() {
6464
contentContainerStyle={styles.listContent}
6565
renderItem={({ item }) => (
6666
<TouchableOpacity
67-
style={styles.card}
67+
style={styles.cardRow}
6868
activeOpacity={0.7}
6969
onPress={() =>
7070
navigation.navigate('Chapters', {
@@ -88,55 +88,3 @@ export default function ProjectsScreen() {
8888
</View>
8989
);
9090
}
91-
92-
const styles = StyleSheet.create({
93-
container: {
94-
flex: 1,
95-
paddingHorizontal: 16,
96-
},
97-
logoContainer: {
98-
alignItems: 'center',
99-
paddingVertical: 28,
100-
},
101-
sectionHeader: {
102-
flexDirection: 'row',
103-
alignItems: 'center',
104-
justifyContent: 'center',
105-
gap: 10,
106-
borderWidth: 1,
107-
borderColor: '#d1d1d6',
108-
borderRadius: 12,
109-
padding: 14,
110-
marginBottom: 12,
111-
},
112-
sectionHeaderText: {
113-
fontSize: 16,
114-
fontWeight: '500',
115-
},
116-
listContent: {
117-
gap: 12,
118-
},
119-
card: {
120-
flexDirection: 'row',
121-
alignItems: 'center',
122-
borderRadius: 12,
123-
borderWidth: 1,
124-
borderColor: '#d1d1d6',
125-
padding: 16,
126-
gap: 12,
127-
},
128-
cardText: {
129-
flex: 1,
130-
},
131-
cardTitle: {
132-
fontSize: 16,
133-
fontWeight: '600',
134-
},
135-
cardSubtitle: {
136-
fontSize: 14,
137-
marginTop: 3,
138-
},
139-
centered: {
140-
justifyContent: 'center',
141-
},
142-
});

0 commit comments

Comments
 (0)