A comprehensive AWS + MongoDB based theme park management system featuring a React Native mobile app, Next.js web portal, and serverless backend infrastructure.
This project demonstrates modern cloud architecture with MongoDB Atlas, AWS services, and real-time data processing.
- Cross-Platform Mobile App: React Native app for iOS and Android
- Web Portal: Next.js dashboard for administrators and users
- Serverless Backend: AWS Lambda + AppSync GraphQL API
- MongoDB Atlas: Managed cloud database with change streams
- Secure Authentication: AWS Cognito integration
- Real-time Updates: Live data synchronization across platforms
- Node.js ≥ 20
- npm or yarn
- Git
- AWS CLI ≥ 2.x
- Terraform ≥ 1.0
- React Native CLI
- Xcode (for iOS, macOS only)
- Android Studio (for Android)
- AWS Account with permissions for:
- IAM, S3, Lambda, AppSync, API Gateway, Cognito
- VPC, EC2, CloudFormation, Secrets Manager
- MongoDB Atlas Account (cluster + API keys)
- AWS CLI configured with credentials
git clone <repo-url>
cd <repo-name>cd terraform
# Copy and configure variables
cp terraform.tfvars.example terraform.tfvars
cp backend.hcl.example backend.hcl
# Edit both files with your valuesCreate an S3 bucket for storing the terraform state in the AWS
Bucket Name themepark-terraform-state-${SOME_UNIQUE_KEY}
Update this bucket name in the backend.hcl file
Important: Backend Configuration
Configure your backend using the backend.hcl file:
# backend.hcl
bucket = "REPLACE THE BUCKET NAME CREATED ABOVE"
key = "themepark/terraform.tfstate"
region = "us-east-1"Note: The region in backend.hcl should match your aws_region in terraform.tfvars.
now, configure the AWS CLI with your credentials:
aws configureThis will prompt you for:
- AWS Access Key ID
- AWS Secret Access Key
- Default AWS region
- Default output format
Generate MongoDB Atlas Public/Private Keys
You need an Atlas Programmatic API Key.
- Log in to the MongoDB Atlas UI.
- Navigate to Organization Access Manager → API Keys.
- Create a new key with Project Owner role.
- Save the Public Key and Private Key.
Paste these into terraform.tfvars as atlas_public_key and atlas_private_key also the mongo project name as atlas_existing_project_name.
MongoDB Atlas requires a unified role in AWS to manage resources securely.
Follow this guide to set it up: MongoDB Atlas: Set Up Unified AWS Access
-
Go to integrations in MongoDB Atlas
-
Click AWS → Authorize on AWS IAM Role → Next → Follow steps and Validate and Finish
-
Copy the role ARN.
-
Add it to your
terraform.tfvarsasmongodb_atlas_stream_role_arn.
Important: Add Lambda Invoke Permission
After creating the unified role, you must add permission for MongoDB Atlas to invoke your Lambda functions. Follow these steps in the AWS Console:
-
Go to AWS IAM Console
- Navigate to AWS IAM Console
- Click on "Roles" in the left sidebar
-
Find the MongoDB Role
- Search for the role you created (e.g.,
mdb-stream-integration) - Click on the role name to open it
- Search for the role you created (e.g.,
-
Attach AWS Managed Policy
- Click on "Add permissions" → "Attach policies"
- In the search box, type:
AWSLambdaRole - Check the box next to
AWSLambdaRole(AWS managed policy) - Click "Add permissions"
-
In Atlas, go to Network Access
-
Go to private endpoint tab → Add Private Endpoint → Choose AWS → Region → Wait for the service endpoint to be created
-
Once the service name is created, copy the service name and paste in the
terraform.tfvarsasmongodb_atlas_service_name
Initialize Terraform
# Initialize with backend configuration file
terraform init -backend-config=backend.hclPreview Plan
terraform planApply Deployment
terraform apply-
Copy the VPC endpoint ID from the Terraform deployment outputs
-
In Atlas, go to Network Access → Private Endpoint tab
-
VPC ID and Subnet IDs can be empty, go to next and paste the VPC Endpoint ID and then create it
Create Cognito User via CLI
USER_POOL_ID=$(terraform output -raw cognito_user_pool_id); aws cognito-idp admin-create-user --user-pool-id $USER_POOL_ID --username [email protected] --user-attributes Name=email,[email protected] Name=email_verified,Value=true Name=given_name,Value=Test Name=family_name,Value=User --temporary-password TempPassword123! --message-action SUPPRESS; aws cognito-idp admin-set-user-password --user-pool-id $USER_POOL_ID --username [email protected] --password TestPassword123! --permanent
Restore rides test data
Open the Web portal deployed in S3 using the url found in the terraform outputs.
The credentials to login to Web Portal are added in terraform.tfvars.example
Default Credentials
Email : [email protected]Password : TestPassword123!
After Terraform deployment completes, the mobile app .env file will be automatically generated with all required AWS and MongoDB configuration values.
When you're finished with the POV or need to clean up resources, use Terraform to destroy all AWS resources:
# Navigate to terraform directory
cd terraform
# Review what will be destroyed
terraform plan -destroy
# Destroy all resources
terraform destroy- Ensure AWS user has sufficient permissions
- Check CloudTrail logs for permission errors
iOS Build Issues:
cd mobile_app/ios
pod deintegrate
pod installAndroid Build Issues:
cd mobile_app/android
./gradlew cleanBuild Errors:
cd web_portal
rm -rf .next node_modules
npm install
npm run build







