Skip to content

Commit

Permalink
aws conginto
Browse files Browse the repository at this point in the history
  • Loading branch information
Sahira100 committed Jan 21, 2024
1 parent dd1521a commit 121279f
Show file tree
Hide file tree
Showing 20 changed files with 897 additions and 44 deletions.
22 changes: 22 additions & 0 deletions code/smartchessboard/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,25 @@ app.*.map.json
/android/app/debug
/android/app/profile
/android/app/release

#amplify-do-not-edit-begin
amplify/\#current-cloud-backend
amplify/.config/local-*
amplify/logs
amplify/mock-data
amplify/mock-api-resources
amplify/backend/amplify-meta.json
amplify/backend/.temp
build/
dist/
node_modules/
aws-exports.js
awsconfiguration.json
amplifyconfiguration.json
amplifyconfiguration.dart
amplify-build-config.json
amplify-gradle-config.json
amplifytools.xcconfig
.secret-*
**.sample
#amplify-do-not-edit-end
13 changes: 13 additions & 0 deletions code/smartchessboard/amplify/.config/project-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"projectName": "smartchessboard",
"version": "3.1",
"frontend": "flutter",
"flutter": {
"config": {
"ResDir": "./lib/"
}
},
"providers": [
"awscloudformation"
]
}
8 changes: 8 additions & 0 deletions code/smartchessboard/amplify/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Getting Started with Amplify CLI
This directory was generated by [Amplify CLI](https://docs.amplify.aws/cli).

Helpful resources:
- Amplify documentation: https://docs.amplify.aws
- Amplify CLI documentation: https://docs.amplify.aws/cli
- More details on this folder & generated files: https://docs.amplify.aws/cli/reference/files
- Join Amplify's community: https://amplify.aws/community/
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"version": "1",
"cognitoConfig": {
"identityPoolName": "smartchessboard9808ffe2_identitypool_9808ffe2",
"allowUnauthenticatedIdentities": false,
"resourceNameTruncated": "smartc9808ffe2",
"userPoolName": "smartchessboard9808ffe2_userpool_9808ffe2",
"autoVerifiedAttributes": [
"email"
],
"mfaConfiguration": "OFF",
"mfaTypes": [
"SMS Text Message"
],
"smsAuthenticationMessage": "Your authentication code is {####}",
"smsVerificationMessage": "Your verification code is {####}",
"emailVerificationSubject": "Your verification code",
"emailVerificationMessage": "Your verification code is {####}",
"defaultPasswordPolicy": false,
"passwordPolicyMinLength": 8,
"passwordPolicyCharacters": [],
"requiredAttributes": [
"email"
],
"aliasAttributes": [],
"userpoolClientGenerateSecret": false,
"userpoolClientRefreshTokenValidity": 30,
"userpoolClientWriteAttributes": [
"email"
],
"userpoolClientReadAttributes": [
"email"
],
"userpoolClientLambdaRole": "smartc9808ffe2_userpoolclient_lambda_role",
"userpoolClientSetAttributes": false,
"sharedId": "9808ffe2",
"resourceName": "smartchessboard9808ffe2",
"authSelections": "identityPoolAndUserPool",
"useDefault": "default",
"userPoolGroupList": [],
"serviceName": "Cognito",
"usernameCaseSensitive": false,
"useEnabledMfas": true
}
}
28 changes: 28 additions & 0 deletions code/smartchessboard/amplify/backend/backend-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"auth": {
"smartchessboard9808ffe2": {
"customAuth": false,
"dependsOn": [],
"frontendAuthConfig": {
"mfaConfiguration": "OFF",
"mfaTypes": [
"SMS"
],
"passwordProtectionSettings": {
"passwordPolicyCharacters": [],
"passwordPolicyMinLength": 8
},
"signupAttributes": [
"EMAIL"
],
"socialProviders": [],
"usernameAttributes": [],
"verificationMechanisms": [
"EMAIL"
]
},
"providerPlugin": "awscloudformation",
"service": "Cognito"
}
}
}
10 changes: 10 additions & 0 deletions code/smartchessboard/amplify/backend/tags.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[
{
"Key": "user:Stack",
"Value": "{project-env}"
},
{
"Key": "user:Application",
"Value": "{project-name}"
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
export type AmplifyDependentResourcesAttributes = {
"auth": {
"smartchessboard9808ffe2": {
"AppClientID": "string",
"AppClientIDWeb": "string",
"IdentityPoolId": "string",
"IdentityPoolName": "string",
"UserPoolArn": "string",
"UserPoolId": "string",
"UserPoolName": "string"
}
}
}
63 changes: 63 additions & 0 deletions code/smartchessboard/amplify/cli.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
{
"features": {
"graphqltransformer": {
"addmissingownerfields": true,
"improvepluralization": false,
"validatetypenamereservedwords": true,
"useexperimentalpipelinedtransformer": true,
"enableiterativegsiupdates": true,
"secondarykeyasgsi": true,
"skipoverridemutationinputtypes": true,
"transformerversion": 2,
"suppressschemamigrationprompt": true,
"securityenhancementnotification": false,
"showfieldauthnotification": false,
"usesubusernamefordefaultidentityclaim": true,
"usefieldnameforprimarykeyconnectionfield": false,
"enableautoindexquerynames": true,
"respectprimarykeyattributesonconnectionfield": true,
"shoulddeepmergedirectiveconfigdefaults": false,
"populateownerfieldforstaticgroupauth": true
},
"frontend-ios": {
"enablexcodeintegration": true
},
"auth": {
"enablecaseinsensitivity": true,
"useinclusiveterminology": true,
"breakcirculardependency": true,
"forcealiasattributes": false,
"useenabledmfas": true
},
"codegen": {
"useappsyncmodelgenplugin": true,
"usedocsgeneratorplugin": true,
"usetypesgeneratorplugin": true,
"cleangeneratedmodelsdirectory": true,
"retaincasestyle": true,
"addtimestampfields": true,
"handlelistnullabilitytransparently": true,
"emitauthprovider": true,
"generateindexrules": true,
"enabledartnullsafety": true,
"generatemodelsforlazyloadandcustomselectionset": false
},
"appsync": {
"generategraphqlpermissions": true
},
"latestregionsupport": {
"pinpoint": 1,
"translate": 1,
"transcribe": 1,
"rekognition": 1,
"textract": 1,
"comprehend": 1
},
"project": {
"overrides": true
}
},
"debug": {
"shareProjectConfig": false
}
}
7 changes: 7 additions & 0 deletions code/smartchessboard/amplify/hooks/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Command Hooks

Command hooks can be used to run custom scripts upon Amplify CLI lifecycle events like pre-push, post-add-function, etc.

To get started, add your script files based on the expected naming convention in this directory.

Learn more about the script file naming convention, hook parameters, third party dependencies, and advanced configurations at https://docs.amplify.aws/cli/usage/command-hooks
20 changes: 20 additions & 0 deletions code/smartchessboard/amplify/team-provider-info.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"dev": {
"awscloudformation": {
"AuthRoleName": "amplify-smartchessboard-dev-113035-authRole",
"UnauthRoleArn": "arn:aws:iam::725314738188:role/amplify-smartchessboard-dev-113035-unauthRole",
"AuthRoleArn": "arn:aws:iam::725314738188:role/amplify-smartchessboard-dev-113035-authRole",
"Region": "us-east-1",
"DeploymentBucketName": "amplify-smartchessboard-dev-113035-deployment",
"UnauthRoleName": "amplify-smartchessboard-dev-113035-unauthRole",
"StackName": "amplify-smartchessboard-dev-113035",
"StackId": "arn:aws:cloudformation:us-east-1:725314738188:stack/amplify-smartchessboard-dev-113035/66e1b190-b822-11ee-999e-0e2b9a8e2007",
"AmplifyAppId": "d29mi5dfy7czed"
},
"categories": {
"auth": {
"smartchessboard9808ffe2": {}
}
}
}
}
55 changes: 39 additions & 16 deletions code/smartchessboard/lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
import 'package:amplify_auth_cognito/amplify_auth_cognito.dart';
import 'package:amplify_authenticator/amplify_authenticator.dart';
import 'package:amplify_flutter/amplify_flutter.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';

import 'amplifyconfiguration.dart';

import 'package:smartchessboard/provider/room_data_provider.dart';
import 'package:smartchessboard/provider/move_data_provider.dart'; // Import your MoveDataProvider class
import 'package:smartchessboard/provider/move_data_provider.dart';
import 'package:smartchessboard/screens/create_room_screen.dart';
import 'package:smartchessboard/screens/game_screen.dart';
import 'package:smartchessboard/screens/join_room_screen.dart';
Expand All @@ -12,40 +19,56 @@ import 'package:smartchessboard/screens/mainmenu.dart';
import 'package:provider/provider.dart';

void main() {
//runApp(const MyApp());
runApp(MaterialApp(
debugShowCheckedModeBanner: false,
home: MyApp(),
));
runApp(const MyApp());
}

class MyApp extends StatelessWidget {
class MyApp extends StatefulWidget {
const MyApp({super.key});

@override
State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {

@override
void initState() {
super.initState();
_configureAmplify();
}

void _configureAmplify() async {
try {
await Amplify.addPlugin(AmplifyAuthCognito());
await Amplify.configure(amplifyconfig);
safePrint('Successfully configured');
} on Exception catch (e) {
safePrint('Error configuring Amplify: $e');
}
}

@override
Widget build(BuildContext context) {
return MultiProvider(
providers: [
return MultiProvider(providers: [
ChangeNotifierProvider(create: (context) => RoomDataProvider()),
ChangeNotifierProvider(
create: (context) =>
MoveDataProvider()), // Add your MoveDataProvider here
],
],
child:Authenticator(
child: MaterialApp(
title: "chess",
debugShowCheckedModeBanner: false,
initialRoute: HomePage.routeName,
routes: {
HomePage.routeName:(contex)=>HomePage(),
LoginPage.routeName:(context)=>LoginPage(),
SignupPage.routeName:(context)=>SignupPage(),
MainMenu.routeName:(context)=>MainMenu(),
//MainMenuScreen.routeName: (context) => const MainMenuScreen(),
JoinRoomScreen.routeName: (context) => const JoinRoomScreen(),
CreateRoomScreen.routeName: (context) => const CreateRoomScreen(),
GameScreen.routeName: (context) => const GameScreen(),
},
}
),
);
));

}
}

Loading

0 comments on commit 121279f

Please sign in to comment.