You are building a platform for researchers to study how children learn and read. There are two primary ways of using the platform, as an administrator or as a participant. Participants (children, parents, and teachers) take assessments (called tasks) and the data is recorded in Firebase (Firestore). The tasks come from the @levante-framework/core-tasks package.
Firekit is a service layer for interacting with Firebase. It handles the Firebase client instance as well as authentication and handles calls to cloud functions. We are in the process of migrating away from Firekit.
We are updating data model names. The mapping is: child/children (frontend) = student/students (backend), caregiver = parent, site = district, cohort = group, assignment = administration. Note: "assignment" also refers to items in a user's assignment sub-collection, for which a distinct name is still to be determined.
- Development:
npm run dev(with emulator) ornpm run dev:db(without emulator) - Build:
npm run build:dev(dev) ornpm run build:prod(production) - Lint:
npm run lint(auto-fix) ornpm run check-format(check only) - Format:
npm run format(Prettier with 120 char width, single quotes, trailing commas) - Test All:
npm test(runs Vitest with coverage) - Test Single:
npm test -- path/to/test.jsornpx vitest run path/to/test.js - Test Watch:
npm run test:watch
- Language: Use TypeScript for .ts files, JavaScript for .js files (migration in progress)
- Vue: Use
<script setup>syntax with Composition API, avoid Options API - Imports: Group by type - Vue/external libs, then @/ aliases, then relative paths
- Components: PascalCase names (e.g.,
NavBar.vue), use PrimeVue v4 components prefixed withPv - Composables: camelCase with
useprefix (e.g.,useAuthStore.ts) - State: Use Pinia stores, VueUse utilities, and Tanstack Query for data fetching
- Styling: Tailwind CSS with mobile-first approach, avoid inline styles
- Functions: Arrow functions for methods/computed,
functionkeyword for pure functions - Error Handling: Use try-catch blocks, handle Firebase errors gracefully
- Testing: Use Vitest with @testing-library/vue, mock Firebase services
- No Comments: Avoid adding comments unless explicitly requested
- Documentation: Always consult the official documentation for all packages and dependencies. Regularly review updates to ensure you are using the latest recommended practices.