A full-stack web application built with a React frontend and a FastAPI backend, deployed on AWS (S3 for frontend, EC2 for backend).
Result: http://aaatest098.s3-website.eu-north-1.amazonaws.com/
react-python/
├── my-app/ # Frontend - React app
└── my-backend/ # Backend - FastAPI app- Frontend: React, JavaScript
- Backend: FastAPI, Python
- Database: DynamoDB
- Deployment:
- Frontend: AWS S3 (static site)
- Backend: AWS EC2
npm install
npm startnpm run build
aws s3 sync build/ s3://aaatest098python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
uvicorn main:app --reload- SSH into your EC2 instance:
ssh -i test1.pem ec2-user@16.171.242.187- Clone repo:
git clone https://github.com/trngdothuy/users-list.git- Navigate to backend directory:
cd react-python/my-backend- Set up Python and virtual environment:
python3 -m venv venv
source venv/bin/activate
pip install boto3 fastapi uvicorn- Run backend:
nohup uvicorn main:app --host 0.0.0.0 --port 8000 &GET /items- Get all itemsPOST /items- Add itemDELETE /items/{id}- Delete item
- Frontend fetches from:
http://16.171.242.187 - Ensure EC2 security group allows port 8000 (custom TCP, source 0.0.0.0/0)
- If backend updates, re-upload files or
git pullon EC2 - If port in use:
sudo lsof -i :8000→ kill the process