Skip to content

Latest commit

 

History

15 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🧩 Full Stack Web App – React + FastAPI + AWS

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/


📁 Project Structure

react-python/ 
    ├── my-app/ # Frontend - React app 
    └── my-backend/ # Backend - FastAPI app

🚀 Tech Stack

  • Frontend: React, JavaScript
  • Backend: FastAPI, Python
  • Database: DynamoDB
  • Deployment:
    • Frontend: AWS S3 (static site)
    • Backend: AWS EC2

Frontend (React)

Local Development

npm install
npm start

Deploy to S3

npm run build
aws s3 sync build/ s3://aaatest098

Backend (FastAPI)

Setup on Local

python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
uvicorn main:app --reload

Deploy to EC2

  1. SSH into your EC2 instance:
ssh -i test1.pem ec2-user@16.171.242.187
  1. Clone repo:
git clone https://github.com/trngdothuy/users-list.git
  1. Navigate to backend directory:
cd react-python/my-backend
  1. Set up Python and virtual environment:
python3 -m venv venv
source venv/bin/activate
pip install boto3 fastapi uvicorn
  1. Run backend:
nohup uvicorn main:app --host 0.0.0.0 --port 8000 &

API Endpoints

  • GET /items - Get all items
  • POST /items - Add item
  • DELETE /items/{id} - Delete item

Notes

  • 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 pull on EC2
  • If port in use: sudo lsof -i :8000 → kill the process

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages