Alexa-style AI study companion built with Amazon EC2, Apache, Amazon Bedrock, Amazon S3, IAM, and EBS.
Students paste their own lecture notes and receive:
Notes are stored privately in S3. The app runs on EC2 with Apache reverse-proxying the Node.js backend.
Student → Classic Load Balancer (HTTP :80)
├── EC2 Instance 1 (Apache + Node.js)
└── EC2 Instance 2 (Apache + Node.js)
│
▼
Amazon Bedrock
│
┌─────────┴─────────┐
▼ ▼
Amazon S3 Amazon EBS
(private notes) (persistent disk)
Security
bedrock:InvokeModel and s3:PutObject only — no AWS keys in codestudypilot-aws/
├── frontend/
│ ├── index.html
│ ├── style.css
│ └── app.js
├── backend/
│ ├── server.js
│ ├── bedrock.js
│ ├── s3.js
│ └── package.json
├── scripts/
│ └── user-data.sh
├── docs/
├── LICENSE
└── README.md
cd backend
npm install
cp .env.example .env # create and fill values
npm start
frontend/ folder with any static server, or open index.html after pointing API calls to http://localhost:5000.Push this repository to https://github.com/YOUR_USERNAME/studypilot-aws.
| Setting | Value | |—————-|————————————————| | Name | studypilot-server-1 | | AMI | Amazon Linux 2023 | | Instance type | t2.micro / t3.micro | | Key pair | studypilot-key.pem | | Root volume | 8 GB (EBS) | | Security group | SSH 22 from My IP · HTTP 80 from Anywhere |
Paste the contents of scripts/user-data.sh into User data (replace YOUR_USERNAME and bucket name).
Attach an EC2 instance role with:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": ["bedrock:InvokeModel"],
"Resource": "*"
},
{
"Effect": "Allow",
"Action": ["s3:PutObject"],
"Resource": "arn:aws:s3:::YOUR_PRIVATE_BUCKET/notes/*"
}
]
}
aws s3 mb s3://studypilot-notes-yourname --region ap-south-1
Keep Block Public Access enabled.
In the Bedrock console, request access to Claude 3 Haiku (or the model ID you set in .env).
The user-data script creates /etc/httpd/conf.d/studypilot.conf.
If you configure manually:
<VirtualHost *:80>
DocumentRoot /var/www/html
ProxyPreserveHost On
ProxyPass /api/ http://127.0.0.1:5000/api/
ProxyPassReverse /api/ http://127.0.0.1:5000/api/
</VirtualHost>
Open http://YOUR_EC2_PUBLIC_IP (or Elastic IP / Load Balancer DNS).
/index.html or /health on port 80| Variable | Description | Example |
|---|---|---|
PORT |
Backend port | 5000 |
AWS_REGION |
AWS region | ap-south-1 |
BEDROCK_MODEL_ID |
Bedrock model ID | anthropic.claude-3-haiku-20240307-v1:0 |
S3_BUCKET |
Private notes bucket | studypilot-notes-yourname |
EWB Project Title
StudyPilot — AI Study Companion Deployed on AWS EC2 with S3 and Bedrock
Devpost Tracks
MIT