Index: src/lib/admin-api.ts
===================================================================
--- src/lib/admin-api.ts	(revision 8496f3c2ae490dee80fdf71af9fe30c63996efaf)
+++ src/lib/admin-api.ts	(revision 8496f3c2ae490dee80fdf71af9fe30c63996efaf)
@@ -0,0 +1,90 @@
+import { apiUrl } from "@/lib/api";
+import { getAccessToken } from "@/lib/auth";
+
+export type AdminResult = { ok: boolean; message?: string; id?: number | null };
+
+export type SubjectRef = { id: number; name?: string; code?: string | null };
+
+export type SubjectMajor = {
+  majorId: number;
+  majorName?: string;
+  mandatorySemester: number;
+};
+
+export type AdminSubject = {
+  id: number;
+  name?: string;
+  code?: string;
+  awardedCredits: number;
+  dependencyCredit?: number | null;
+  majors: SubjectMajor[];
+  prerequisites: SubjectRef[];
+  enrolledCount: number;
+};
+
+export type AdminSemester = {
+  id: number;
+  year: number;
+  type?: string;
+  name?: string;
+  enrolmentCount: number;
+  uncoveredSubjects: SubjectRef[];
+};
+
+export type ScheduleRow = {
+  subjectId: number;
+  subjectName?: string;
+  subjectCode?: string;
+  professorId: number;
+  professorName?: string;
+};
+
+export type ProfessorLoad = {
+  professorId: number;
+  professorName?: string;
+  subjects: number;
+};
+
+export type Schedule = {
+  semesterId: number;
+  semesterName?: string;
+  assignments: ScheduleRow[];
+  load: ProfessorLoad[];
+  uncoveredSubjects: SubjectRef[];
+  allSubjects: SubjectRef[];
+  professors: { id: number; name?: string }[];
+};
+
+function authHeaders(): Record<string, string> {
+  const token = getAccessToken();
+  if (!token) throw new Error("You are not signed in.");
+  return { Authorization: `Bearer ${token}`, "Content-Type": "application/json" };
+}
+
+/** GET that throws with the server message rather than a bare status code. */
+export async function adminGet<T>(path: string): Promise<T> {
+  const res = await fetch(apiUrl(path), { cache: "no-store", headers: authHeaders() });
+  if (!res.ok) {
+    const body = await res.json().catch(() => null);
+    throw new Error(body?.message || `Request failed (${res.status})`);
+  }
+  return (await res.json()) as T;
+}
+
+/** POST/PUT/DELETE returning the standard {ok, message} envelope. */
+export async function adminSend(
+  path: string,
+  method: "POST" | "PUT" | "DELETE",
+  body?: unknown,
+): Promise<AdminResult> {
+  const res = await fetch(apiUrl(path), {
+    method,
+    headers: authHeaders(),
+    body: body === undefined ? undefined : JSON.stringify(body),
+  });
+  const result = (await res.json().catch(() => null)) as AdminResult | null;
+  if (!res.ok || !result?.ok) {
+    throw new Error(result?.message || `Request failed (${res.status})`);
+  }
+  return result;
+}
Index: src/lib/api.ts
===================================================================
--- src/lib/api.ts	(revision 8496f3c2ae490dee80fdf71af9fe30c63996efaf)
+++ src/lib/api.ts	(revision 8496f3c2ae490dee80fdf71af9fe30c63996efaf)
@@ -0,0 +1,15 @@
+/**
+ * Base URL of the iknow-api backend.
+ *
+ * Set NEXT_PUBLIC_API_BASE_URL in .env.local to point at a local API run
+ * (see .env.example). The faculty database is only reachable through the SSH
+ * tunnel on the developer machine, so the deployed backend cannot read it -
+ * working against real data means running iknow-api locally.
+ */
+export const API_BASE_URL =
+  process.env.NEXT_PUBLIC_API_BASE_URL ?? 'https://iknow-api.onrender.com';
+
+/** Builds an absolute API URL from a path such as `/api/user/getUser`. */
+export function apiUrl(path: string): string {
+  return `${API_BASE_URL}${path}`;
+}
Index: src/lib/auth.ts
===================================================================
--- src/lib/auth.ts	(revision 4fe4582e6255b2244fa2c6ce9ae837ab03e74a58)
+++ src/lib/auth.ts	(revision 8496f3c2ae490dee80fdf71af9fe30c63996efaf)
@@ -1,2 +1,3 @@
+import { API_BASE_URL } from './api';
 export type AuthTokens = {
   accessToken: string;
@@ -4,5 +5,5 @@
 };
 
-export type UserRole = 'Professor' | 'Student' | string;
+export type UserRole = 'Professor' | 'Student' | 'Admin' | string;
 
 export type AuthSession = AuthTokens & {
@@ -91,5 +92,5 @@
 
 export async function login(params: { email: string; password: string }): Promise<AuthSession> {
-  const baseUrl = process.env.NEXT_PUBLIC_API_BASE_URL ?? 'https://iknow-api.onrender.com';
+  const baseUrl = API_BASE_URL;
 
   const response = await fetch(`${baseUrl}/api/auth/login`, {
Index: src/lib/pdf-generators.ts
===================================================================
--- src/lib/pdf-generators.ts	(revision 4fe4582e6255b2244fa2c6ce9ae837ab03e74a58)
+++ src/lib/pdf-generators.ts	(revision 8496f3c2ae490dee80fdf71af9fe30c63996efaf)
@@ -2,4 +2,5 @@
 import autoTable from 'jspdf-autotable';
 import { loadCyrillicFonts } from './pdf-fonts';
+import { apiUrl } from './api';
 
 /* ---------- shared types ---------- */
@@ -1056,5 +1057,5 @@
 ): Promise<void> {
   // Fetch student profile
-  const profileRes = await fetch('https://iknow-api.onrender.com/api/user/getUser', {
+  const profileRes = await fetch(apiUrl('/api/user/getUser'), {
     headers: { Authorization: `Bearer ${accessToken}` },
   });
@@ -1095,5 +1096,5 @@
   let passedExams: PassedExam[] = [];
   if (needsExams) {
-    const examsRes = await fetch('https://iknow-api.onrender.com/api/user/getPassedSubjects', {
+    const examsRes = await fetch(apiUrl('/api/user/getPassedSubjects'), {
       headers: { Authorization: `Bearer ${accessToken}` },
     });
Index: src/lib/prof-demo-store.ts
===================================================================
--- src/lib/prof-demo-store.ts	(revision 4fe4582e6255b2244fa2c6ce9ae837ab03e74a58)
+++ 	(revision )
@@ -1,107 +1,0 @@
-export type UsersBySubject = {
-  Id?: string;
-  Name?: string;
-  Grade: number;
-};
-
-export type SubjectsAndUsers = {
-  Name?: string;
-  Id?: number;
-  Users: UsersBySubject[];
-};
-
-export type AddGrade = {
-  StudentId: number;
-  SubjectId: number;
-  grade: number;
-};
-
-type Store = {
-  subjects: SubjectsAndUsers[];
-};
-
-function createInitialStore(): Store {
-  return {
-    subjects: [
-      {
-        Id: 101,
-        Name: "Web Programming",
-        Users: [
-          { Id: "20001", Name: "Ana Petrovska", Grade: 0 },
-          { Id: "20002", Name: "Marko Trajkov", Grade: 8 },
-          { Id: "20003", Name: "Elena Stojanova", Grade: 0 },
-        ],
-      },
-      {
-        Id: 102,
-        Name: "Databases",
-        Users: [
-          { Id: "20001", Name: "Ana Petrovska", Grade: 0 },
-          { Id: "20004", Name: "Nikola Iliev", Grade: 9 },
-          { Id: "20005", Name: "Sara Dimitrova", Grade: 7 },
-        ],
-      },
-      {
-        Id: 103,
-        Name: "Algorithms",
-        Users: [
-          { Id: "20002", Name: "Marko Trajkov", Grade: 0 },
-          { Id: "20006", Name: "Ivana Kostova", Grade: 10 },
-        ],
-      },
-    ],
-  };
-}
-
-function getGlobalStore(): Store {
-  const globalKey = "__iknow_prof_demo_store__";
-  const globalObj = globalThis as unknown as Record<string, unknown>;
-
-  if (!globalObj[globalKey]) {
-    globalObj[globalKey] = createInitialStore();
-  }
-
-  return globalObj[globalKey] as Store;
-}
-
-export function getSubjects(): SubjectsAndUsers[] {
-  return getGlobalStore().subjects;
-}
-
-function parseStudentId(id: string | undefined): number | null {
-  if (!id) return null;
-  const parsed = Number.parseInt(id, 10);
-  return Number.isFinite(parsed) ? parsed : null;
-}
-
-export function setGrade(
-  payload: AddGrade,
-  mode: "add" | "edit" | "remove",
-): { subject: SubjectsAndUsers; user: UsersBySubject } {
-  const store = getGlobalStore();
-  const subject = store.subjects.find((s) => s.Id === payload.SubjectId);
-  if (!subject) {
-    throw new Error("Subject not found");
-  }
-
-  const user = subject.Users.find((u) => parseStudentId(u.Id) === payload.StudentId);
-  if (!user) {
-    throw new Error("Student not found in subject");
-  }
-
-  if (mode === "remove") {
-    user.Grade = 0;
-    return { subject, user };
-  }
-
-  if (payload.grade < 5 || payload.grade > 10) {
-    throw new Error("Grade must be between 5 and 10");
-  }
-
-  if (mode === "add" && user.Grade > 0) {
-    throw new Error("Grade already exists; use edit");
-  }
-
-  user.Grade = payload.grade;
-  return { subject, user };
-}
