Skip to content
Open
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
3 changes: 2 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
src/models
src/models
amplify-codegen-temp/models
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ amplify/backend/.temp
build/
dist/
node_modules/
aws-exports.js
awsconfiguration.json
amplifyconfiguration.json
amplifyconfiguration.dart
Expand Down
18 changes: 18 additions & 0 deletions .graphqlconfig.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
projects:
cocoonkids:
schemaPath: amplify/backend/api/cocoonkids/build/schema.graphql
includes:
- src/graphql/**/*.js
excludes:
- ./amplify/**
extensions:
amplify:
codeGenTarget: javascript
generatedFileName: ''
docsFilePath: src/graphql
region: eu-west-2
apiId: null
maxDepth: 2
extensions:
amplify:
version: 3
11 changes: 11 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"files.exclude": {
"amplify/.config": true,
"amplify/**/*-parameters.json": true,
"amplify/**/amplify.state": true,
"amplify/**/transform.conf.json": true,
"amplify/#current-cloud-backend": true,
"amplify/backend/amplify-meta.json": true,
"amplify/backend/awscloudformation": true
}
}
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
- deployed on vercel
- data is stored in a db.json file, and we created an api endpoint and read the data using swr


## Introduction
### What are you building?
Cocoon Kids Big Hug is a therapeutic service for children and young adults and parents.
Expand Down
4 changes: 2 additions & 2 deletions amplify/.config/project-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
"config": {
"SourceDir": "src",
"DistributionDir": "build",
"BuildCommand": "npm run build",
"StartCommand": "npm run dev"
"BuildCommand": "npm run-script build",
"StartCommand": "npm run-script start"
}
}
}
22 changes: 22 additions & 0 deletions amplify/backend/api/cocoonkids/cli-inputs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"version": 1,
"serviceConfiguration": {
"apiName": "cocoonkids",
"serviceName": "AppSync",
"defaultAuthType": {
"mode": "API_KEY",
"keyDescription": "api key description",
"expirationTime": 30
},
"additionalAuthTypes": [
{
"mode": "AWS_IAM"
}
],
"conflictResolution": {
"defaultResolutionStrategy": {
"type": "OPTIMISTIC_CONCURRENCY"
}
}
}
}
6 changes: 6 additions & 0 deletions amplify/backend/api/cocoonkids/parameters.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"AppSyncApiName": "cocoonkids",
"DynamoDBBillingMode": "PAY_PER_REQUEST",
"DynamoDBEnableServerSideEncryption": false,
"AuthModeLastUpdated": "2023-08-10T19:38:26.616Z"
}
2 changes: 2 additions & 0 deletions amplify/backend/api/cocoonkids/resolvers/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Any resolvers that you add in this directory will override the ones automatically generated by Amplify CLI and will be directly copied to the cloud.
For more information, visit [https://docs.amplify.aws/cli/graphql-transformer/resolvers](https://docs.amplify.aws/cli/graphql-transformer/resolvers)
12 changes: 12 additions & 0 deletions amplify/backend/api/cocoonkids/schema.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
type Students @model @auth(rules: [{allow: public}]) {
id: ID!
name: String
classs: [Class] @manyToMany(relationName: "ClassStudents")
}

type Class @model @auth(rules: [{allow: public}]) {
id: ID!
ClassName: String
Students: [Students] @manyToMany(relationName: "ClassStudents")
}

58 changes: 58 additions & 0 deletions amplify/backend/api/cocoonkids/stacks/CustomResources.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "An auto-generated nested stack.",
"Metadata": {},
"Parameters": {
"AppSyncApiId": {
"Type": "String",
"Description": "The id of the AppSync API associated with this project."
},
"AppSyncApiName": {
"Type": "String",
"Description": "The name of the AppSync API",
"Default": "AppSyncSimpleTransform"
},
"env": {
"Type": "String",
"Description": "The environment name. e.g. Dev, Test, or Production",
"Default": "NONE"
},
"S3DeploymentBucket": {
"Type": "String",
"Description": "The S3 bucket containing all deployment assets for the project."
},
"S3DeploymentRootKey": {
"Type": "String",
"Description": "An S3 key relative to the S3DeploymentBucket that points to the root\nof the deployment directory."
}
},
"Resources": {
"EmptyResource": {
"Type": "Custom::EmptyResource",
"Condition": "AlwaysFalse"
}
},
"Conditions": {
"HasEnvironmentParameter": {
"Fn::Not": [
{
"Fn::Equals": [
{
"Ref": "env"
},
"NONE"
]
}
]
},
"AlwaysFalse": {
"Fn::Equals": ["true", "false"]
}
},
"Outputs": {
"EmptyOutput": {
"Description": "An empty output. You may delete this if you have at least one resource above.",
"Value": ""
}
}
}
10 changes: 10 additions & 0 deletions amplify/backend/api/cocoonkids/transform.conf.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"Version": 5,
"ElasticsearchWarning": true,
"ResolverConfig": {
"project": {
"ConflictHandler": "OPTIMISTIC_CONCURRENCY",
"ConflictDetection": "VERSION"
}
}
}
12 changes: 6 additions & 6 deletions amplify/backend/auth/cocoonkids/cli-inputs.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"cognitoConfig": {
"identityPoolName": "testAuthIdentityPool",
"allowUnauthenticatedIdentities": false,
"resourceNameTruncated": "cocoon61493312",
"resourceNameTruncated": "cocoonf7281d31",
"userPoolName": "cocoonkids",
"autoVerifiedAttributes": [
"email"
Expand All @@ -14,8 +14,8 @@
],
"smsAuthenticationMessage": "Your authentication code is {####}",
"smsVerificationMessage": "Your verification code is {####}",
"emailVerificationSubject": "Verification code: {####}",
"emailVerificationMessage": "Verification code: {####}",
"emailVerificationSubject": "Cocoon kids Verification code: {####}",
"emailVerificationMessage": "This is your verification code for your Coccon kids account.\n\nVerification code: {####}",
"defaultPasswordPolicy": false,
"passwordPolicyMinLength": 8,
"passwordPolicyCharacters": [
Expand All @@ -34,9 +34,9 @@
"userpoolClientRefreshTokenValidity": 30,
"userpoolClientWriteAttributes": [],
"userpoolClientReadAttributes": [],
"userpoolClientLambdaRole": "cocoon61493312_userpoolclient_lambda_role",
"userpoolClientLambdaRole": "cocoonf7281d31_userpoolclient_lambda_role",
"userpoolClientSetAttributes": false,
"sharedId": "61493312",
"sharedId": "f7281d31",
"resourceName": "cocoonkids",
"authSelections": "identityPoolAndUserPool",
"serviceName": "Cognito",
Expand All @@ -52,4 +52,4 @@
"usernameCaseSensitive": false,
"useEnabledMfas": true
}
}
}
104 changes: 87 additions & 17 deletions amplify/backend/backend-config.json
Original file line number Diff line number Diff line change
@@ -1,37 +1,107 @@
{
"auth": {
"api": {
"cocoonkids": {
"service": "Cognito",
"providerPlugin": "awscloudformation",
"dependsOn": [],
"output": {
"authConfig": {
"additionalAuthenticationProviders": [
{
"authenticationType": "AWS_IAM"
}
],
"defaultAuthentication": {
"apiKeyConfig": {
"apiKeyExpirationDays": 30,
"description": "api key description"
},
"authenticationType": "API_KEY"
}
}
},
"providerPlugin": "awscloudformation",
"service": "AppSync"
}
},
"auth": {
"cocoonkids": {
"customAuth": false,
"dependsOn": [],
"frontendAuthConfig": {
"socialProviders": [],
"usernameAttributes": [
"EMAIL"
],
"signupAttributes": [
"NAME",
"EMAIL",
"BIRTHDATE"
"mfaConfiguration": "OFF",
"mfaTypes": [
"SMS"
],
"passwordProtectionSettings": {
"passwordPolicyMinLength": 8,
"passwordPolicyCharacters": [
"REQUIRES_LOWERCASE",
"REQUIRES_NUMBERS",
"REQUIRES_SYMBOLS",
"REQUIRES_UPPERCASE"
]
],
"passwordPolicyMinLength": 8
},
"mfaConfiguration": "OFF",
"mfaTypes": [
"SMS"
"signupAttributes": [
"NAME",
"EMAIL",
"BIRTHDATE"
],
"socialProviders": [],
"usernameAttributes": [
"EMAIL"
],
"verificationMechanisms": [
"EMAIL"
]
}
},
"providerPlugin": "awscloudformation",
"service": "Cognito"
}
},
"function": {
"cocoonkids871042fd": {
"build": true,
"providerPlugin": "awscloudformation",
"service": "Lambda"
},
"teacherHandler": {
"build": true,
"dependsOn": [],
"providerPlugin": "awscloudformation",
"service": "Lambda"
}
},
"parameters": {
"AMPLIFY_function_cocoonkids871042fd_deploymentBucketName": {
"usedBy": [
{
"category": "function",
"resourceName": "cocoonkids871042fd"
}
]
},
"AMPLIFY_function_cocoonkids871042fd_s3Key": {
"usedBy": [
{
"category": "function",
"resourceName": "cocoonkids871042fd"
}
]
},
"AMPLIFY_function_teacherHandler_deploymentBucketName": {
"usedBy": [
{
"category": "function",
"resourceName": "teacherHandler"
}
]
},
"AMPLIFY_function_teacherHandler_s3Key": {
"usedBy": [
{
"category": "function",
"resourceName": "teacherHandler"
}
]
}
}
}
6 changes: 6 additions & 0 deletions amplify/backend/function/cocoonkids871042fd/amplify.state
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"pluginId": "amplify-nodejs-function-runtime-provider",
"functionRuntime": "nodejs",
"useLegacyBuild": true,
"defaultEditorFile": "src/index.js"
}
Loading