Skip to content

Commit

Permalink
Squashed commit of the following:
Browse files Browse the repository at this point in the history
commit ebd3585
Author: Garrett Ladley <[email protected]>
Date:   Fri Apr 26 19:08:39 2024 -0400

    chore: update swagger docs lol (#670)

commit 5e577b5
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Fri Apr 26 18:55:57 2024 -0400

    Chore(deps): Bump gorm.io/gorm from 1.25.9 to 1.25.10 in /backend (#651)

    Signed-off-by: dependabot[bot] <[email protected]>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    Co-authored-by: Garrett Ladley <[email protected]>

commit dae8559
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Fri Apr 26 18:53:57 2024 -0400

    Chore(deps): Bump zod from 3.22.4 to 3.23.4 in /frontend/lib (#653)

    Signed-off-by: dependabot[bot] <[email protected]>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    Co-authored-by: Garrett Ladley <[email protected]>

commit e783266
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Fri Apr 26 18:53:34 2024 -0400

    Chore(deps): Bump @react-native-menu/menu from 1.0.0 to 1.0.1 in /frontend/mobile (#654)

    Signed-off-by: dependabot[bot] <[email protected]>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    Co-authored-by: Garrett Ladley <[email protected]>

commit 28b0601
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Fri Apr 26 18:53:13 2024 -0400

    Chore(deps-dev): Bump react-test-renderer from 18.2.0 to 18.3.1 in /frontend/mobile (#655)

    Signed-off-by: dependabot[bot] <[email protected]>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    Co-authored-by: Garrett Ladley <[email protected]>

commit 8fb976f
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Fri Apr 26 18:52:50 2024 -0400

    Chore(deps): Bump zod from 3.22.4 to 3.23.4 in /frontend/mobile (#656)

    Signed-off-by: dependabot[bot] <[email protected]>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    Co-authored-by: Garrett Ladley <[email protected]>

commit 91bd0fa
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Fri Apr 26 18:51:59 2024 -0400

    Chore(deps): Bump react-native-svg from 15.1.0 to 15.2.0 in /frontend/mobile (#657)

    Signed-off-by: dependabot[bot] <[email protected]>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    Co-authored-by: Garrett Ladley <[email protected]>

commit 1c3af86
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Fri Apr 26 18:51:24 2024 -0400

    Chore(deps): Bump react-native-screens from 3.30.1 to 3.31.1 in /frontend/mobile (#658)

    Signed-off-by: dependabot[bot] <[email protected]>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    Co-authored-by: Garrett Ladley <[email protected]>

commit 438543c
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Fri Apr 26 18:51:00 2024 -0400

    Chore(deps-dev): Bump eslint-config-next from 14.2.2 to 14.2.3 in /frontend/web (#659)

    Signed-off-by: dependabot[bot] <[email protected]>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    Co-authored-by: Garrett Ladley <[email protected]>

commit d17a368
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Fri Apr 26 18:50:31 2024 -0400

    Chore(deps): Bump next from 14.2.2 to 14.2.3 in /frontend/web (#661)

    Signed-off-by: dependabot[bot] <[email protected]>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    Co-authored-by: Garrett Ladley <[email protected]>

commit 0683f69
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Fri Apr 26 18:50:09 2024 -0400

    Chore(deps): Bump zod from 3.23.3 to 3.23.4 in /frontend/dashboard (#663)

    Signed-off-by: dependabot[bot] <[email protected]>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    Co-authored-by: Garrett Ladley <[email protected]>

commit b37cac2
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Fri Apr 26 18:49:46 2024 -0400

    Chore(deps-dev): Bump eslint-config-next from 14.2.2 to 14.2.3 in /frontend/dashboard (#664)

    Signed-off-by: dependabot[bot] <[email protected]>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    Co-authored-by: Garrett Ladley <[email protected]>

commit bc681d3
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Fri Apr 26 18:49:22 2024 -0400

    Chore(deps): Bump next from 14.2.2 to 14.2.3 in /frontend/dashboard (#666)

    Signed-off-by: dependabot[bot] <[email protected]>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    Co-authored-by: Garrett Ladley <[email protected]>

commit 808fa7a
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Fri Apr 26 18:49:01 2024 -0400

    Chore(deps): Bump github.com/aws/aws-sdk-go from 1.51.25 to 1.51.30 in /backend (#650)

    Signed-off-by: dependabot[bot] <[email protected]>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    Co-authored-by: Garrett Ladley <[email protected]>

commit e8e3859
Author: Garrett Ladley <[email protected]>
Date:   Fri Apr 26 18:48:32 2024 -0400

    feat: dashboard in cli (#665)

commit 5ae64c2
Author: Garrett Ladley <[email protected]>
Date:   Fri Apr 26 18:45:51 2024 -0400

    feat: fe lib ci (#652)

commit 0eb16da
Author: Garrett Ladley <[email protected]>
Date:   Fri Apr 26 17:30:51 2024 -0400

    feat: register dashboard and lib with dependabot (#648)

commit 5b38adc
Author: Garrett Ladley <[email protected]>
Date:   Fri Apr 26 17:28:51 2024 -0400

    fix: misc fe pathing with drop of 'sac-' fe dir prefix (#646)

commit e556197
Author: Garrett Ladley <[email protected]>
Date:   Thu Apr 25 18:00:07 2024 -0400

    chore: remove gorm in go structs (#641)

commit a0ed6d4
Author: David Oduneye <[email protected]>
Date:   Thu Apr 25 14:27:41 2024 -0400

    feat: move authentication route to user, club authorization  (#637)

    Co-authored-by: Garrett Ladley <[email protected]>

commit 25002d5
Author: Garrett Ladley <[email protected]>
Date:   Thu Apr 25 14:25:58 2024 -0400

    fix: frontend ci (#639)

commit a28089a
Author: Alder Whiteford <[email protected]>
Date:   Thu Apr 25 14:13:56 2024 -0400

    feat: frontend lib, rtk migration, & dashboard init (#632)

    Co-authored-by: David Oduneye <[email protected]>
    Co-authored-by: Alder Whiteford <[email protected]>
    Co-authored-by: garrettladley <[email protected]>
  • Loading branch information
DOOduneye committed Apr 27, 2024
1 parent 326a955 commit 8ce3d9c
Show file tree
Hide file tree
Showing 21 changed files with 740 additions and 584 deletions.
8 changes: 6 additions & 2 deletions frontend/dashboard/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,12 @@
"autoprefixer": "^10.4.19",
"eslint": "^8",
"eslint-config-next": "14.2.3",
"jest": "^29.2.1",
"postcss": "^8",
"tailwindcss": "^3.4.1",
"typescript": "^5"
"typescript": "^5",
"@trivago/prettier-plugin-sort-imports": "^4.3.0",
"eslint-plugin-prettier": "^5.1.3",
"prettier": "^3.2.4"
}
}
}
9 changes: 5 additions & 4 deletions frontend/dashboard/src/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { useUsersQuery } from "@sac/lib";

Check notice

Code scanning / CodeQL

Unused variable, import, function or class Note

Unused import useUsersQuery.

import Image from "next/image";

export default function Home() {
Expand Down Expand Up @@ -47,7 +48,7 @@ export default function Home() {
target="_blank"
rel="noopener noreferrer"
>
<h2 className="mb-3 text-2xl font-semibold">
<h2 className={`mb-3 text-2xl font-semibold`}>
Docs{" "}
<span className="inline-block transition-transform group-hover:translate-x-1 motion-reduce:transform-none">
-&gt;
Expand All @@ -64,7 +65,7 @@ export default function Home() {
target="_blank"
rel="noopener noreferrer"
>
<h2 className="mb-3 text-2xl font-semibold">
<h2 className={`mb-3 text-2xl font-semibold`}>
Learn{" "}
<span className="inline-block transition-transform group-hover:translate-x-1 motion-reduce:transform-none">
-&gt;
Expand All @@ -81,7 +82,7 @@ export default function Home() {
target="_blank"
rel="noopener noreferrer"
>
<h2 className="mb-3 text-2xl font-semibold">
<h2 className={`mb-3 text-2xl font-semibold`}>
Templates{" "}
<span className="inline-block transition-transform group-hover:translate-x-1 motion-reduce:transform-none">
-&gt;
Expand All @@ -98,7 +99,7 @@ export default function Home() {
target="_blank"
rel="noopener noreferrer"
>
<h2 className="mb-3 text-2xl font-semibold">
<h2 className={`mb-3 text-2xl font-semibold`}>
Deploy{" "}
<span className="inline-block transition-transform group-hover:translate-x-1 motion-reduce:transform-none">
-&gt;
Expand Down
31 changes: 31 additions & 0 deletions frontend/lib/api/category.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import { z } from "zod";

import { API_BASE_URL } from "@/const";
import { Category, categorySchema } from "@/types/category";
import { uuid } from "@/types/uuid";
import { createApi, fetchBaseQuery } from "@reduxjs/toolkit/query/react";

export const categoriesApi = createApi({
reducerPath: "categoriesApi",
baseQuery: fetchBaseQuery({ baseUrl: API_BASE_URL }),
tagTypes: ["Categories"],
endpoints: (builder) => ({
categories: builder.query<Category[], void>({
query: () => "categories",
transformResponse: (rawResponse: unknown) => {
return z.array(categorySchema).parse(rawResponse);
},
providesTags: [{ type: "Categories", id: "LIST" }],
}),
category: builder.query<Category, uuid>({
query: (categoryID: uuid) => `categories/${categoryID}`,
transformResponse: (rawResponse: unknown) => {
return categorySchema.parse(rawResponse);
},
providesTags: (result, _, categoryID) =>
result ? [{ type: "Categories", id: categoryID }] : [],
}),
}),
});

export const { useCategoriesQuery, useCategoryQuery } = categoriesApi;
52 changes: 52 additions & 0 deletions frontend/lib/api/club.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import { API_BASE_URL } from "@/const";
import { Club } from "@/types/club";
import { Contact } from "@/types/contact";
import { Tag } from "@/types/tag";
import { uuid } from "@/types/uuid";
import { createApi, fetchBaseQuery } from "@reduxjs/toolkit/query/react";

export const clubsApi = createApi({
reducerPath: "clubsApi",
baseQuery: fetchBaseQuery({ baseUrl: API_BASE_URL }),
tagTypes: ["Clubs"],
endpoints: (builder) => ({
clubs: builder.query<Club[], void>({
query: () => "clubs",
// transformResponse: (rawResponse: unknown) => {
// return z.array(clubSchema).parse(rawResponse);
// },
providesTags: [{ type: "Clubs", id: "LIST" }],
}),
club: builder.query<Club, uuid>({
query: (clubID: uuid) => `clubs/${clubID}`,
// transformResponse: (rawResponse: unknown) => {
// return clubSchema.parse(rawResponse);
// },
providesTags: (result, _, clubID) =>
result ? [{ type: "Clubs", id: clubID }] : [],
}),
clubContacts: builder.query<Contact[], uuid>({
query: (clubID: uuid) => `clubs/${clubID}/contacts`,
// transformResponse: (rawResponse: unknown) => {
// return z.array(contactSchema).parse(rawResponse);
// },
providesTags: (result, _, clubID) =>
result ? [{ type: "Clubs", id: clubID }] : [],
}),
clubTags: builder.query<Tag[], uuid>({
query: (clubID: uuid) => `clubs/${clubID}/tags`,
// transformResponse: (rawResponse: unknown) => {
// return z.array(tagSchema).parse(rawResponse);
// },
providesTags: (result, _, clubID) =>
result ? [{ type: "Clubs", id: clubID }] : [],
}),
}),
});

export const {
useClubsQuery,
useClubQuery,
useClubContactsQuery,
useClubTagsQuery,
} = clubsApi;
27 changes: 27 additions & 0 deletions frontend/lib/api/contact.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { z } from "zod";

import { API_BASE_URL } from "@/const";
import { Contact, contactSchema } from "@/types/contact";
import { uuid } from "@/types/uuid";
import { createApi, fetchBaseQuery } from "@reduxjs/toolkit/query/react";

export const contactsApi = createApi({
reducerPath: "contactApi",
baseQuery: fetchBaseQuery({ baseUrl: API_BASE_URL }),
endpoints: (builder) => ({
contacts: builder.query<Contact[], void>({
query: () => "contacts",
transformResponse: (rawResponse: unknown) => {
return z.array(contactSchema).parse(rawResponse);
},
}),
contact: builder.query<Contact, uuid>({
query: (contactID: uuid) => `contacts/${contactID}`,
transformResponse: (rawResponse: unknown) => {
return contactSchema.parse(rawResponse);
},
}),
}),
});

export const { useContactsQuery } = contactsApi;
51 changes: 51 additions & 0 deletions frontend/lib/api/event.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import { API_BASE_URL } from "@/const";
import { Club } from "@/types/club";
import { Event } from "@/types/event";
import { uuid } from "@/types/uuid";
import { createApi, fetchBaseQuery } from "@reduxjs/toolkit/query/react";

export const eventsApi = createApi({
reducerPath: "eventsApi",
baseQuery: fetchBaseQuery({ baseUrl: API_BASE_URL }),
tagTypes: ["Events"],
endpoints: (builder) => ({
events: builder.query<Event[], void>({
query: () => "events",
// transformResponse: (rawResponse: unknown) => {
// return z.array(eventSchema).parse(rawResponse);
// },
providesTags: [{ type: "Events", id: "LIST" }],
}),
event: builder.query<Event, uuid>({
query: (eventID: uuid) => `events/${eventID}`,
// transformResponse: (rawResponse: unknown) => {
// return eventSchema.parse(rawResponse);
// },
providesTags: (result, _, eventID) =>
result ? [{ type: "Events", id: eventID }] : [],
}),
eventTags: builder.query<Club[], uuid>({
query: (eventID: uuid) => `events/${eventID}/tags`,
// transformResponse: (rawResponse: unknown) => {
// return z.array(clubSchema).parse(rawResponse);
// },
providesTags: (result, _, eventID) =>
result ? [{ type: "Events", id: eventID }] : [],
}),
eventHosts: builder.query<Club[], uuid>({
query: (eventID: uuid) => `events/${eventID}/hosts`,
// transformResponse: (rawResponse: unknown) => {
// return z.array(clubSchema).parse(rawResponse);
// },
providesTags: (result, _, eventID) =>
result ? [{ type: "Events", id: eventID }] : [],
}),
}),
});

export const {
useEventsQuery,
useEventQuery,
useEventTagsQuery,
useEventHostsQuery,
} = eventsApi;
31 changes: 31 additions & 0 deletions frontend/lib/api/tag.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import { z } from "zod";

import { API_BASE_URL } from "@/const";
import { Tag, tagSchema } from "@/types/tag";
import { uuid } from "@/types/uuid";
import { createApi, fetchBaseQuery } from "@reduxjs/toolkit/query/react";

export const tagsApi = createApi({
reducerPath: "tagsApi",
baseQuery: fetchBaseQuery({ baseUrl: API_BASE_URL }),
tagTypes: ["Tags"],
endpoints: (builder) => ({
tags: builder.query<Tag[], void>({
query: () => "tags",
transformResponse: (rawResponse: unknown) => {
return z.array(tagSchema).parse(rawResponse);
},
providesTags: [{ type: "Tags", id: "LIST" }],
}),
tag: builder.query<Tag, uuid>({
query: (tagID: uuid) => `tags/${tagID}`,
transformResponse: (rawResponse: unknown) => {
return tagSchema.parse(rawResponse);
},
providesTags: (result, _, tagID) =>
result ? [{ type: "Tags", id: tagID }] : [],
}),
}),
});

export const { useTagsQuery, useTagQuery } = tagsApi;
66 changes: 66 additions & 0 deletions frontend/lib/api/user.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
import { z } from "zod";

import { API_BASE_URL } from "@/const";
import { Club, clubSchema } from "@/types/club";
import { User, userSchema } from "@/types/user";
import { uuid } from "@/types/uuid";
import { createApi, fetchBaseQuery } from "@reduxjs/toolkit/query/react";

export const usersApi = createApi({
reducerPath: "usersApi",
baseQuery: fetchBaseQuery({ baseUrl: API_BASE_URL }),
tagTypes: ["Users"],
endpoints: (builder) => ({
users: builder.query<User[], void>({
query: () => "users",
transformResponse: (rawResponse: unknown) => {
return z.array(userSchema).parse(rawResponse);
},
providesTags: [{ type: "Users", id: "LIST" }],
}),
user: builder.query<User, uuid>({
query: (userID: uuid) => `users/${userID}`,
transformResponse: (rawResponse: unknown) => {
return userSchema.parse(rawResponse);
},
providesTags: (result, _, userID) =>
result ? [{ type: "Users", id: userID }] : [],
}),
userFollowing: builder.query<Club[], uuid>({
query: (userID: uuid) => `users/${userID}/follower`,
transformResponse: (rawResponse: unknown) => {
return z.array(clubSchema).parse(rawResponse);
},
providesTags: (result, _, userID) =>
result ? [{ type: "Users", id: userID }] : [],
}),
createUserClubFollowing: builder.mutation<
void,
{ userID: uuid; clubID: uuid }
>({
query: ({ userID, clubID }) => ({
url: `users/${userID}/follower/${clubID}`,
method: "POST",
}),
invalidatesTags: ["Users"],
}),
deleteUserClubFollowing: builder.mutation<
void,
{ userID: uuid; clubID: uuid }
>({
query: ({ userID, clubID }) => ({
url: `users/${userID}/follower/${clubID}`,
method: "DELETE",
}),
invalidatesTags: ["Users"],
}),
}),
});

export const {
useUsersQuery,
useUserQuery,
useUserFollowingQuery,
useCreateUserClubFollowingMutation,
useDeleteUserClubFollowingMutation,
} = usersApi;
7 changes: 1 addition & 6 deletions frontend/lib/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@
"format": "prettier --write ."
},
"private": true,
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"lint": "eslint . --ext .ts",
"format": "prettier --write ."
},
"dependencies": {
"@reduxjs/toolkit": "^2.2.3",
"zod": "^3.23.4"
Expand All @@ -21,4 +16,4 @@
"eslint-plugin-prettier": "^5.1.3",
"prettier": "^3.2.4"
}
}
}
4 changes: 4 additions & 0 deletions frontend/lib/types/item.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export type Item = {
label: string;
value: string;
};
4 changes: 2 additions & 2 deletions frontend/lib/types/root.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ export const rootModelSchema = z.object({
});

const paginationQueryParams = z.object({
page: z.number().int().positive().optional(),
limit: z.number().int().positive().optional()
page: z.number().int().positive().optional(),
limit: z.number().int().positive().optional()
}).optional();

export type PaginationQueryParams = z.infer<typeof paginationQueryParams>;
1 change: 1 addition & 0 deletions frontend/lib/types/uuid.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export type uuid = string;
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const EventHomePageCardHorizontal = ({

const randomEventColor =
randomEventColorData[
Math.round(Math.random() * (randomEventColorData.length - 1))
Math.round(Math.random() * (randomEventColorData.length - 1))
];

return (
Expand Down Expand Up @@ -106,7 +106,7 @@ const EventHomePageCard = ({ event }: { event: Event }) => {

const randomEventColor =
randomEventColorData[
Math.round(Math.random() * (randomEventColorData.length - 1))
Math.round(Math.random() * (randomEventColorData.length - 1))
];

return (
Expand Down
1 change: 1 addition & 0 deletions frontend/mobile/app/_layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import * as SplashScreen from 'expo-splash-screen';
import { StatusBar } from 'expo-status-bar';

import FontAwesome from '@expo/vector-icons/FontAwesome';
import { store } from '@sac/lib';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';

import { useAuthStore } from '@/hooks/use-auth';
Expand Down
4 changes: 2 additions & 2 deletions frontend/web/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"extends": "next/core-web-vitals"
}
"extends": "next/core-web-vitals"
}
Loading

0 comments on commit 8ce3d9c

Please sign in to comment.