diff --git a/apps/admin/app/page.tsx b/apps/admin/app/page.tsx index 55f3a22..5855ba0 100644 --- a/apps/admin/app/page.tsx +++ b/apps/admin/app/page.tsx @@ -20,12 +20,14 @@ async function logOut() { } export default async function Page() { - const session = await auth() + const session = await auth(); return (
-

Hello admin {session?.user?.name}

- {!session?.user && } +

+ Hello admin {session?.user?.name} +

+ {!session?.user && }
diff --git a/apps/admin/app/signup/page.tsx b/apps/admin/app/signup/page.tsx index abfda4a..8136ee4 100644 --- a/apps/admin/app/signup/page.tsx +++ b/apps/admin/app/signup/page.tsx @@ -141,7 +141,7 @@ export default function StudentRegistrationForm() { const progress = (currentStep / steps.length) * 100 return ( -
+
diff --git a/apps/admin/components/login.tsx b/apps/admin/components/login.tsx index 7b42ac7..58c5d59 100644 --- a/apps/admin/components/login.tsx +++ b/apps/admin/components/login.tsx @@ -2,23 +2,19 @@ import { signIn } from "@workspace/auth"; import { Button } from "@workspace/ui/components/button"; -export default function Login({logIn}: {logIn: () => Promise}) { +export default function Login({ action }: { action: () => Promise }) { return ( -
-
); diff --git a/apps/admin/next.config.mjs b/apps/admin/next.config.mjs index 9f01025..58e988e 100644 --- a/apps/admin/next.config.mjs +++ b/apps/admin/next.config.mjs @@ -1,6 +1,6 @@ /** @type {import('next').NextConfig} */ const nextConfig = { - transpilePackages: ["@workspace/ui"], + transpilePackages: ["@workspace/ui", "@workspace/db", "@workspace/auth"], }; export default nextConfig; diff --git a/packages/db/index.ts b/packages/db/index.ts index 535414c..3cf6d41 100644 --- a/packages/db/index.ts +++ b/packages/db/index.ts @@ -2,4 +2,4 @@ import { drizzle } from "drizzle-orm/neon-http"; export const db = drizzle(process.env.DATABASE_URL!); -export * from "./schema.ts"; +export * from "./schema"; diff --git a/packages/db/migrations/0004_blushing_captain_flint.sql b/packages/db/migrations/0004_blushing_captain_flint.sql new file mode 100644 index 0000000..f65431a --- /dev/null +++ b/packages/db/migrations/0004_blushing_captain_flint.sql @@ -0,0 +1,5 @@ +DROP TABLE "certificates" CASCADE;--> statement-breakpoint +DROP TABLE "projects" CASCADE;--> statement-breakpoint +ALTER TABLE "students" ADD COLUMN "isDiploma" boolean;--> statement-breakpoint +ALTER TABLE "companies" DROP COLUMN "passwordHash";--> statement-breakpoint +ALTER TABLE "internships" DROP COLUMN "status"; \ No newline at end of file diff --git a/packages/db/migrations/0005_solid_photon.sql b/packages/db/migrations/0005_solid_photon.sql new file mode 100644 index 0000000..de99f25 --- /dev/null +++ b/packages/db/migrations/0005_solid_photon.sql @@ -0,0 +1,3 @@ +ALTER TABLE "students" ADD COLUMN "gender" varchar(10);--> statement-breakpoint +ALTER TABLE "students" ADD COLUMN "dob" timestamp;--> statement-breakpoint +ALTER TABLE "students" ADD COLUMN "personalGmail" text; \ No newline at end of file diff --git a/packages/db/migrations/meta/0004_snapshot.json b/packages/db/migrations/meta/0004_snapshot.json new file mode 100644 index 0000000..c9107a2 --- /dev/null +++ b/packages/db/migrations/meta/0004_snapshot.json @@ -0,0 +1,751 @@ +{ + "id": "5bcc500e-17e0-411d-8b8c-597d5b6de14d", + "prevId": "a00a32a1-83c4-49c8-b7b5-ff990facf461", + "version": "7", + "dialect": "postgresql", + "tables": { + "public.admins": { + "name": "admins", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "email": { + "name": "email", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "createdAt": { + "name": "createdAt", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updatedAt": { + "name": "updatedAt", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "admins_email_unique": { + "name": "admins_email_unique", + "nullsNotDistinct": false, + "columns": [ + "email" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.applications": { + "name": "applications", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "job_id": { + "name": "job_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "student_id": { + "name": "student_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "resume_id": { + "name": "resume_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "status": { + "name": "status", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'pending'" + }, + "createdAt": { + "name": "createdAt", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updatedAt": { + "name": "updatedAt", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "applications_job_id_jobs_id_fk": { + "name": "applications_job_id_jobs_id_fk", + "tableFrom": "applications", + "tableTo": "jobs", + "columnsFrom": [ + "job_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "applications_student_id_students_id_fk": { + "name": "applications_student_id_students_id_fk", + "tableFrom": "applications", + "tableTo": "students", + "columnsFrom": [ + "student_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "applications_resume_id_resumes_id_fk": { + "name": "applications_resume_id_resumes_id_fk", + "tableFrom": "applications", + "tableTo": "resumes", + "columnsFrom": [ + "resume_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.companies": { + "name": "companies", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "email": { + "name": "email", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "link": { + "name": "link", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "imageURL": { + "name": "imageURL", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "createdAt": { + "name": "createdAt", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updatedAt": { + "name": "updatedAt", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.grades": { + "name": "grades", + "schema": "", + "columns": { + "student_id": { + "name": "student_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "sem": { + "name": "sem", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "sgpi": { + "name": "sgpi", + "type": "numeric(4, 2)", + "primaryKey": false, + "notNull": true + }, + "isKT": { + "name": "isKT", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "deadKT": { + "name": "deadKT", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "createdAt": { + "name": "createdAt", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updatedAt": { + "name": "updatedAt", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "grades_student_id_students_id_fk": { + "name": "grades_student_id_students_id_fk", + "tableFrom": "grades", + "tableTo": "students", + "columnsFrom": [ + "student_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": { + "grades_student_id_sem_pk": { + "name": "grades_student_id_sem_pk", + "columns": [ + "student_id", + "sem" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": { + "sem_check1": { + "name": "sem_check1", + "value": "\"grades\".\"sem\" < 9" + } + }, + "isRLSEnabled": false + }, + "public.internships": { + "name": "internships", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "student_id": { + "name": "student_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "title": { + "name": "title", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "company": { + "name": "company", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "location": { + "name": "location", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "startDate": { + "name": "startDate", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "endDate": { + "name": "endDate", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "createdAt": { + "name": "createdAt", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updatedAt": { + "name": "updatedAt", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "internships_student_id_students_id_fk": { + "name": "internships_student_id_students_id_fk", + "tableFrom": "internships", + "tableTo": "students", + "columnsFrom": [ + "student_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.jobs": { + "name": "jobs", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "company_id": { + "name": "company_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "title": { + "name": "title", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "link": { + "name": "link", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "location": { + "name": "location", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "imageURL": { + "name": "imageURL", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "salary": { + "name": "salary", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "applicationDeadline": { + "name": "applicationDeadline", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "active": { + "name": "active", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "minCGPA": { + "name": "minCGPA", + "type": "numeric(4, 2)", + "primaryKey": false, + "notNull": true, + "default": "'0'" + }, + "minSSC": { + "name": "minSSC", + "type": "numeric(4, 2)", + "primaryKey": false, + "notNull": true, + "default": "'0'" + }, + "minHSC": { + "name": "minHSC", + "type": "numeric(4, 2)", + "primaryKey": false, + "notNull": true, + "default": "'0'" + }, + "allowDeadKT": { + "name": "allowDeadKT", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": true + }, + "allowLiveKT": { + "name": "allowLiveKT", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": true + }, + "createdAt": { + "name": "createdAt", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updatedAt": { + "name": "updatedAt", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "jobs_company_id_companies_id_fk": { + "name": "jobs_company_id_companies_id_fk", + "tableFrom": "jobs", + "tableTo": "companies", + "columnsFrom": [ + "company_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.resumes": { + "name": "resumes", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "student_id": { + "name": "student_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "title": { + "name": "title", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "link": { + "name": "link", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "createdAt": { + "name": "createdAt", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updatedAt": { + "name": "updatedAt", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "resumes_student_id_students_id_fk": { + "name": "resumes_student_id_students_id_fk", + "tableFrom": "resumes", + "tableTo": "students", + "columnsFrom": [ + "student_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.students": { + "name": "students", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "email": { + "name": "email", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "rollNumber": { + "name": "rollNumber", + "type": "varchar(12)", + "primaryKey": false, + "notNull": false + }, + "verified": { + "name": "verified", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "firstName": { + "name": "firstName", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false + }, + "middleName": { + "name": "middleName", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false + }, + "lastName": { + "name": "lastName", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false + }, + "mothersName": { + "name": "mothersName", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false + }, + "phoneNumber": { + "name": "phoneNumber", + "type": "varchar(10)", + "primaryKey": false, + "notNull": false + }, + "address": { + "name": "address", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "profilePicture": { + "name": "profilePicture", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "degree": { + "name": "degree", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "branch": { + "name": "branch", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "year": { + "name": "year", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "skills": { + "name": "skills", + "type": "text[]", + "primaryKey": false, + "notNull": false, + "default": "ARRAY[]::text[]" + }, + "linkedin": { + "name": "linkedin", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "github": { + "name": "github", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "ssc": { + "name": "ssc", + "type": "numeric(4, 2)", + "primaryKey": false, + "notNull": false + }, + "hsc": { + "name": "hsc", + "type": "numeric(4, 2)", + "primaryKey": false, + "notNull": false + }, + "isDiploma": { + "name": "isDiploma", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "createdAt": { + "name": "createdAt", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updatedAt": { + "name": "updatedAt", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + } + }, + "enums": {}, + "schemas": {}, + "sequences": {}, + "roles": {}, + "policies": {}, + "views": {}, + "_meta": { + "columns": {}, + "schemas": {}, + "tables": {} + } +} \ No newline at end of file diff --git a/packages/db/migrations/meta/0005_snapshot.json b/packages/db/migrations/meta/0005_snapshot.json new file mode 100644 index 0000000..b9eff47 --- /dev/null +++ b/packages/db/migrations/meta/0005_snapshot.json @@ -0,0 +1,769 @@ +{ + "id": "1506d00a-2620-44ac-af01-19e04c21f679", + "prevId": "5bcc500e-17e0-411d-8b8c-597d5b6de14d", + "version": "7", + "dialect": "postgresql", + "tables": { + "public.admins": { + "name": "admins", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "email": { + "name": "email", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "createdAt": { + "name": "createdAt", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updatedAt": { + "name": "updatedAt", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "admins_email_unique": { + "name": "admins_email_unique", + "nullsNotDistinct": false, + "columns": [ + "email" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.applications": { + "name": "applications", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "job_id": { + "name": "job_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "student_id": { + "name": "student_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "resume_id": { + "name": "resume_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "status": { + "name": "status", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'pending'" + }, + "createdAt": { + "name": "createdAt", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updatedAt": { + "name": "updatedAt", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "applications_job_id_jobs_id_fk": { + "name": "applications_job_id_jobs_id_fk", + "tableFrom": "applications", + "tableTo": "jobs", + "columnsFrom": [ + "job_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "applications_student_id_students_id_fk": { + "name": "applications_student_id_students_id_fk", + "tableFrom": "applications", + "tableTo": "students", + "columnsFrom": [ + "student_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "applications_resume_id_resumes_id_fk": { + "name": "applications_resume_id_resumes_id_fk", + "tableFrom": "applications", + "tableTo": "resumes", + "columnsFrom": [ + "resume_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.companies": { + "name": "companies", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "email": { + "name": "email", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "link": { + "name": "link", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "imageURL": { + "name": "imageURL", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "createdAt": { + "name": "createdAt", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updatedAt": { + "name": "updatedAt", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.grades": { + "name": "grades", + "schema": "", + "columns": { + "student_id": { + "name": "student_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "sem": { + "name": "sem", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "sgpi": { + "name": "sgpi", + "type": "numeric(4, 2)", + "primaryKey": false, + "notNull": true + }, + "isKT": { + "name": "isKT", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "deadKT": { + "name": "deadKT", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "createdAt": { + "name": "createdAt", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updatedAt": { + "name": "updatedAt", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "grades_student_id_students_id_fk": { + "name": "grades_student_id_students_id_fk", + "tableFrom": "grades", + "tableTo": "students", + "columnsFrom": [ + "student_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": { + "grades_student_id_sem_pk": { + "name": "grades_student_id_sem_pk", + "columns": [ + "student_id", + "sem" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": { + "sem_check1": { + "name": "sem_check1", + "value": "\"grades\".\"sem\" < 9" + } + }, + "isRLSEnabled": false + }, + "public.internships": { + "name": "internships", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "student_id": { + "name": "student_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "title": { + "name": "title", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "company": { + "name": "company", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "location": { + "name": "location", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "startDate": { + "name": "startDate", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "endDate": { + "name": "endDate", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "createdAt": { + "name": "createdAt", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updatedAt": { + "name": "updatedAt", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "internships_student_id_students_id_fk": { + "name": "internships_student_id_students_id_fk", + "tableFrom": "internships", + "tableTo": "students", + "columnsFrom": [ + "student_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.jobs": { + "name": "jobs", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "company_id": { + "name": "company_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "title": { + "name": "title", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "link": { + "name": "link", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "location": { + "name": "location", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "imageURL": { + "name": "imageURL", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "salary": { + "name": "salary", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "applicationDeadline": { + "name": "applicationDeadline", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "active": { + "name": "active", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "minCGPA": { + "name": "minCGPA", + "type": "numeric(4, 2)", + "primaryKey": false, + "notNull": true, + "default": "'0'" + }, + "minSSC": { + "name": "minSSC", + "type": "numeric(4, 2)", + "primaryKey": false, + "notNull": true, + "default": "'0'" + }, + "minHSC": { + "name": "minHSC", + "type": "numeric(4, 2)", + "primaryKey": false, + "notNull": true, + "default": "'0'" + }, + "allowDeadKT": { + "name": "allowDeadKT", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": true + }, + "allowLiveKT": { + "name": "allowLiveKT", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": true + }, + "createdAt": { + "name": "createdAt", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updatedAt": { + "name": "updatedAt", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "jobs_company_id_companies_id_fk": { + "name": "jobs_company_id_companies_id_fk", + "tableFrom": "jobs", + "tableTo": "companies", + "columnsFrom": [ + "company_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.resumes": { + "name": "resumes", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "student_id": { + "name": "student_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "title": { + "name": "title", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "link": { + "name": "link", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "createdAt": { + "name": "createdAt", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updatedAt": { + "name": "updatedAt", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "resumes_student_id_students_id_fk": { + "name": "resumes_student_id_students_id_fk", + "tableFrom": "resumes", + "tableTo": "students", + "columnsFrom": [ + "student_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.students": { + "name": "students", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "email": { + "name": "email", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "rollNumber": { + "name": "rollNumber", + "type": "varchar(12)", + "primaryKey": false, + "notNull": false + }, + "verified": { + "name": "verified", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "firstName": { + "name": "firstName", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false + }, + "middleName": { + "name": "middleName", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false + }, + "lastName": { + "name": "lastName", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false + }, + "mothersName": { + "name": "mothersName", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false + }, + "gender": { + "name": "gender", + "type": "varchar(10)", + "primaryKey": false, + "notNull": false + }, + "dob": { + "name": "dob", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "personalGmail": { + "name": "personalGmail", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "phoneNumber": { + "name": "phoneNumber", + "type": "varchar(10)", + "primaryKey": false, + "notNull": false + }, + "address": { + "name": "address", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "profilePicture": { + "name": "profilePicture", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "degree": { + "name": "degree", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "branch": { + "name": "branch", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "year": { + "name": "year", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "skills": { + "name": "skills", + "type": "text[]", + "primaryKey": false, + "notNull": false, + "default": "ARRAY[]::text[]" + }, + "linkedin": { + "name": "linkedin", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "github": { + "name": "github", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "ssc": { + "name": "ssc", + "type": "numeric(4, 2)", + "primaryKey": false, + "notNull": false + }, + "hsc": { + "name": "hsc", + "type": "numeric(4, 2)", + "primaryKey": false, + "notNull": false + }, + "isDiploma": { + "name": "isDiploma", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "createdAt": { + "name": "createdAt", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updatedAt": { + "name": "updatedAt", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + } + }, + "enums": {}, + "schemas": {}, + "sequences": {}, + "roles": {}, + "policies": {}, + "views": {}, + "_meta": { + "columns": {}, + "schemas": {}, + "tables": {} + } +} \ No newline at end of file diff --git a/packages/db/migrations/meta/_journal.json b/packages/db/migrations/meta/_journal.json index 272148e..1f2c754 100644 --- a/packages/db/migrations/meta/_journal.json +++ b/packages/db/migrations/meta/_journal.json @@ -29,6 +29,20 @@ "when": 1750849519081, "tag": "0003_clammy_shadowcat", "breakpoints": true + }, + { + "idx": 4, + "version": "7", + "when": 1751094285471, + "tag": "0004_blushing_captain_flint", + "breakpoints": true + }, + { + "idx": 5, + "version": "7", + "when": 1751182452704, + "tag": "0005_solid_photon", + "breakpoints": true } ] } \ No newline at end of file diff --git a/packages/db/schema.ts b/packages/db/schema.ts index 74beb28..b770cd1 100644 --- a/packages/db/schema.ts +++ b/packages/db/schema.ts @@ -9,7 +9,7 @@ import { integer, numeric, primaryKey, - check + check, } from "drizzle-orm/pg-core"; export const students = pgTable("students", { @@ -21,6 +21,9 @@ export const students = pgTable("students", { middleName: varchar({ length: 255 }), lastName: varchar({ length: 255 }), mothersName: varchar({ length: 255 }), + gender: varchar({ length: 10 }), + dob: timestamp(), + personalGmail: text(), phoneNumber: varchar({ length: 10 }), address: text(), profilePicture: text(), @@ -32,9 +35,9 @@ export const students = pgTable("students", { .default(sql`ARRAY[]::text[]`), linkedin: text(), github: text(), - ssc: numeric({ precision: 4, scale: 2 }), - hsc: numeric({ precision: 4, scale: 2 }), - isDiploma: boolean(), + ssc: numeric({ precision: 4, scale: 2 }), // TODO: year, board + hsc: numeric({ precision: 4, scale: 2 }), // TODO: year, board + isDiploma: boolean(), // TODO: diploma branch createdAt: timestamp().notNull().defaultNow(), updatedAt: timestamp() .defaultNow() @@ -53,7 +56,7 @@ export const internships = pgTable("internships", { location: text().notNull(), startDate: timestamp().notNull(), endDate: timestamp().notNull(), - status: text().notNull(), + // status: text().notNull(), createdAt: timestamp().notNull().defaultNow(), updatedAt: timestamp() .defaultNow() @@ -61,38 +64,38 @@ export const internships = pgTable("internships", { .notNull(), }); -export const projects = pgTable("projects", { - id: serial().primaryKey(), - studentId: integer("student_id") - .notNull() - .references(() => students.id), - title: text().notNull(), - description: text().notNull(), - links: text() - .array() - .notNull() - .default(sql`ARRAY[]::text[]`), - createdAt: timestamp().notNull().defaultNow(), - updatedAt: timestamp() - .defaultNow() - .$onUpdate(() => new Date()) - .notNull(), -}); +// export const projects = pgTable("projects", { +// id: serial().primaryKey(), +// studentId: integer("student_id") +// .notNull() +// .references(() => students.id), +// title: text().notNull(), +// description: text().notNull(), +// links: text() +// .array() +// .notNull() +// .default(sql`ARRAY[]::text[]`), +// createdAt: timestamp().notNull().defaultNow(), +// updatedAt: timestamp() +// .defaultNow() +// .$onUpdate(() => new Date()) +// .notNull(), +// }); -export const certificates = pgTable("certificates", { - id: serial().primaryKey(), - studentId: integer("student_id") - .notNull() - .references(() => students.id), - title: text().notNull(), - description: text().notNull(), - link: text().notNull(), - createdAt: timestamp().notNull().defaultNow(), - updatedAt: timestamp() - .defaultNow() - .$onUpdate(() => new Date()) - .notNull(), -}); +// export const certificates = pgTable("certificates", { +// id: serial().primaryKey(), +// studentId: integer("student_id") +// .notNull() +// .references(() => students.id), +// title: text().notNull(), +// description: text().notNull(), +// link: text().notNull(), +// createdAt: timestamp().notNull().defaultNow(), +// updatedAt: timestamp() +// .defaultNow() +// .$onUpdate(() => new Date()) +// .notNull(), +// }); export const resumes = pgTable("resumes", { id: serial().primaryKey(), @@ -108,25 +111,32 @@ export const resumes = pgTable("resumes", { .notNull(), }); -export const grades = pgTable("grades", { - studentId: integer("student_id") - .notNull() - .references(() => students.id), - sem: integer().notNull(), - sgpi: numeric({ precision: 4, scale: 2 }).notNull(), - isKT: boolean().notNull(), - deadKT: boolean(), - createdAt: timestamp().notNull().defaultNow(), - updatedAt: timestamp() - .defaultNow() - .$onUpdate(() => new Date()) - .notNull(), -}, (table) => [primaryKey({ columns: [table.studentId, table.sem] }), check("sem_check1", sql`${table.sem} < 9`)]); +export const grades = pgTable( + "grades", + { + studentId: integer("student_id") + .notNull() + .references(() => students.id), + sem: integer().notNull(), + sgpi: numeric({ precision: 4, scale: 2 }).notNull(), + isKT: boolean().notNull(), + deadKT: boolean(), + createdAt: timestamp().notNull().defaultNow(), + updatedAt: timestamp() + .defaultNow() + .$onUpdate(() => new Date()) + .notNull(), + }, + (table) => [ + primaryKey({ columns: [table.studentId, table.sem] }), + check("sem_check1", sql`${table.sem} < 9`), + ], +); export const studentRelations = relations(students, ({ many }) => ({ internships: many(internships), - projects: many(projects), - certificates: many(certificates), + // projects: many(projects), + // certificates: many(certificates), resumes: many(resumes), grades: many(grades), })); @@ -138,19 +148,19 @@ export const internshipRelations = relations(internships, ({ one }) => ({ }), })); -export const projectRelations = relations(projects, ({ one }) => ({ - student: one(students, { - fields: [projects.studentId], - references: [students.id], - }), -})); +// export const projectRelations = relations(projects, ({ one }) => ({ +// student: one(students, { +// fields: [projects.studentId], +// references: [students.id], +// }), +// })); -export const certificateRelations = relations(certificates, ({ one }) => ({ - student: one(students, { - fields: [certificates.studentId], - references: [students.id], - }), -})); +// export const certificateRelations = relations(certificates, ({ one }) => ({ +// student: one(students, { +// fields: [certificates.studentId], +// references: [students.id], +// }), +// })); export const resumeRelations = relations(resumes, ({ one, many }) => ({ student: one(students, { @@ -173,7 +183,7 @@ export const companies = pgTable("companies", { email: text().notNull(), link: text().notNull(), description: text().notNull(), - passwordHash: text(), + // passwordHash: text(), imageURL: text().notNull(), createdAt: timestamp().notNull().defaultNow(), updatedAt: timestamp() diff --git a/packages/db/tsconfig.json b/packages/db/tsconfig.json index 303f19e..e69de29 100644 --- a/packages/db/tsconfig.json +++ b/packages/db/tsconfig.json @@ -1,12 +0,0 @@ -{ - "extends": "@workspace/typescript-config/nextjs.json", - "compilerOptions": { - "baseUrl": ".", - "paths": { - "@/*": ["./*"], - }, - "allowImportingTsExtensions": true, - }, - "include": ["**/*.ts", "**/*.tsx"], - "exclude": ["node_modules"] -} diff --git a/packages/ui/Archive.zip b/packages/ui/Archive.zip deleted file mode 100644 index a41e319..0000000 Binary files a/packages/ui/Archive.zip and /dev/null differ diff --git a/packages/ui/src/components/button.tsx b/packages/ui/src/components/button.tsx index 4aca337..a26f57f 100644 --- a/packages/ui/src/components/button.tsx +++ b/packages/ui/src/components/button.tsx @@ -1,30 +1,33 @@ -import type * as React from "react" -import { Slot } from "@radix-ui/react-slot" -import { cva, type VariantProps } from "class-variance-authority" +import React from "react"; +import { Slot } from "@radix-ui/react-slot"; +import { cva, type VariantProps } from "class-variance-authority"; -import { cn } from "@workspace/ui/lib/utils" +import { cn } from "@workspace/ui/lib/utils"; const buttonVariants = cva( - "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-xl text-sm font-semibold transition-all duration-200 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/30 focus-visible:ring-4 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transform active:scale-95", + "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-lg text-sm font-medium transition-all duration-200 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0 outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-ring hover:scale-105 active:scale-95 transform-gpu", { variants: { variant: { default: - "bg-primary text-primary-foreground shadow-lg shadow-primary/25 hover:bg-primary/90 hover:shadow-xl hover:shadow-primary/30 hover:-translate-y-0.5 border border-primary/20", + "bg-primary text-primary-foreground shadow-lg shadow-primary/25 hover:bg-primary/85 hover:shadow-xl hover:shadow-primary/35", destructive: - "bg-destructive text-destructive-foreground shadow-lg shadow-destructive/25 hover:bg-destructive/90 hover:shadow-xl hover:shadow-destructive/30 hover:-translate-y-0.5 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 border border-destructive/20", + "bg-destructive text-destructive-foreground shadow-lg shadow-destructive/25 hover:bg-destructive/85 hover:shadow-xl hover:shadow-destructive/35", outline: - "bg-background border-2 border-border text-foreground shadow-md hover:bg-accent/10 hover:border-accent/50 hover:text-accent-foreground hover:shadow-lg hover:-translate-y-0.5 transition-all duration-200 ease-out backdrop-blur-sm", + "border-2 border-primary/20 bg-background hover:bg-primary/5 hover:text-primary hover:border-primary/40 shadow-md hover:shadow-lg hover:shadow-primary/15", secondary: - "bg-secondary text-secondary-foreground shadow-md shadow-secondary/20 hover:bg-secondary/80 hover:shadow-lg hover:-translate-y-0.5 border border-secondary/30", - ghost: "hover:bg-accent/10 hover:text-accent-foreground rounded-lg transition-all duration-200 hover:shadow-md", - link: "text-primary underline-offset-4 hover:underline hover:text-primary/80 transition-colors duration-200", + "bg-secondary text-secondary-foreground shadow-md hover:bg-secondary/80 hover:shadow-lg", + ghost: + "hover:bg-primary/10 hover:text-primary hover:shadow-md hover:shadow-primary/10", + link: "text-primary underline-offset-4 hover:underline hover:text-accent p-0 h-auto font-normal hover:scale-100 active:scale-100", + accent: + "bg-accent text-accent-foreground shadow-lg shadow-accent/25 hover:bg-accent/85 hover:shadow-xl hover:shadow-accent/35", }, size: { - default: "h-11 px-6 py-3 has-[>svg]:px-5", - sm: "h-9 rounded-lg gap-1.5 px-4 has-[>svg]:px-3 text-xs font-medium", - lg: "h-13 rounded-xl px-8 has-[>svg]:px-6 text-base", - icon: "size-11 rounded-xl", + default: "h-10 px-4 py-2", + sm: "h-8 rounded-md px-3 text-xs", + lg: "h-12 rounded-lg px-6 text-base", + icon: "h-10 w-10", }, }, defaultVariants: { @@ -32,21 +35,26 @@ const buttonVariants = cva( size: "default", }, }, -) +); -function Button({ - className, - variant, - size, - asChild = false, - ...props -}: React.ComponentProps<"button"> & - VariantProps & { - asChild?: boolean - }) { - const Comp = asChild ? Slot : "button" - - return +export interface ButtonProps + extends React.ButtonHTMLAttributes, + VariantProps { + asChild?: boolean; } -export { Button, buttonVariants } +const Button = React.forwardRef( + ({ className, variant, size, asChild = false, ...props }, ref) => { + const Comp = asChild ? Slot : "button"; + return ( + + ); + }, +); +Button.displayName = "Button"; + +export { Button, buttonVariants }; diff --git a/packages/ui/src/components/card.tsx b/packages/ui/src/components/card.tsx index 48d9bc4..b0d1d94 100644 --- a/packages/ui/src/components/card.tsx +++ b/packages/ui/src/components/card.tsx @@ -7,7 +7,7 @@ function Card({ className, ...props }: React.ComponentProps<"div">) {
) { type={type} data-slot="input" className={cn( - "file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-12 w-full min-w-0 rounded-xl border-2 bg-transparent px-4 py-3 text-base shadow-md shadow-black/5 transition-all duration-200 outline-none file:inline-flex file:h-8 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm backdrop-blur-sm", + "file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-12 w-full min-w-0 rounded-md border-2 bg-transparent px-4 py-3 text-base shadow-md shadow-black/5 transition-all duration-200 outline-none file:inline-flex file:h-8 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm backdrop-blur-sm", "focus-visible:border-primary focus-visible:ring-primary/20 focus-visible:ring-4 focus-visible:shadow-lg focus-visible:shadow-primary/10", "aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive", "hover:border-border/80 hover:shadow-lg", diff --git a/packages/ui/src/components/progress.tsx b/packages/ui/src/components/progress.tsx index 2d37d8d..f2ff8b8 100644 --- a/packages/ui/src/components/progress.tsx +++ b/packages/ui/src/components/progress.tsx @@ -17,7 +17,7 @@ function Progress({ className, value, ...props }: React.ComponentProps diff --git a/packages/ui/src/components/separator.tsx b/packages/ui/src/components/separator.tsx index 74b1b5f..a2a50e5 100644 --- a/packages/ui/src/components/separator.tsx +++ b/packages/ui/src/components/separator.tsx @@ -17,7 +17,7 @@ function Separator({ decorative={decorative} orientation={orientation} className={cn( - "bg-gradient-to-r from-transparent via-border to-transparent shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px data-[orientation=vertical]:bg-gradient-to-b", + "bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px data-[orientation=vertical]:bg-gradient-to-b", className, )} {...props} diff --git a/packages/ui/src/components/textarea.tsx b/packages/ui/src/components/textarea.tsx index 3535356..079c23d 100644 --- a/packages/ui/src/components/textarea.tsx +++ b/packages/ui/src/components/textarea.tsx @@ -7,7 +7,7 @@ function Textarea({ className, ...props }: React.ComponentProps<"textarea">) {