- {#each features as feature}
-
-
-
-
- {feature.name}
-
-
-
- {feature.description}
-
-
- {/each}
+
+
+
+
+ Unleash the Power of Your Developer Profile
+
+
+ Designed to showcase your skills, projects, and contributions effortlessly, Route empowers
+ developers to tell their story with ease.
+
+
+
+
+ {#each features as feature}
+
+
-
+
+
+
+ {feature.name}
+
+
-
+
+ {feature.description}
+
+
+
+ {/each}
+
+
-
+
diff --git a/src/lib/components/Index/Footer.svelte b/src/lib/components/Index/Footer.svelte
new file mode 100644
index 0000000..8ec063b
--- /dev/null
+++ b/src/lib/components/Index/Footer.svelte
@@ -0,0 +1,19 @@
+
+
+
diff --git a/src/lib/components/Index/Hero.svelte b/src/lib/components/Index/Hero.svelte
new file mode 100644
index 0000000..3cc789c
--- /dev/null
+++ b/src/lib/components/Index/Hero.svelte
@@ -0,0 +1,74 @@
+
+
+
+
+
+
+
+ Your Developer Identity, Streamlined and Simplified
+
+
+ Create a profile that highlights your GitHub stats and key projects—simple, clean, and
+ yours.
+
+
+ {#if $page.data.session}
+
+
+ {:else}
+
+ {/if}
+
+
+
+
+
+
+
+
+
diff --git a/src/lib/components/Index/Introduction.svelte b/src/lib/components/Index/Introduction.svelte
deleted file mode 100644
index b621c08..0000000
--- a/src/lib/components/Index/Introduction.svelte
+++ /dev/null
@@ -1,39 +0,0 @@
-
-
-
-
- Build, Connect, and Showcase with Route
-
-
- Keep your GitHub activity live, showcase your tools, and create a portfolio that highlights your
- skills—all in one dynamic platform.
-
-
- {#if $page.data.session}
-
-
- {:else}
-
- {/if}
-
-
-
-
diff --git a/src/lib/components/PublicProfile/BasicInfo.svelte b/src/lib/components/PublicProfile/BasicInfo.svelte
index fdfce31..1481c7b 100644
--- a/src/lib/components/PublicProfile/BasicInfo.svelte
+++ b/src/lib/components/PublicProfile/BasicInfo.svelte
@@ -6,6 +6,7 @@
import { Skeleton } from '$lib/components/ui/skeleton';
import type { GithubData } from '$lib/types/GithubData';
import type { PublicProfile } from '$lib/types/PublicProfile';
+ import { Badge } from '$lib/components/ui/badge';
export let githubData: GithubData | null;
export let userData: PublicProfile;
@@ -24,7 +25,20 @@
{#if githubData}
{#if githubData.name}
-
{githubData.name}
+
+
{githubData.name}
+
+ {#if userData.isOpenToCollaborating}
+ Open to Collaborating
+ {:else}
+ Not Open to Collaborating
+ {/if}
+
+
{:else}
{userData.username}
{/if}
diff --git a/src/lib/components/PublicProfile/TechStack.svelte b/src/lib/components/PublicProfile/TechStack.svelte
index 51823d7..70f1145 100644
--- a/src/lib/components/PublicProfile/TechStack.svelte
+++ b/src/lib/components/PublicProfile/TechStack.svelte
@@ -23,7 +23,7 @@
- Tech Stack
+ Skills & Tools
Explore the developer's skills and expertise
diff --git a/src/lib/components/ui/separator/index.ts b/src/lib/components/ui/separator/index.ts
new file mode 100644
index 0000000..82442d2
--- /dev/null
+++ b/src/lib/components/ui/separator/index.ts
@@ -0,0 +1,7 @@
+import Root from "./separator.svelte";
+
+export {
+ Root,
+ //
+ Root as Separator,
+};
diff --git a/src/lib/components/ui/separator/separator.svelte b/src/lib/components/ui/separator/separator.svelte
new file mode 100644
index 0000000..aa61f69
--- /dev/null
+++ b/src/lib/components/ui/separator/separator.svelte
@@ -0,0 +1,22 @@
+
+
+
diff --git a/src/lib/components/ui/switch/index.ts b/src/lib/components/ui/switch/index.ts
new file mode 100644
index 0000000..f5533db
--- /dev/null
+++ b/src/lib/components/ui/switch/index.ts
@@ -0,0 +1,7 @@
+import Root from "./switch.svelte";
+
+export {
+ Root,
+ //
+ Root as Switch,
+};
diff --git a/src/lib/components/ui/switch/switch.svelte b/src/lib/components/ui/switch/switch.svelte
new file mode 100644
index 0000000..d61db5d
--- /dev/null
+++ b/src/lib/components/ui/switch/switch.svelte
@@ -0,0 +1,28 @@
+
+
+
+
+
diff --git a/src/lib/constants/features.ts b/src/lib/constants/features.ts
index 0123372..d4390e8 100644
--- a/src/lib/constants/features.ts
+++ b/src/lib/constants/features.ts
@@ -12,7 +12,7 @@ export const features = [
icon: Github
},
{
- name: 'Tech Stack',
+ name: 'Skills & Tools',
description: 'Showcase your preferred tools and technologies with sleek graphs.',
icon: ChartArea
},
@@ -24,8 +24,7 @@ export const features = [
},
{
name: 'Open Source',
- description:
- 'Join a thriving open-source community, contribute to projects, and showcase your own contributions.',
+ description: 'Join a thriving open-source community and help us make all software open-source.',
icon: GitPullRequestArrow
}
];
diff --git a/src/lib/constants/socials.ts b/src/lib/constants/socials.ts
new file mode 100644
index 0000000..e985749
--- /dev/null
+++ b/src/lib/constants/socials.ts
@@ -0,0 +1,10 @@
+// features.ts
+import { Github } from 'lucide-svelte';
+
+export const socials = [
+ {
+ name: 'GitHub',
+ link: 'https://github.com/s1lvax/route',
+ icon: Github
+ }
+];
diff --git a/src/lib/types/GithubData.ts b/src/lib/types/GithubData.ts
index e794ba8..126136b 100644
--- a/src/lib/types/GithubData.ts
+++ b/src/lib/types/GithubData.ts
@@ -14,3 +14,25 @@ export interface GithubData {
export interface GitHubEvent {
created_at: string;
}
+
+export interface Contributor {
+ login: string;
+ id: number;
+ node_id: string;
+ avatar_url: string;
+ gravatar_id: string;
+ url: string;
+ html_url: string;
+ followers_url: string;
+ following_url: string;
+ gists_url: string;
+ starred_url: string;
+ subscriptions_url: string;
+ organizations_url: string;
+ repos_url: string;
+ events_url: string;
+ received_events_url: string;
+ type: string;
+ site_admin: boolean;
+ contributions: number;
+}
diff --git a/src/lib/types/PublicProfile.ts b/src/lib/types/PublicProfile.ts
index 1c03d94..51a2ee4 100644
--- a/src/lib/types/PublicProfile.ts
+++ b/src/lib/types/PublicProfile.ts
@@ -2,4 +2,5 @@ export interface PublicProfile {
links: Array<{ title: string; url: string }>;
skills: Array<{ title: string; level: string }>;
username: string;
+ isOpenToCollaborating: boolean;
}
diff --git a/src/lib/types/User.ts b/src/lib/types/User.ts
index 4a5e052..8a9d82d 100644
--- a/src/lib/types/User.ts
+++ b/src/lib/types/User.ts
@@ -3,5 +3,6 @@ export interface User {
githubId: number;
githubUsername: string;
views: number;
+ openToCollaborating: boolean;
updatedAt: Date;
}
diff --git a/src/lib/utils/updateOpenToCollaborating.ts b/src/lib/utils/updateOpenToCollaborating.ts
new file mode 100644
index 0000000..787475d
--- /dev/null
+++ b/src/lib/utils/updateOpenToCollaborating.ts
@@ -0,0 +1,27 @@
+import { prisma } from '$lib/server/prisma';
+
+export const updateOpenToCollaborating = async (githubId: number) => {
+ try {
+ // fetch current state
+ const user = await prisma.user.findUnique({
+ where: { githubId: githubId },
+ select: { openToCollaborating: true }
+ });
+
+ if (!user) {
+ throw new Error('User not found');
+ }
+
+ // generate new value
+ const newOpenToCollaboratingValue = !user.openToCollaborating;
+
+ // update db
+ await prisma.user.update({
+ where: { githubId: githubId },
+ data: { openToCollaborating: newOpenToCollaboratingValue }
+ });
+ } catch (error) {
+ console.log(error);
+ throw new Error('Failed to update openToCollaborating status');
+ }
+};
diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte
index 36fff3d..4aa96b8 100644
--- a/src/routes/+page.svelte
+++ b/src/routes/+page.svelte
@@ -1,9 +1,17 @@
-
-
-
+
+
+
+
+
+
+
+
diff --git a/src/routes/[username]/+page.server.ts b/src/routes/[username]/+page.server.ts
index 8be907e..2ca9b11 100644
--- a/src/routes/[username]/+page.server.ts
+++ b/src/routes/[username]/+page.server.ts
@@ -35,10 +35,16 @@ export const load: PageServerLoad = async ({ params }) => {
orderBy: [{ order: 'asc' }]
});
+ const isOpenToCollaborating = await prisma.user.findUnique({
+ where: { githubId: user.githubId },
+ select: { openToCollaborating: true }
+ });
+
const userData = {
links,
skills,
- username: username
+ username: username,
+ isOpenToCollaborating: isOpenToCollaborating?.openToCollaborating
};
return {
diff --git a/src/routes/profile/+page.server.ts b/src/routes/profile/+page.server.ts
index b69fa72..01c0ac0 100644
--- a/src/routes/profile/+page.server.ts
+++ b/src/routes/profile/+page.server.ts
@@ -9,6 +9,7 @@ import { linksSchema } from '$lib/schemas/links';
import type { User } from '$lib/types/User';
import { skillsSchema } from '$lib/schemas/skills';
import { deleteUser } from '$lib/utils/deleteUser';
+import { updateOpenToCollaborating } from '$lib/utils/updateOpenToCollaborating';
// Define the user variable with a possible null
let user: User | null = null;
@@ -57,7 +58,8 @@ export const load: PageServerLoad = async (event) => {
// Create userStats object
const userData = {
username: user.githubUsername,
- views: user.views || 0
+ views: user.views || 0,
+ openToCollaborating: user.openToCollaborating
};
// Initialize forms using superValidate
@@ -89,9 +91,9 @@ export const actions: Actions = {
if (user) {
try {
- const linkCount = await prisma.link.count({where: { userId: user.githubId }});
+ const linkCount = await prisma.link.count({ where: { userId: user.githubId } });
if (linkCount >= 15) {
- return fail(400, {form, message: 'You have reached the maximum limit of 15 links.'});
+ return fail(400, { form, message: 'You have reached the maximum limit of 15 links.' });
}
await prisma.link.create({
data: {
@@ -148,9 +150,9 @@ export const actions: Actions = {
if (user) {
try {
- const skillCount = await prisma.skill.count({where :{userId:user.githubId}});
+ const skillCount = await prisma.skill.count({ where: { userId: user.githubId } });
if (skillCount >= 15) {
- return fail(400, {form,message:'You have reached the maximum limit of 15 skills'})
+ return fail(400, { form, message: 'You have reached the maximum limit of 15 skills' });
}
await prisma.skill.create({
data: {
@@ -214,5 +216,18 @@ export const actions: Actions = {
}
}
throw redirect(303, '/');
+ },
+ updateOpenToCollaborating: async () => {
+ console.log('Updating openToCollaborating status');
+ //delete user
+ if (user) {
+ try {
+ // update value
+ updateOpenToCollaborating(user.githubId);
+ } catch (error) {
+ console.log(error);
+ throw Error('Failed to delete user');
+ }
+ }
}
};
diff --git a/src/routes/profile/+page.svelte b/src/routes/profile/+page.svelte
index a99a34c..2ea069d 100644
--- a/src/routes/profile/+page.svelte
+++ b/src/routes/profile/+page.svelte
@@ -2,6 +2,7 @@
import * as Card from '$lib/components/ui/card';
import { Button } from '$lib/components/ui/button';
import type { PageData } from './$types';
+ import { Separator } from '$lib/components/ui/separator/index.js';
import LinkForm from '$lib/components/MyProfile/LinkForm.svelte';
import UserStats from '$lib/components/MyProfile/UserStats.svelte';
@@ -16,6 +17,9 @@
import { onMount } from 'svelte';
import type { PrivateProfileData } from '$lib/types/PrivateProfileData';
+ import { Label } from '$lib/components/ui/label/index.js';
+ import { Switch } from '$lib/components/ui/switch/index.js';
+
let githubData: GithubData | null = null;
let privateProfileData: PrivateProfileData | null = null;
export let data: PageData;
@@ -43,6 +47,26 @@