How dincaalex/unilink works
1. Repo shape
- This is a two-part local full-stack prototype: sanmarcos-jobs/ is the React frontend, and server/ is the Express + SQLite backend.
- The root package.json only orchestrates both apps, so the diagram should show one developer command starting two separate runtimes.
2. Runtime entrypoints
- Frontend: Vite serves a single-page app from sanmarcos-jobs/src/main.jsx into index.html.
- Backend: server/index.js exposes all API endpoints under /api.
- Dev flow is local-only: frontend on 5173, backend on 3001, no external SaaS dependencies.
3. Frontend app shell
- The frontend is organized around pages, reusable components, and a global context.
- App.jsx and main.jsx provide the app shell and routing; Navbar, GlowInput, and Select are shared UI pieces.
4. Frontend state boundary
- src/context/AppDataContext.jsx is the main client-side state hub.
- It centralizes authenticated user/session data plus domain data such as jobs, student profile, company profile, and applications.
- This context is the main boundary between UI screens and backend data access.
5. Frontend data access
- src/lib/api.js is the HTTP client used by the UI to talk to the backend.
- src/lib/useLocalStorageState.js suggests some client-side persistence for UI/session-related state, but the authoritative data lives in SQLite on the server.
6. Frontend screens and flows
- The main pages are: LoginPage, FeedPage, JobDetailPage, NewJobPage, ProfilePage, EditProfilePage, and CvPrintPage.
- The user flow is: login → browse/filter feed → open job detail → apply or publish (depending on role) → manage profile/CV.
- CvPrintPage is a print-friendly view intended for the browser’s print/PDF dialog rather than a server-side PDF service.
7. Backend API boundary
- server/index.js is the application boundary for all business operations.
- The API surface is small and domain-focused: login, jobs, profile CRUD for student/company, and applications.
- There is no separate auth service, queue, or worker layer.
8. Backend data layer
- server/db.js defines the SQLite schema and database access logic using better-sqlite3.
- Data is stored in a single file, server/data.sqlite, with WAL mode enabled.
- The schema includes users, students, companies, jobs, and applications.
9. Seed and bootstrap behavior
- server/seedData.js provides initial demo content.
- On first backend startup, the database file is created and seeded automatically, so the app is self-contained and runnable from scratch.
- This means the architecture diagram should show bootstrap/seed logic as part of the backend initialization path.
10. Domain model and persistence
- Jobs, profiles, and applications are persisted in SQLite; relationships are simple and direct.
- Several composite fields such as skills, experience, education, certifications, requirements, and benefits are stored as JSON text in single columns to keep the schema lightweight.
- Applications are a separate table keyed by studentId and jobId, making postulation state a first-class persisted entity.
11. Role model
- The system has two operational roles: student and company.
- Students can browse jobs, apply, and manage their own profile/CV.
- Companies can manage their profile and create job postings; the backend enforces this with role checks such as the x-role: empresa header on job creation.
- There is no university admin role implemented yet.
12. Authentication model
- Login is intentionally simple: POST /login checks email/password against the users table and returns the role.
- There are no JWTs, server sessions, or password hashing in this prototype.
- Frontend route protection is also minimal, so the role is mostly used to control UI behavior and API access.
13. What to emphasize in an architecture diagram
- Draw one client SPA talking directly to one local API server.
- Put SQLite as the single source of truth behind the API.
- Show the global React context as the client-side state coordinator.
- Show the main domain flows separately: jobs, profiles, and applications.
- Note that the system is fully local, seeded on startup, and designed as a course prototype rather than a production deployment.
Main entry points: App.jsx App shell · AppDataContext.jsx App data · index.js API server · package.json Dev start
Components 21
Workspace
Local prototype workspace orchestrating frontend and backend runtimes.
- Dev start · Runs both client and server locally from the root package.
package.json
Frontend
React SPA served by Vite.
- Vite app · Serves the React single-page app on the local dev port.
sanmarcos-jobs/vite.config.js - Entry · Mounts the app into the HTML shell.
sanmarcos-jobs/src/main.jsx - App shell · Defines the top-level app layout and route flow.
sanmarcos-jobs/src/App.jsx - App data · Global state boundary for session, jobs, profiles, and applications.
sanmarcos-jobs/src/context/AppDataContext.jsx - API client · Browser client used to call the backend API.
sanmarcos-jobs/src/lib/api.js - Local state · Client-side storage helper for lightweight persisted UI state.
sanmarcos-jobs/src/lib/useLocalStorageState.js - Navbar · Shared navigation chrome across screens.
sanmarcos-jobs/src/components/Navbar.jsx - GlowInput · Reusable form input component.
sanmarcos-jobs/src/components/GlowInput.jsx - Select · Reusable select component.
sanmarcos-jobs/src/components/Select.jsx - Login · Simple role-aware login screen.
sanmarcos-jobs/src/pages/LoginPage.jsx - Feed · Browse and filter jobs.
sanmarcos-jobs/src/pages/FeedPage.jsx - Job detail · View a job and act on it.
sanmarcos-jobs/src/pages/JobDetailPage.jsx - New job · Company posting flow.
sanmarcos-jobs/src/pages/NewJobPage.jsx - Profile · View student or company profile data.
sanmarcos-jobs/src/pages/ProfilePage.jsx - Edit profile · Edit student or company profile data.
sanmarcos-jobs/src/pages/EditProfilePage.jsx - CV print · Print-friendly CV view for browser print or PDF export.
sanmarcos-jobs/src/pages/CvPrintPage.jsx
Backend
Express API with SQLite persistence.
- API server · Local backend boundary exposing all business operations under /api.
server/index.js - SQLite store · Single-file SQLite persistence with schema and query logic.
server/db.js - Seed data · Initial demo content loaded on first startup.
server/seedData.js - data.sqlite · Persistent local database file.
Connections 20
- Dev start → Vite app: starts · Launches the frontend dev server.
- Dev start → API server: starts · Launches the backend API server.
- Vite app → Entry: serves · Vite serves the SPA entrypoint.
- Entry → App shell: boots · Mounts the app shell and routing.
- App shell → App data: wraps · Provides global client state to screens.
- App shell → Navbar: renders · Shared chrome used across the app.
- App shell → Login: routes · Auth entry screen.
- App shell → Feed: routes · Job browsing screen.
- App shell → Job detail: routes · Job detail screen.
- App shell → New job: routes · Company posting screen.
- App shell → Profile: routes · Profile viewing screen.
- App shell → Edit profile: routes · Profile editing screen.
- App shell → CV print: routes · Print-oriented CV screen.
- App data → API client: calls · Uses the HTTP client for backend access.
- App data → Local state: persists · Stores lightweight client-side state.
- App data → API server: api · Synchronizes app data through the backend API.
- API server → SQLite store: queries · Handles login, jobs, profiles, and applications through the DB layer.
- API server → Seed data: boots with · Initializes the local demo dataset on first run.
- Seed data → data.sqlite: initializes · Creates the persisted database file when missing.
- SQLite store → data.sqlite: stores · Reads and writes the SQLite database file.