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

Initial Merge to production #14

Merged
merged 30 commits into from
Mar 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
05e3948
Add Footer component and SocialMediaIcons Component
justin-phxm Feb 17, 2024
9412fb6
added tailwind colors
justin-phxm Feb 17, 2024
fd2ec35
Update Footer colors
justin-phxm Feb 17, 2024
21e54f4
fixed build issue and update Link
justin-phxm Feb 17, 2024
87942ed
updated for Ideen's comments
justin-phxm Feb 19, 2024
b8cbbe7
Merge pull request #1 from Code-the-Change-YYC/HMT-4-footer
justin-phxm Feb 19, 2024
7050b5d
added under construction placeholder
hannagracec Feb 20, 2024
6f21da8
Create judging criteria component
nataliey16 Feb 20, 2024
719b007
Render list of judging criteria and icon
nataliey16 Feb 21, 2024
9140f5f
added conditional rendering
hannagracec Feb 21, 2024
250269a
Add responsivness to judging criteria
nataliey16 Feb 22, 2024
de43839
moved conditional rendering to return statement
hannagracec Feb 22, 2024
8749f6e
Add landing page folder
nataliey16 Feb 22, 2024
6259898
Merge pull request #4 from Code-the-Change-YYC/hmt-8/judging-criteria
nataliey16 Feb 24, 2024
82bef14
Merge branch 'main' into HMT-37-under-construction-placeholder
hannagracec Feb 24, 2024
8a30c18
moved conditional rendering to page.tsx
hannagracec Feb 24, 2024
26b5958
Add custom backend logic function
ideen1 Feb 24, 2024
0e60f12
Added Custom Auth function
ideen1 Feb 24, 2024
73b584a
Added Custom Auth function
ideen1 Feb 24, 2024
cb044d4
Added Custom Auth function
ideen1 Feb 24, 2024
2178185
Merge pull request #3 from Code-the-Change-YYC/HMT-37-under-construct…
hannagracec Feb 24, 2024
5b93bff
Added server side rendering Auth and UserPool
ideen1 Mar 5, 2024
0cdb459
Fix ESLint issue
ideen1 Mar 5, 2024
62edfed
Merge pull request #6 from Code-the-Change-YYC/add-demo-functions
ideen1 Mar 5, 2024
66cfa3b
HMT-6-AboutEventTile (#7)
hannagracec Mar 7, 2024
3aeab6b
Hmt 3 navbar (#2)
justin-phxm Mar 7, 2024
95186d1
moved socialMediaIcons to atoms folder (#10)
justin-phxm Mar 7, 2024
4f04fc0
Hmt 7 judge showcase (#8)
burtonjong Mar 7, 2024
462b666
Exclude home page from Login redirect
ideen1 Mar 20, 2024
94e39e7
Remove backslash typo
ideen1 Mar 20, 2024
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 .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ const config = {
"no-restricted-imports": ["error", { patterns: [".*"] }],
"tailwindcss/no-custom-classname": "off",
"tailwindcss/classnames-order": "off", // tcss prettier plugin handles this
"require-await": "off",
"@typescript-eslint/require-await": "off",
},
};

Expand Down
28 changes: 28 additions & 0 deletions amplify/data/resource.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { DemoFunction } from "@/amplify/function/BusinessLogic/DemoFunction/resource";
import { DemoAuthFunction } from "@/amplify/function/CustomAuthorization/DemoAuthFunction/resource";
import { type ClientSchema, a, defineData } from "@aws-amplify/backend";

/*== STEP 1 ===============================================================
Expand Down Expand Up @@ -27,6 +29,26 @@ const schema = a.schema({
Members: a.hasMany("User"),
})
.authorization([a.allow.owner(), a.allow.public().to(["read"])]),
GenericFunctionResponse: a.customType({
body: a.json(),
statusCode: a.integer(),
headers: a.json(),
}),

/**
* FUNCTION-RELATED APPSYNC RESOLVERS
*/
DemoFunction: a
.mutation() // this should be set to .query for functions that only read data
// arguments that this query accepts
.arguments({
content: a.string(),
})
// return type of the query
.returns(a.ref("GenericFunctionResponse"))
// allow all users to call this api for now
.authorization([a.allow.public()])
.function("demoFunctionKey"),
});

export type Schema = ClientSchema<typeof schema>;
Expand All @@ -39,6 +61,12 @@ export const data = defineData({
apiKeyAuthorizationMode: {
expiresInDays: 30,
},
lambdaAuthorizationMode: {
function: DemoAuthFunction,
},
},
functions: {
demoFunctionKey: DemoFunction,
},
});

Expand Down
28 changes: 28 additions & 0 deletions amplify/function/BusinessLogic/DemoFunction/handler.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// amplify/data/echo-handler.ts
import type { AppSyncResolverHandler } from "aws-lambda";

// types imported from @types/aws-lambda

type ResolverArgs = { content: string };

type ResolverResult = {
body: { value: string };
statusCode: number;
headers: { "Content-Type": string };
};

export const handler: AppSyncResolverHandler<
ResolverArgs,
ResolverResult
> = async (event, context) => {
await new Promise((resolve) => setTimeout(resolve, 200)); // Demo delay to simulate asynchronous behavior
const start = performance.now();
console.log("Event: ", event);
console.log("Context: ", context);
console.log("Performance: ", performance.now() - start);
return {
body: { value: `Echoing content: ${event.arguments.content}` },
statusCode: 200,
headers: { "Content-Type": "application/json" },
};
};
7 changes: 7 additions & 0 deletions amplify/function/BusinessLogic/DemoFunction/resource.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// amplify/functions/my-demo-function/resource.ts
import { defineFunction } from "@aws-amplify/backend";

export const DemoFunction = defineFunction({
name: "DemoFunction", // optional parameter to specify a function name.
entry: "./handler.ts", // optional path to the function code. Defaults to ./handler.ts
});
38 changes: 38 additions & 0 deletions amplify/function/CustomAuthorization/DemoAuthFunction/handler.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
// amplify/data/custom-authorizer.ts
// This is sample code. Update this to suite your needs
import type { AppSyncAuthorizerHandler } from "aws-lambda";

// types imported from @types/aws-lambda

type ResolverContext = {
userid: string;
info: string;
more_info: string;
};

export const handler: AppSyncAuthorizerHandler<ResolverContext> = async (
event,
) => {
await new Promise((resolve) => setTimeout(resolve, 200)); // Demo delay to simulate asynchronous behavior
console.log(`EVENT: ${JSON.stringify(event)}`);
const {
authorizationToken,
requestContext: { apiId, accountId },
} = event;
console.log(`authorizationToken: ${authorizationToken}`);
const response = {
isAuthorized: true,
resolverContext: {
userid: "user-id",
info: "contextual information A",
more_info: "contextual information B",
},
deniedFields: [
`arn:aws:appsync:${process.env.AWS_REGION}:${accountId}:apis/${apiId}/types/Event/fields/comments`,
`Mutation.createEvent`,
],
ttlOverride: 300,
};
console.log(`RESPONSE: ${JSON.stringify(response, null, 2)}`);
return response;
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// amplify/functions/my-demo-function/resource.ts
import { defineFunction } from "@aws-amplify/backend";

export const DemoAuthFunction = defineFunction({
name: "DemoAuthFunction", // optional parameter to specify a function name.
entry: "./handler.ts", // optional path to the function code. Defaults to ./handler.ts
});
Loading
Loading