Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(onboarding): start on onboarding pages #8

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,16 @@
},
"dependencies": {
"@auth/prisma-adapter": "^2.7.2",
"@hookform/resolvers": "^3.9.1",
"@prisma/client": "^5.14.0",
"@radix-ui/react-accordion": "^1.2.1",
"@radix-ui/react-avatar": "^1.1.1",
"@radix-ui/react-checkbox": "^1.1.2",
"@radix-ui/react-collapsible": "^1.1.1",
"@radix-ui/react-dialog": "^1.1.2",
"@radix-ui/react-dropdown-menu": "^2.1.2",
"@radix-ui/react-label": "^2.1.0",
"@radix-ui/react-select": "^2.1.2",
"@radix-ui/react-separator": "^1.1.0",
"@radix-ui/react-slot": "^1.1.0",
"@radix-ui/react-tooltip": "^1.1.4",
Expand All @@ -47,11 +51,14 @@
"next-auth": "5.0.0-beta.25",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-hook-form": "^7.53.2",
"react-select": "^5.8.3",
"server-only": "^0.0.1",
"superjson": "^2.2.1",
"tailwind-merge": "^2.5.4",
"tailwindcss-animate": "^1.0.7",
"zod": "^3.23.3"
"zod": "^3.23.8",
"zustand": "^5.0.1"
},
"devDependencies": {
"@faker-js/faker": "^9.2.0",
Expand Down
579 changes: 576 additions & 3 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
Warnings:

- The values [MAN,WOMAN] on the enum `Gender` will be removed. If these variants are still used in the database, this will fail.

*/
-- AlterEnum
BEGIN;
CREATE TYPE "Gender_new" AS ENUM ('MALE', 'FEMALE', 'NONBINARY', 'TRANSGENDER', 'OTHER');
ALTER TABLE "User" ALTER COLUMN "mentor_gender" TYPE "Gender_new" USING ("mentor_gender"::text::"Gender_new");
ALTER TABLE "User" ALTER COLUMN "mentee_gender" TYPE "Gender_new"[] USING ("mentee_gender"::text::"Gender_new"[]);
ALTER TYPE "Gender" RENAME TO "Gender_old";
ALTER TYPE "Gender_new" RENAME TO "Gender";
DROP TYPE "Gender_old";
COMMIT;

-- CreateTable
CREATE TABLE "Onboarding" (
"id" TEXT NOT NULL,
"userId" TEXT NOT NULL,
"generalFormCompleted" BOOLEAN NOT NULL DEFAULT false,
"menteeFormCompleted" BOOLEAN NOT NULL DEFAULT false,
"mentorFormCompleted" BOOLEAN NOT NULL DEFAULT false,
"optionsFormCompleted" BOOLEAN NOT NULL DEFAULT false,

CONSTRAINT "Onboarding_pkey" PRIMARY KEY ("id")
);

-- CreateIndex
CREATE UNIQUE INDEX "Onboarding_userId_key" ON "Onboarding"("userId");

-- AddForeignKey
ALTER TABLE "Onboarding" ADD CONSTRAINT "Onboarding_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
15 changes: 13 additions & 2 deletions prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ enum SuggestionStatus {

/// Gender enumeration for user profiles
enum Gender {
MAN
WOMAN
MALE
FEMALE
NONBINARY
TRANSGENDER
OTHER
Expand Down Expand Up @@ -196,6 +196,17 @@ model User {
menteeSoftSkills SoftSkill[] @relation("MenteeSoftSkills")
/// Industries that user has experience in
industries Industry[] @relation("UserIndustries")
onboarding Onboarding? @relation("Onboarding")
}

model Onboarding{
id String @id @default(cuid())
userId String @unique
user User @relation("Onboarding", fields: [userId], references: [id])
generalFormCompleted Boolean @default(false)
menteeFormCompleted Boolean @default(false)
mentorFormCompleted Boolean @default(false)
optionsFormCompleted Boolean @default(false)
}

/// Verification tokens for passwordless authentication
Expand Down
20 changes: 20 additions & 0 deletions prisma/seeds.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
import { seedAccounts } from './seeds/accounts';
import { seedConversations } from './seeds/conversations'; // Import the new seeding function
import { seedGoals } from './seeds/goals';
import { seedIndustries } from './seeds/industries';
import { seedMentorships } from './seeds/mentorships';
import { seedMessages } from './seeds/messages';
import { seedSeniorityLevels } from './seeds/seniority';
import { seedSessions } from './seeds/sessions';
import { seedSkills } from './seeds/skills';
import { seedSoftSkills } from './seeds/softSkills';
import { seedSuggestions } from './seeds/suggestions';
import { seedUsers } from './seeds/users';

Expand All @@ -21,6 +25,22 @@ async function main() {
logStep('Seeding skills...', '🌟');
await seedSkills();

currentStep = 'softSkills';
logStep('Seeding soft skills...', '🌟');
await seedSoftSkills();

currentStep = 'goals';
logStep('Seeding goals...', '🌟');
await seedGoals();

currentStep = 'seniority';
logStep('Seeding seniority levels...', '🌟');
await seedSeniorityLevels();

currentStep = 'industries';
logStep('Seeding industries...', '🌟');
await seedIndustries();

currentStep = 'users';
logStep('Seeding users...', '👥');
await seedUsers();
Expand Down
19 changes: 19 additions & 0 deletions prisma/seeds/goals.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { PrismaClient } from '@prisma/client';

const prisma = new PrismaClient();

export async function seedGoals() {
const goals = [
{ name: 'Get promoted', slug: 'get-promoted' },
{ name: 'Get a job', slug: 'get-a-job' },
{ name: 'Go back to school', slug: 'go-back-to-school' },
{ name: 'Learn a new skill', slug: 'learn-a-new-skill' },
{ name: 'Get a certification', slug: 'get-a-certification' },
{ name: 'Start a Company', slug: 'start-a-company' },
{ name: 'Guidance on a side project', slug: 'guidance-on-a-side-project' },
{ name: 'Work on resume', slug: 'work-on-resume' },
{ name: 'Interview Prep', slug: 'interview-prep' },
];

await prisma.goal.createMany({ data: goals });
}
51 changes: 51 additions & 0 deletions prisma/seeds/industries.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import { PrismaClient } from '@prisma/client';

const prisma = new PrismaClient();

export async function seedIndustries() {
const industries = [
{ name: '3D printing', slug: '3d-printing' },
{ name: 'AdTech', slug: 'adtech' },
{ name: 'AI/Machine Learning', slug: 'ai-machine-learning' },
{ name: 'Augmented reality', slug: 'augmented-reality' },
{ name: 'Big Data Analytics', slug: 'big-data-analytics' },
{ name: 'Blockchain', slug: 'blockchain' },
{ name: 'Cloud computing', slug: 'cloud-computing' },
{ name: 'Cybersecurity', slug: 'cybersecurity' },
{ name: 'Data Science', slug: 'data-science' },
{ name: 'Digital Marketing', slug: 'digital-marketing' },
{ name: 'E-commerce', slug: 'e-commerce' },
{ name: 'EdTech', slug: 'edtech' },
{ name: 'Enterprise Software', slug: 'enterprise-software' },
{ name: 'FinTech', slug: 'fintech' },
{ name: 'Gaming', slug: 'gaming' },
{ name: 'Healthtech', slug: 'healthtech' },
{ name: 'HR Tech', slug: 'hr-tech' },
{ name: 'Insurtech', slug: 'insurtech' },
{ name: 'Internet of Things (IoT)', slug: 'internet-of-things-iot' },
{ name: 'Legal Tech', slug: 'legal-tech' },
{ name: 'Logistics Tech (LogTech)', slug: 'logistics-tech-logtech' },
{ name: 'Machine learning', slug: 'machine-learning' },
{ name: 'Media Tech', slug: 'media-tech' },
{ name: 'Mobile App Development', slug: 'mobile-app-development' },
{ name: 'Mobile applications', slug: 'mobile-applications' },
{ name: 'Nanotechnology', slug: 'nanotechnology' },
{ name: 'Natural language processing (NLP)', slug: 'natural-language-processing-nlp' },
{ name: 'Network infrastructure', slug: 'network-infrastructure' },
{ name: 'Proptech (Property Technology)', slug: 'proptech-property-technology' },
{ name: 'Quantum computing', slug: 'quantum-computing' },
{ name: 'RegTech (Regulatory Technology)', slug: 'regtech-regulatory-technology' },
{ name: 'Robotics', slug: 'robotics' },
{ name: 'Semiconductor manufacturing', slug: 'semiconductor-manufacturing' },
{ name: 'Social Media', slug: 'social-media' },
{ name: 'Software as a Service (SaaS)', slug: 'software-as-a-service-saas' },
{ name: 'Space technology', slug: 'space-technology' },
{ name: 'Telecommunications', slug: 'telecommunications' },
{ name: 'Virtual Reality', slug: 'virtual-reality' },
{ name: 'Wearable technology', slug: 'wearable-technology' },
{ name: 'Web Development', slug: 'web-development' },
{ name: 'Wireless technology', slug: 'wireless-technology' },
];

await prisma.industry.createMany({ data: industries });
}
18 changes: 18 additions & 0 deletions prisma/seeds/seniority.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { PrismaClient } from '@prisma/client';

const prisma = new PrismaClient();

export async function seedSeniorityLevels() {
const seniorityLevels = [
{ name: 'Still in school/bootcamp or just graduated', slug: 'still-in-school-bootcamp-or-just-graduated' },
{ name: 'Less than 3 years experience', slug: 'less-than-3-years-experience' },
{ name: '3-7 years experience', slug: '3-7-years-experience' },
{ name: '7+ years of experience', slug: '7-plus-years-of-experience' },
{
name: 'Just here to help with resumes and finding jobs',
slug: 'just-here-to-help-with-resumes-and-finding-jobs',
},
];

await prisma.seniorityLevel.createMany({ data: seniorityLevels });
}
27 changes: 27 additions & 0 deletions prisma/seeds/softSkills.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { PrismaClient } from '@prisma/client';

const prisma = new PrismaClient();

export async function seedSoftSkills() {
const softSkills = [
{ name: 'Entrepreneurship', slug: 'entrepreneurship' },
{ name: 'Innovating', slug: 'innovating' },
{ name: 'Effective communication', slug: 'effective-communication' },
{ name: 'Leadership', slug: 'leadership' },
{ name: 'Problem solving', slug: 'problem-solving' },
{ name: 'Meeting facilitation', slug: 'meeting-facilitation' },
{ name: 'Effective Delegation', slug: 'effective-delegation' },
{ name: 'Job Searching/Interview Prep', slug: 'job-searching-interview-prep' },
{ name: 'Writing a resume', slug: 'writing-a-resume' },
{ name: 'Hiring skills', slug: 'hiring-skills' },
{ name: 'Adaptability', slug: 'adaptability' },
{ name: 'Time management', slug: 'time-management' },
{ name: 'Active listening', slug: 'active-listening' },
{ name: 'Conflict resolution', slug: 'conflict-resolution' },
{ name: 'Collaboration', slug: 'collaboration' },
{ name: 'Networking', slug: 'networking' },
{ name: 'Presentation skills', slug: 'presentation-skills' },
];

await prisma.softSkill.createMany({ data: softSkills });
}
4 changes: 2 additions & 2 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { TRPCReactProvider } from '~/trpc/react';
import { api } from '~/trpc/server';

export const metadata: Metadata = {
title: 'Tampa <Devs></Devs> Mentorship',
title: 'Tampa Devs Mentorship',
description: 'Tampa Devs Mentorship',
icons: [{ rel: 'icon', url: '/favicon.ico' }],
};
Expand Down Expand Up @@ -39,7 +39,7 @@ export default async function RootLayout({
<div className="min-h-full">
<main className="mx-auto">{children}</main>
</div>
<Footer />
{/* <Footer /> */}
</TRPCReactProvider>
</body>
</html>
Expand Down
19 changes: 0 additions & 19 deletions src/app/onboarding/[onboardingId]/expertise/page.tsx

This file was deleted.

19 changes: 0 additions & 19 deletions src/app/onboarding/[onboardingId]/interests/page.tsx

This file was deleted.

19 changes: 0 additions & 19 deletions src/app/onboarding/[onboardingId]/preferences/page.tsx

This file was deleted.

19 changes: 0 additions & 19 deletions src/app/onboarding/[onboardingId]/start/page.tsx

This file was deleted.

Loading