-
This will be the home page
+
+
+
+
+
+
+ Streamline your educational workflow, manage student records, and oversee courses in one place.
+
+
+
+
+
+
+
-
+
\ No newline at end of file
diff --git a/app/stores/auth-store.js b/app/stores/auth-store.js
new file mode 100644
index 0000000..1db925e
--- /dev/null
+++ b/app/stores/auth-store.js
@@ -0,0 +1,42 @@
+import { defineStore } from "pinia";
+
+export const useAuthStore = defineStore("authStore", () => {
+ const token = useCookie("auth_token", { maxAge: 60 * 15 });
+ const user = useCookie("auth_user", { maxAge: 60 * 15 });
+
+ if (process.client) {
+ token.value = localStorage.getItem("auth_token");
+
+ const savedUser = localStorage.getItem("auth_user");
+ if (savedUser) {
+ try {
+ user.value = JSON.parse(savedUser);
+ } catch (e) {
+ console.error("Failed to parse user from storage", e);
+ }
+ }
+ }
+
+ watch([token, user], ([newToken, newUser]) => {
+ if (!process.client) return;
+
+ if (newToken) {
+ localStorage.setItem("auth_token", newToken);
+ } else {
+ localStorage.removeItem("auth_token");
+ }
+
+ if (newUser) {
+ localStorage.setItem("auth_user", JSON.stringify(newUser));
+ } else {
+ localStorage.removeItem("auth_user");
+ }
+ }, { deep: true });
+
+ function logout() {
+ token.value = null;
+ user.value = null;
+ }
+
+ return { token, user, logout };
+});
\ No newline at end of file
diff --git a/nuxt.config.ts b/nuxt.config.ts
index b9d1747..2d111ff 100644
--- a/nuxt.config.ts
+++ b/nuxt.config.ts
@@ -1,32 +1,20 @@
import tailwindcss from "@tailwindcss/vite";
-// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
- compatibilityDate: "2025-07-15",
+ compatibilityDate: "2026-01-01",
devtools: { enabled: true },
css: ["~/assets/css/tailwind.css"],
+
vite: {
plugins: [tailwindcss()],
},
- modules: [
- "@nuxt/fonts",
- "@nuxt/icon",
- "@nuxt/image",
- "@nuxt/eslint",
- "shadcn-nuxt",
- ],
-
- shadcn: {
- /**
- * Prefix for all the imported component
- */
- prefix: "",
- /**
- * Directory that the component lives in.
- * @default "./app/components/ui"
- */
- componentDir: "./app/components/ui",
+ runtimeConfig: {
+ public: {
+ apiBase: "http://localhost:8080/academics/api/v1",
+ },
},
-});
+
+ modules: ["@pinia/nuxt"],
+});
\ No newline at end of file
diff --git a/package.json b/package.json
index 9f6b78c..c0d7953 100644
--- a/package.json
+++ b/package.json
@@ -20,7 +20,9 @@
"clsx": "^2.1.1",
"eslint": "^9.39.0",
"lucide-vue-next": "^0.552.0",
+ "@pinia/nuxt": "0.11.3",
"nuxt": "^4.2.0",
+ "pinia": "^3.0.4",
"reka-ui": "^2.6.0",
"shadcn-nuxt": "^2.3.2",
"tailwind-merge": "^3.3.1",