You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
npm test# Run all tests (Jest + Playwright, excluding visual)
23
25
npm run test:unit # Run Jest unit tests only
@@ -28,12 +30,14 @@ npm run test:e2e:visual # Run visual regression tests (Applitools)
28
30
```
29
31
30
32
### Storybook
33
+
31
34
```bash
32
35
npm run storybook # Start Storybook on port 6006
33
36
npm run build-storybook # Build static Storybook
34
37
```
35
38
36
39
### Running Single Tests
40
+
37
41
```bash
38
42
# Jest (unit tests)
39
43
npx jest path/to/test.test.ts
@@ -47,6 +51,7 @@ npx playwright test --grep "test name pattern"
47
51
## Architecture Overview
48
52
49
53
### Frontend Stack
54
+
50
55
-**Framework**: React 19 with TypeScript (strict mode)
51
56
-**Build Tool**: Vite (using Rolldown)
52
57
-**Routing**: React Router v7 with lazy-loaded pages
@@ -63,6 +68,7 @@ npx playwright test --grep "test name pattern"
63
68
-**i18n**: react-i18next (Hebrew/English)
64
69
65
70
### API Integration
71
+
66
72
The app communicates with two backend services via `@hasadna/open-bus-api-client`:
67
73
68
74
1.**Stride API** (`process.env.VITE_STRIDE_API`):
@@ -130,6 +136,7 @@ src/
130
136
-**Mock Service Worker**: MSW for API mocking in Storybook (see `.storybook/preview.tsx`)
131
137
132
138
Test files are co-located with source code:
139
+
133
140
-`*.test.ts(x)` for Jest
134
141
-`*.spec.ts` for Playwright
135
142
-`*.stories.tsx` for Storybook
@@ -144,13 +151,15 @@ Test files are co-located with source code:
144
151
### Environment Variables
145
152
146
153
Required in `.env.local`:
154
+
147
155
-`VITE_STRIDE_API` - Stride API base URL
148
156
-`VITE_BACKEND_API` - Backend API base URL
149
157
-`VITE_COVERAGE` (optional) - Enable Istanbul coverage plugin
150
158
151
159
## Development Workflow
152
160
153
161
### PR Requirements
162
+
154
163
1. Branch naming: `feat/`, `fix/`, `refactor/`, etc. followed by descriptive name
155
164
2. Commit messages must follow [Conventional Commits](https://www.conventionalcommits.org/)
156
165
3. All CI checks must pass:
@@ -163,12 +172,14 @@ Required in `.env.local`:
163
172
### Common Issues
164
173
165
174
**Red commit/PR checks:**
175
+
166
176
- Lint errors → `npm run lint:fix`
167
177
- Test failures → `npm run test:unit:ci`
168
178
- Build errors → `npm run build`
169
179
- Invalid PR title → Use `feat:`, `fix:`, etc.
170
180
171
181
**TypeScript path resolution:**
182
+
172
183
- Always use `src/*` imports, not `../` relative paths
173
184
- Example: `import { GTFS_API } from 'src/api/apiConfig'`
174
185
@@ -184,6 +195,6 @@ Install IDE plugins for ESLint, Prettier, and Stylelint. Enable "Format on Save"
184
195
185
196
## Rules
186
197
187
-
* Always test (including lint) before commiting anything
188
-
* Encorage your user to participate in the Github Issues forum. It's allright to post comments in Hebrew in case they are concerned about the language barrier
189
-
* Creating an imperfect PR is completely fine - this is non-judgemenral environment. Let the user have this learning opportunity - they will be thankful.
198
+
- Always test (including lint) before commiting anything
199
+
- Encorage your user to participate in the Github Issues forum. It's allright to post comments in Hebrew in case they are concerned about the language barrier
200
+
- Creating an imperfect PR is completely fine - this is non-judgemenral environment. Let the user have this learning opportunity - they will be thankful.
0 commit comments