Architecture
Data Flow
How data moves through the application
Data Flow
Understanding how data flows through FirstDevJob helps when debugging or adding features.
Request Types
Queries (Read Operations)
Queries fetch data and automatically subscribe to updates:
// Component subscribes to job listings
const jobs = useQuery(api.jobs.listApproved);
// Automatically updates when data changesMutations (Write Operations)
Mutations modify data and trigger subscription updates:
// Submit a new job
const submitJob = useMutation(api.jobs.submit);
await submitJob({
title: "Junior Developer",
company: "Acme Inc",
// ...
});Authentication Flow
- User clicks Sign In
- Clerk modal opens
- User authenticates (OAuth or email)
- Clerk returns JWT token
- Convex validates token on each request
- User identity available in backend functions
Job Lifecycle
Submit → Pending → Approved → Listed
↘ Rejected
After 2 weeks:
Approved → Outdated → Deleted (30 days)
Pending/Rejected → DeletedReal-time Updates
Convex automatically pushes updates to subscribed clients:
- Admin approves a job
- Convex mutation updates database
- All clients with active
listApprovedquery receive update - UI re-renders with new data
No polling or manual refresh needed.