Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
116 commits
Select commit Hold shift + click to select a range
1006682
add swiper
vfshera Nov 22, 2024
e454435
add repositories section
vfshera Nov 22, 2024
de80692
add projects data
vfshera Nov 22, 2024
0b98af7
fix:modify the dashboard sidebar to match designs
tigawanna Nov 26, 2024
79dac9a
add: script for generationg pages boilerplate
tigawanna Nov 26, 2024
8f8ecec
feat: added docs for the boilerplate script
tigawanna Nov 26, 2024
e0dfa9e
docs: add boilerplate documentation for project setup and best practices
tigawanna Nov 26, 2024
e02bca8
Merge pull request #34 from SpaceyaTech/boilerplate-docs
tigawanna Nov 26, 2024
3e8f1a2
Merge pull request #33 from SpaceyaTech/dashboard-sidebar
tigawanna Nov 26, 2024
fe55d0c
centralize svg icons
vfshera Nov 27, 2024
7e2381e
fix: width issue
vfshera Nov 27, 2024
899a46f
fix: list keys
vfshera Nov 27, 2024
f76e588
progress
tigawanna Nov 28, 2024
fb8459b
refactor: remove unused CSS and component files for cleaner codebase
tigawanna Nov 28, 2024
af57408
cleanup tsc errors
tigawanna Nov 28, 2024
6da3b67
enable tanstack router auto codesplitting
tigawanna Nov 28, 2024
f34b740
lazy load router devtools to keep it out of the final build
tigawanna Nov 28, 2024
617839a
ignore tsconfig.node.tsbuildinfo
tigawanna Nov 28, 2024
b070015
update gitignore to remove tsconfig.node.tsbuildinfo
tigawanna Nov 28, 2024
7f2f5dd
document the css view transions
tigawanna Nov 28, 2024
d8de513
Merge pull request #36 from SpaceyaTech:cleanup
tigawanna Nov 28, 2024
68b067b
Merge branch 'main' into feature/repositories-section
vfshera Nov 28, 2024
f4a1575
add colors to config
vfshera Nov 28, 2024
c1e8d3b
trim projects to 6
vfshera Nov 28, 2024
f2cc729
use native sroll
vfshera Nov 28, 2024
46c521b
font fixes
vfshera Nov 28, 2024
4a0af08
fix full page reload giving 4040 on vercel
tigawanna Nov 28, 2024
c970258
Merge pull request #30 from SpaceyaTech/feature/repositories-section
tigawanna Nov 28, 2024
cf33e3b
Merge branch 'main' into tools-section
tigawanna Nov 28, 2024
dae8fb6
Add ToolsSection component and update styles in HomePage and ToolsSec…
tigawanna Nov 28, 2024
dfbc228
Merge pull request #37 from SpaceyaTech/cleanup
tigawanna Nov 28, 2024
bb0e1a6
Merge pull request #38 from SpaceyaTech:tools-section
tigawanna Nov 28, 2024
a44ca99
fix image paths
tigawanna Nov 28, 2024
8b4fbb9
Update background styles in LandingPageNavbar and RootComponent for i…
tigawanna Nov 28, 2024
c01eb76
Merge pull request #39 from SpaceyaTech/tools-section
tigawanna Nov 28, 2024
fab43aa
Add Playwright testing framework and implement initial tests; update …
tigawanna Nov 28, 2024
f3fc47f
Add example .env file with required BASE_URL for Playwright tests
tigawanna Nov 28, 2024
f0ed0b3
add default base url
tigawanna Nov 28, 2024
8f8053b
Start Vite dev server in Playwright workflow for testing
tigawanna Nov 28, 2024
15e2324
Merge pull request #40 from SpaceyaTech/setup-playwright
tigawanna Nov 28, 2024
aa14420
configure eslint and cleanup existing eslint issues
tigawanna Nov 29, 2024
8473297
Add router types, enhance error handling, and improve search function…
tigawanna Nov 29, 2024
19bb04c
fix bootstrap script
tigawanna Nov 29, 2024
c5556f3
fixed boilerplate script
tigawanna Nov 29, 2024
1d807a5
Refactor test structure: move tests to e2e-tests directory, update Pl…
tigawanna Dec 1, 2024
c332150
Merge pull request #41 from SpaceyaTech:setup-linting-and-testing
tigawanna Dec 1, 2024
41b2369
Remove Playwright workflow and add housekeeping workflow for linting …
tigawanna Dec 1, 2024
8173d79
Add dry run script and refactor scaffold page functionality
tigawanna Dec 1, 2024
cdfa244
fix ci script
tigawanna Dec 1, 2024
1c6fabf
Merge pull request #43 from SpaceyaTech/setup-ci-actions
tigawanna Dec 1, 2024
3ec4733
Refactor end-to-end tests and add Playwright component testing config…
tigawanna Dec 1, 2024
ffd4f08
Test the dashboard navbar header in mobile and desktop mode
tigawanna Dec 1, 2024
5635edb
move dashboard layout component to root
tigawanna Dec 2, 2024
95b0235
Refactor dashboard routes and components for consistency; add Helmet …
tigawanna Dec 2, 2024
a5061f7
add bread crumb test
tigawanna Dec 2, 2024
f55323d
Update test script to run Vitest and Playwright tests sequentially
tigawanna Dec 2, 2024
eebe1dc
Merge pull request #44 from SpaceyaTech:test-dashboard-sidebar
tigawanna Dec 2, 2024
a9cfbe9
Add documentation for project checklist, testing guidelines, and boil…
tigawanna Dec 2, 2024
ec4794e
Merge pull request #45 from SpaceyaTech:test-dashboard-sidebar
tigawanna Dec 2, 2024
2403262
chore:style the Call-to-action in the footer
samoina Dec 6, 2024
7793556
chore: design footer copyright
samoina Dec 8, 2024
5a9011b
chore: add tests for the footer sections
samoina Dec 8, 2024
d379ea8
chore: delete history files, clean up testing for the footer and disa…
samoina Dec 8, 2024
0d92f98
chore: adjust spacing around the blur ellipse image in the FooterCTA
samoina Dec 11, 2024
4beac6b
Merge pull request #46 from SpaceyaTech/feature/footer-cta
tigawanna Dec 11, 2024
733a056
improve setup
vfshera Dec 12, 2024
dfc509f
add test utils
vfshera Dec 12, 2024
23482d6
add unit tests
vfshera Dec 12, 2024
c0994d2
feat: add hero section and make responsive
samoina Dec 13, 2024
74b7717
fix: align the footerCTA image and parent div
samoina Dec 13, 2024
1698da5
Merge remote-tracking branch 'origin/main' into feat/enhance-vitest-s…
tigawanna Dec 13, 2024
31b7e9c
Merge pull request #49 from SpaceyaTech/feat/enhance-vitest-setup
tigawanna Dec 13, 2024
4a9735a
chore: update documentation for TANSTACK-QUERY and TANSTACK-ROUTER, a…
tigawanna Dec 13, 2024
4aa8754
Merge pull request #50 from SpaceyaTech/moredocs
tigawanna Dec 13, 2024
b08a498
chore: add contributors image on the hero section and add hero-sectio…
samoina Dec 13, 2024
12aafb5
add projets and os projects route
tigawanna Dec 13, 2024
ea078a9
remove test code
tigawanna Dec 13, 2024
82b4bba
feat: add ProjectCard component and integrate faker for project data …
tigawanna Dec 13, 2024
78b752d
fix: make footer links clickable by adding z-index
samoina Dec 13, 2024
255bd2e
fix filtering
tigawanna Dec 13, 2024
9dd0cce
Merge pull request #51 from SpaceyaTech/feat/hero-section
tigawanna Dec 14, 2024
710f910
refactor: remove commented-out landing page content from HomePage com…
tigawanna Dec 15, 2024
ede418b
re adjust footer section
tigawanna Dec 15, 2024
2c820ae
make footer logo responsive
tigawanna Dec 15, 2024
8c3c3a1
fix: fix failing tests byt updatung playwright locators and rewrite …
tigawanna Dec 15, 2024
7ab57c3
fix: remove improperly configured tests
tigawanna Dec 15, 2024
b1f26dd
Merge pull request #52 from SpaceyaTech/fix/minor-foxes
tigawanna Dec 15, 2024
b0f9b25
Merge branch 'main' into feat/os-projects-route
tigawanna Dec 15, 2024
50901a0
add scrill restoration
tigawanna Dec 15, 2024
1ffa8c1
feat: add scroll restoration
tigawanna Dec 15, 2024
e9a7ae5
feat: projects list page and one project page
tigawanna Dec 15, 2024
afb646f
feat: update project languages structure to include color property
tigawanna Dec 15, 2024
b60189e
feat: update RouterPendingComponent to display loading image
tigawanna Dec 16, 2024
28651ea
feat: add Submit Project page and routing
tigawanna Dec 16, 2024
32188a9
feat: refactor project properties to use 'title' instead of 'name' an…
tigawanna Dec 16, 2024
8b5b5b4
feat: update project form to include monetization toggle and change p…
tigawanna Dec 16, 2024
a324a31
feat: update ProjectsList component and filterProjects function to us…
tigawanna Dec 17, 2024
a148708
feat: enhance project form to include monetization options and curren…
tigawanna Dec 17, 2024
8bee838
feat: add MonetizationFields component for project compensation options
tigawanna Dec 18, 2024
0e6b97d
feat: integrate MonetizationFields component and update compensation …
tigawanna Dec 18, 2024
e7a8268
feat: add utility functions for locale and currency retrieval
tigawanna Dec 18, 2024
7d36e6c
feat: refactor project form to include ProjectTypeFields component an…
tigawanna Dec 18, 2024
5bfe718
feat: improve layout of project form and submission page for better a…
tigawanna Dec 18, 2024
c0aaaf2
feat: add InviteUsersField component for inviting collaborators in pr…
tigawanna Dec 18, 2024
b6f3261
feat: add RepositoryFields component for GitHub repo link input and e…
tigawanna Dec 19, 2024
5d076af
feat: update @hookform/resolvers to version 3.9.1 and enhance form er…
tigawanna Dec 20, 2024
0cb1a5c
feat: implement RHFInput and RHFErrorWrapper components, enhance proj…
tigawanna Dec 20, 2024
867ee1c
feat: implement RHFTextInput component for improved input handling in…
tigawanna Dec 20, 2024
0bc0554
feat: refactor project form components to use RHFTextInput and add Fo…
tigawanna Dec 20, 2024
6183db7
feat: update project form validation to require a minimum title lengt…
tigawanna Dec 20, 2024
6e281d7
feat: enhance BaseProjectsForm to accept a dynamic Zod schema for val…
tigawanna Dec 20, 2024
11946a3
feat: update onSubmit function in BaseProjectsForm to include mutatio…
tigawanna Dec 20, 2024
61f8c16
fix: add validation and error otputs to all fields
tigawanna Dec 21, 2024
57bcca8
feat: add afterSave callback to onSubmit in BaseProjectsForm; remove …
tigawanna Dec 23, 2024
0ba6af5
feat: add settings route and component; update dashboard project link…
tigawanna Feb 4, 2025
3fe091a
Merge branch 'dev' into feat/os-projects-route
bridgitkanini Jul 26, 2025
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
2 changes: 2 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# base url is required n the .env or playwright tests won't work
BASE_URL="http://localhost:3000"
33 changes: 33 additions & 0 deletions .github/workflows/housekeeping.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: lint and test
on:
push:
branches: [ main, master ]
pull_request:
branches: [ main, master ]
jobs:
test:
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Install dependencies
run: npm install -g pnpm && pnpm install
- name: Install Playwright Browsers
run: pnpm exec playwright install --with-deps
- name: Lint code
run: pnpm lint
- name: Run unit tests
run: pnpm vitest
- name: Start Vite dev server
run: pnpm exec vite --port 3000 &
- name: Run Playwright tests
run: pnpm exec playwright test
- uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: playwright-report
path: playwright-report/
retention-days: 30
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ node_modules
dist
dist-ssr
*.local

.env
# Editor directories and files
.vscode/*
!.vscode/extensions.json
Expand All @@ -22,7 +22,10 @@ dist-ssr
*.njsproj
*.sln
*.sw?
tsconfig.node.tsbuildinfo
/test-results/
/playwright-report/
/blob-report/
/playwright/.cache/
tsconfig.app.tsbuildinfo
codealike.json
333 changes: 0 additions & 333 deletions Syt.js

This file was deleted.

161 changes: 161 additions & 0 deletions docs/BOILERPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
The project is using

### [tanstack router](https://tanstack.com/query/latest)
The router which offers a declarative way to navigate between different routes in a React application.
picked for
- highly configurable file based routing
- auto generated typescript types
- auto code splitting
- nice serach params handling
- possible to upgrade to [tanstack start](https://tanstack.com/start/latest) should `SSR` + `SEO` requiremnents arise


### [tanstack query (react query)](https://tanstack.com/query/latest)
Data fetching and caching library
picked for being the most popular way to handle aysn state in react with caching and preloading capabilities

best practices include

- declaring the `queryOptions` outside of the `useQuery` hook for easy reusability

```tsx
import { queryOptions } from "@tanstack/react-query";
interface usersQueryOptionPropss {
keyword: string;
}
export function usersListQueryOptions({ keyword }: usersQueryOptionPropss) {
return queryOptions({
queryKey: ["users_list", keyword],
queryFn: () => {
return new Promise<{
items: Array<Record<string, any> & { id: string }>;
}>((res, rej) => {
setTimeout(() => {
res({
items: [{ id: "id_1" }, { id: "id_2" }, { id: "id_3" }],
});
}, 1000);
});
},
});
}
```
- using the `useSuspenseQuery` over the `useQuery` hook
> suspense is the new way tohnadle data fetching in react that enebles [render while you fetch](https://www.epicreact.dev/render-as-you-fetch)

- Invalidate queries on mutation
,

The query client setup includes a way to pass in a meta object to the mutation which will contain an array of keys to invalidate
```tsx
// main.tsx
export const queryClient = new QueryClient({
mutationCache: new MutationCache({
onSuccess: async (_, __, ___, mutation) => {
if (Array.isArray(mutation.meta?.invalidates)) {
// biome-ignore lint/complexity/noForEach: <explanation>
mutation.meta?.invalidates.forEach((key) => {
return queryClient.invalidateQueries({
queryKey: [key.trim()],
});
});
}
},
}),
defaultOptions: {
queries: {
staleTime: 1000 * 10,
refetchOnWindowFocus: false,
refetchOnReconnect: false,
},
},
});
// usage
useMutation({
mutationFn: async (value: {}) => {
return new Promise<{}>((resolve, reject) => {
setTimeout(() => {
resolve(value);
}, 2000);
});
},
onSuccess: () => {
makeHotToast({
title: "User added",
description: "User has been added successfully",
variant: "success",
});
},
meta: {
// this will mark any query with the key "users as stale
invalidates: ["users"],
},
})
```
- add any values that your query depends on into the query key
```tsx
function userListQueryOptions({ keyword, first_name,last_name }: usersQueryOptionPropss) {
queryClient({
queryKey: ["users_list", keyword, first_name, last_name],
queryFn: () => {
return new Promise<{
items: Array<Record<string, any> & { id: string }>;
}>((res, rej) => {
setTimeout(() => {
res({
items: [{ id: "id_1",first_name,last_name }, { id: "id_2".first_name,last_name }, { id: "id_3" }],
});
}, 1000);
});
},
});
```
- the tanstack query eslint plugin will catch most of these common issues

### [tailwind css](https://tailwindcss.com/) + [daisyui](https://daisyui.com/)
For styling daisyui is a bootstrap like tailwind classes that can help make your taiiwnd cleaner.
it also comes with nice theme tokens , which are the prefered way of adding background/text colors

```json
daisyui: {
themes: [
{
light: {
"color-scheme": "light",
primary: "#1eb854",
"primary-focus": "#188c40",
"primary-content": "#241f31",
secondary: "#20d55f",
"secondary-focus": "#18aa4b",
"secondary-content": "#000000",
accent: "#d99330",
....
},}...
```
```tsx
<div>
<btn className="btn btn-sm btn-primary">
primary button
</btn>
<div className="bg-base-100">Default background</div>
<div className="bg-base-200">Lighter background</div>
<div className="bg-base-300">Lightest background</div>
<<p className="text-base-content">The default text color</p>
<soan className="text-primary">This will be primary text</span>
</div>
```

### [shadcn](https://ui.shadcn.com/)

A set of accessible components built on [radix ui](https://www.radix-ui.com/primitives) with tailwind styles.

### [zod](https://zod.dev/)
schema validation that helps in confirming the shape of data returned matches the expectations (local storage , search params...)



### [react-hook-form](https://www.react-hook-form.com/)
Form management

### [vitest](https://vitest.dev/) + [playwright](https://playwright.dev/)
unit testing + E2E
14 changes: 14 additions & 0 deletions docs/CHECKLIST.MD
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# CHECKLIST

Before working on a feature, it's recommended to check out the [issues](https://github.com/SpaceyaTech/CoLabs-Frontend/issues) and assign yourself one. If none of them interest you, you can [check out the Figma file](https://www.figma.com/design/2r8LJbRj7TEXZ7obQvVeb8/SpaceYaTech-Website-Re-design?node-id=4-598&node-type=canvas&t=ZX1LpTU4llEME87H-0) and identify the feature you want to work on.
- Create an issue on GitHub with the feature you want to work on and assign yourself.
- Create a branch for the feature you want to work on.
- Work on your feature.
- Write some tests to ensure someone else won't break your code.
- Run the tests, linter, and build to make sure you didn't break anything.
```sh
npm run dryrun
```
- If everything is fine, you can make a pull request and await a review.
- 🎉 🎉 🎉 You did it. Rinse and repeat.

39 changes: 39 additions & 0 deletions docs/TANSTACK-QUERY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# tips

- prefer `useSuspenseQuery` over `useQuery`
- prefer defining `queryOptions` over inlinignthem into the query hooks

```tsx
import { queryOptions,useSuspenseQuery } from "@tanstack/react-query";
//users/queryOptions.ts
// this is re-usable and decltters your components
export const userQueryOptions = queryOptions({
queryKey: ["user"],
queryFn: () => {
...
}
})
// users.tsx
const query = useSuspenseQuery(userQueryOptions);
```
- wrap the data fetching components with `Suspense` component

```tsx
// users page
<div>
<header>Users page</headers>
<Suspense fallback={<div>Loading users</div>}>
<Users />
</Suspense>
</div>
```

run `p/mpm run page users` to scafold a page with these best practices


## handling forms

We'll use [react-hook-form](https://react-hook-form.com/) to manage our forms and [zod](https://zod.dev/) to validate our data.
[quick tutorial on react hhok form + zod](https://www.youtube.com/watch?v=cc_xmawJ8Kg)

then use the useMutation hook
108 changes: 108 additions & 0 deletions docs/TANSTACK-ROUTER.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
- anything under the src/routes folder is a route

ex

- `src/routes/index.tsx` ->` /`
- `src/routes/profile.tsx` or `src/routes/profile/index.tsx` -> `/profile/`

Dynamic routes

- `src/routes/users/$oneuser/index.tsx` -> `/users/$oneuser`

inside here you'll have access to the `oneuser` param

```tsx
// src/routes/users/$user/index.tsx
import { createFileRoute, useParams } from '@tanstack/react-router'

export const Route = createFileRoute('/users/$user')({
component:OneUserComponent,
})
functon OneUserComponent() {
const {user} = useParams({
from:"/users/$user"
})
return (
<div>
<h1>{user}</h1>
</div>
)
}
```

if you nest multiple dynamic routes then you can access them in the same way

```tsx
// src/routes/users/$user/friends/$friend/index.tsx
import { createFileRoute, useParams } from '@tanstack/react-router'

export const Route = createFileRoute('/users/$user/friends/$friend/')({
component: RouteComponent,
})

function RouteComponent() {
const { friend,user } = useParams({
from: "/users/$user/friends/$friend/",
});
return (
<div>
<h1>{user}</h1>
<h1>{friend}</h1>
</div>
);
}


```

you can also define search params ,validate them and auth guard

```tsx
import {
createFileRoute,
redirect,
useNavigate,
useSearch,
} from "@tanstack/react-router";
import { z } from "zod";
const searchparams = z.object({
// make it optional if it won't always be used
page: z.number().optional(),
});

export const Route = createFileRoute("/users/")({
component: RouteComponent,
// declare and validate your search params here
// this page should alwatys have /users?page=1
validateSearch: (search) => searchparams.parse(search),
// this is how you auth guard routes (only allow logged in users here )
async beforeLoad(ctx) {
const viewer = ctx.context?.viewer;
if (!viewer?.record) {
throw redirect({
to: "/auth",
// this search params will be used to redirect you back to this page once you log in
search: { returnTo: ctx.location.pathname },
});
}
},
});

function RouteComponent() {
const { page } = useSearch({
from: "/users/",
});
const navigate = useNavigate({
from: "/users",
});
return (
<div>
{page}
<button onClick={() => navigate({ search: { page: (page ?? 0) + 1 } })}>
next page
</button>
</div>
);
}

```
Loading