Cloud Infrastructure & AWS Architecture
📌 What is this for? (Quick Summary for New Interns)​
In Simple Words:
This page explains where our cloud servers live and what each AWS service does.
You can think of the cloud like an air traffic control tower:
- Cognito: The security guard at the door who checks your username and password.
- API Gateway & Lambda: The receptionist who takes questions from the web dashboard (like "What's the current pod speed?") and fetches the answers from the databases.
- InfluxDB: The filing cabinet storing millions of past sensor numbers so we can draw charts.
- DynamoDB: The logbook that records who clicked Start or Emergency Stop and when.
- AWS IoT Core: The walkie-talkie that sends commands from the website directly to the pod in milliseconds.
1. Cloud Architecture at a Glance​
flowchart LR
Client["Your Web Browser\n(React Dashboard)"]
Cognito["AWS Cognito\n(Login & Passwords)"]
APIGW["API Gateway HTTP API\n(npig3gpgck)"]
Authorizer["Security Check\n(Checks login token)"]
Router["Lambda Function\n(PodDashboardRouter)"]
DynamoOperations["DynamoDB\nPodOperations"]
DynamoSessions["DynamoDB\nActiveSessions"]
IoT["AWS IoT Core\n(Send controls to pod)"]
Influx["InfluxDB Cloud\n(Live & past sensor charts)"]
Client -->|1. Sign in with username & password| Cognito
Cognito -->|2. Gives back a signed login token| Client
Client -->|3. POST /api (Sends question + token)| APIGW
APIGW -->|4. Checks token validity| Authorizer
Authorizer -->|5. Passes request to code| Router
Router <-->|Checks if another tab logged in| DynamoSessions
Router <-->|Saves run logs / state| DynamoOperations
Router -->|Sends Start/Stop to vehicle| IoT
Router <-->|Fetches last 15s of sensor numbers| Influx
2. AWS Resources List & Explanations​
2.1 API Gateway (npig3gpgck)​
- What it is: The front door of our backend.
- URL:
https://npig3gpgck.execute-api.ap-south-1.amazonaws.com/api - Region: Mumbai (
ap-south-1) - How it works: Whenever the web dashboard needs something, it sends an HTTP POST request here. The API Gateway checks that your login token is valid, then forwards the request to our Lambda function.
2.2 AWS Cognito (User Accounts)​
- User Pool ID:
ap-south-1_IXNCZVwj4 - App Client ID:
5eup0104notrn3fn4415u3fq3b - What it is: Where operator accounts live. It verifies passwords and issues a signed security token (JWT).
- User Roles:
Admin: Can do everything, including managing user accounts and clicking physical control buttons.Engineer: Can click physical vehicle buttons (Enable Battery, Launch, Stop) and view data.Manager: Read-only access for guests and managers. Physical buttons are grayed out.
2.3 The Backend Router (PodDashboardRouter)​
- What it is: A single Node.js function running in AWS Lambda.
- Why we have it: Instead of giving the web browser direct access to our databases, this one function handles all business logic:
- Verifying user permissions.
- Querying InfluxDB for the last 15 seconds of sensor data.
- Sending actuation commands over AWS IoT Core.
- Checking that only one browser tab is active per user.
2.4 DynamoDB Tables​
PodOperations: An audit log. Every time someone enables the battery, launches the vehicle, or triggers an emergency stop, a permanent row is added with their username and timestamp.ActiveSessions: Used by the single-login rule. Remembers which browser tab is currently active for each user.
2.5 InfluxDB Time-Series Cloud​
- Endpoint:
https://influxdb.tutr.tech - Bucket:
telemetry - What it is: A database optimized specifically for numbers changing over time (like speed, battery voltage, and temperatures). It lets us query the last 15 seconds of data in under 100 milliseconds.