React (Vite) frontend for the library system. The foundation layer is built
(Person 1's job): design tokens, layouts, routing, auth, and the shared component
library. Persons 2–5 fill in their screen files under src/pages/.
npm install
npm run devAny password works. Pick the role you want to test:
student@knust.edu.ghlibrarian@knust.edu.ghadmin@knust.edu.gh
Mock auth lives in src/context/AuthContext.jsx. When the backend is ready,
swap the body of login() for a real call — nothing else changes.
src/styles/— tokens (colors/fonts) + shared component CSSsrc/layouts/— AuthLayout, StudentLayout, AdminLayout (sidebar + topbar)src/routes/— route tree, ProtectedRoute, RoleRoute, home redirectsrc/context/AuthContext.jsx— login/logout/rolesrc/services/apiClient.js— fetch wrapper (reads VITE_API_BASE_URL, attaches JWT)src/components/ui/— Button, Input, Select, Toggle, Badge, Avatar, Card, Modal, Tabs, Breadcrumb, RatingStars, AlertBannersrc/components/tables/— DataTable, StatusBadge, Paginationsrc/components/stats/StatCard.jsxsrc/components/navigation/— Sidebar, TopBar, navConfigsrc/pages/shared/— NotFoundPage (Screen 7), SettingsPagesrc/pages/auth/LoginPage.jsx— minimal working login (Person 3 restyles)
| Screen | File | Owner |
|---|---|---|
| 1 — Student Dashboard | src/pages/student/DashboardPage.jsx | P2 |
| 2 — Book Detail / Catalog | src/pages/student/BookDetailPage.jsx | P2 |
| 3 — Forgot Password | src/pages/auth/ForgotPasswordPage.jsx | P3 |
| 4 — Admin Dashboard | src/pages/admin/DashboardPage.jsx | P5 |
| 5 — Librarian Dashboard | src/pages/librarian/DashboardPage.jsx | P4 |
| 6 — Student Profile | src/pages/student/ProfilePage.jsx | P3 |
| 7 — 404 Not Found | src/pages/shared/NotFoundPage.jsx | ✅ done |
| 8 — Reports & Analytics | src/pages/admin/ReportsPage.jsx | P5 |
- Import the layout pieces you need from
src/components/... - Get data from a
src/services/...function (return mock JSON for now) - Compose:
StatCards, aDataTable,BookCards, etc. - Handle loading / empty / error (DataTable already does this for tables)
Example — a dashboard table:
import DataTable from "../../components/tables/DataTable.jsx";
import StatusBadge from "../../components/tables/StatusBadge.jsx";
<DataTable
columns={[
{ key: "title", header: "Book Title" },
{ key: "author", header: "Author" },
{ key: "status", header: "Status", render: (r) => <StatusBadge status={r.status} /> },
]}
rows={borrowings}
loading={loading}
emptyMessage="No borrowings yet."
/>