-
Notifications
You must be signed in to change notification settings - Fork 0
Logic Documention
Logic Documentation
A costumer visits the website by entering the domain of the load balancer into the search bar. They enter through the internet gateway and then make their way through the load balancer assuming they meet the requirements of the security groups and the in bound rules, the load balancer then checks which availability zone has less traffic and decides where to send the traffic, then they connect to our website via http (port 80). Cloud watch logs every connection through port 80 and the users actions all get logged into a dynamodb with timestamps.
LOGGING Our application uses API Gateway and Lambda to handle logging completely serverlessly. Whenever a user visits a page, our frontend JavaScript (logger.js) sends a POST request to an API Gateway endpoint. This triggers our Lambda function, which logs the activity to CloudWatch Logs and stores a structured record in DynamoDB inside our UserActivityLogs table. This architecture is scalable, multi-AZ resilient, and separate from our EC2 instance which only serves the frontend. CloudWatch provides real-time insight into user actions, while DynamoDB acts as our permanent storage for activity logs.
OR
Whenever a user visits or interacts with a page, our frontend JavaScript sends a log message to AWS API Gateway. That triggers a Lambda function, which records the log into DynamoDB and also prints it to CloudWatch so we can monitor activity in real time. AI was used to create the code.
More Logic They are started at the login page (index.html) where they can chose to sign up if they don't have an account.
If they chose to sign up they are sent to the sign up page (signup.html). Here they can register using an email and phone number to make their account. The account details that they register are sent to Cognito and DynamaDB.
DynamoDB holds the password hashes and Cognito handles our login information.
After they register they are redirected to the verification page (verify.html) where they input a code that was sent to their email by cognito. After successful verification they are redirected back to the login page (index.html) where they can now login. Once they login they are redirected to the MFA setup (setup-mfa.html) where they are asked to setup MFA using an authenticator app like duo or google auth. We required MFA through an authenticator app on Cognito so the user has to set it up using the QR code and then they are required to input an MFA code on every login after setting it up.
They are once again redirected to login page (index.html) after they login they are prompted for their MFA code from the authenticator app (verify-mfa.html).