Skip to content

Repository files navigation

Cloud BookHub

Scalable serverless online bookstore built on AWS with React frontend, Lambda backend, and full CI/CD pipeline.
View Demo · Report Bug · Request Feature


About The Project

Cloud BookHub demonstrates a production-ready serverless e-commerce pattern on AWS. The React SPA serves book catalog via CloudFront CDN from S3, with backend API powered by Lambda behind API Gateway. Full CI/CD pipeline automates deployments from GitHub, and CloudWatch provides observability [web:1].

UI

Cloud BookHub UI


Architecture

Cloud BookHub Architecture
Cloud BookHub architecture: React on S3+CloudFront → API Gateway+Lambda → RDS MySQL (planned).


Key Features

  • Book catalog with images, categories, and rupee pricing
  • Search by title and category filtering
  • Book details modal with descriptions and stock info
  • Client-side shopping cart with quantity controls and totals
  • Responsive UI optimized for mobile and desktop
  • Serverless backend with CORS-enabled API Gateway
  • Automated CI/CD pipeline with CodePipeline and CodeBuild
  • CloudWatch monitoring for Lambda and build logs

Tech Stack

Technology Purpose
React Frontend framework
Amazon S3 Static website hosting
CloudFront Global CDN + HTTPS
Lambda Serverless backend (Node.js 18)
API Gateway REST API management
RDS MySQL Planned database
CodePipeline CI/CD orchestration
CodeBuild Automated builds
CloudWatch Monitoring and logs
ACM SSL/TLS certificates

Infrastructure Components

AWS Service Configuration
S3 bookstore-frontend-khand-123 with public read policy
CloudFront Redirects HTTP to HTTPS, S3 website endpoint origin
Lambda bookstore-get-books with in-memory catalog data
API Gateway HTTP API with GET /books route
CodePipeline GitHub → CodeBuild → S3 deploy stages
CodeBuild Node.js 18 build, npm install and npm run build
CloudWatch Lambda logs in /aws/lambda/bookstore-get-books
ACM Public cert in us-east-1 attached to CloudFront

Installation

  1. Clone the repository git clone https://github.com/purvii12/Online-Bookstore.git cd Online-Bookstore

  2. Frontend setup npm install npm run build

  3. Deploy to AWS manually (before CI/CD) Upload build/ to S3 bucket aws s3 sync build/ s3://bookstore-frontend-khand-123 --delete

Create CloudFront distribution pointing to S3 website endpoint

  1. Backend deployment Create Lambda function with provided code Create API Gateway HTTP API with GET /books → Lambda integration Test: https://YOUR_API_ID.execute-api.us-east-1.amazonaws.com/books(replace with your id)

Networking

Networking Architecture


Usage

  1. Access frontend via URL: https://online-bookstore-frontend-zyyx.onrender.com/
  2. Browse books, use search and category filters
  3. Click book cards for details modal with stock info
  4. Add items to cart, adjust quantities, view running totals

CI/CD Workflow: Push to main branch triggers: GitHub → CodePipeline → CodeBuild → S3 deployment git add . git commit -m "Update UI" git push origin main

CI/CD

Cloud BookHub Pipeline

ACM Certificate Setup

  1. Navigate to ACM console in us-east-1 (required for CloudFront)
  2. Request public certificate for your domain (e.g., yourdomain.com, *.yourdomain.com)
  3. Choose DNS validation and add CNAME records to Route 53
  4. Wait for "Issued" status (5-30 minutes)
  5. Attach certificate to CloudFront: Distributions → Edit → Custom SSL Certificate [web:2][web:6]

CloudFront Custom Domain Configuration Alternate Domain Names (CNAMEs): yourdomain.com, www.yourdomain.com Custom SSL Certificate: arn:aws:acm:us-east-1:ACCOUNT:certificate/CERT-ID


Deployment Steps

  1. Infrastructure (AWS Console) S3 bucket → CloudFront → Lambda → API Gateway → RDS (optional) IAM roles → CodeBuild project → CodePipeline

  2. CI/CD Setup Connect GitHub repo → Create buildspec.yml → CodeBuild project CodePipeline: Source(github) → Build(codebuild) → Deploy(S3)

  3. Frontend Configuration Update API_BASE in App.js to your API Gateway URL, rebuild, commit to main


Roadmap

  • React SPA on S3 + CloudFront with HTTPS
  • Lambda + API Gateway serverless backend
  • Complete CI/CD pipeline automation
  • CloudWatch monitoring and logging
  • RDS MySQL instance provisioned
  • RDS database integration in Lambda
  • Amazon Cognito authentication
  • AWS WAF protection for CloudFront
  • Custom domain with Route 53

Contributing

  1. Fork the project
  2. Create feature branch: git checkout -b feature/amazing-feature
  3. Commit changes: git commit -m 'Add amazing feature'
  4. Push to branch: git push origin feature/amazing-feature
  5. Open Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.


Contact

Purvii - @purvii12

Project Link: https://github.com/purvii12/Online-Bookstore


Acknowledgments

  • AWS Documentation for serverless patterns [web:1]
  • AWS Samples bookstore demo for reference architecture [web:2]
  • React community for excellent frontend ecosystem

About

Cloud BookHub is a serverless online bookstore built on AWS, featuring a React frontend on S3 and CloudFront, a Lambda + API Gateway books API, and a CI/CD pipeline with CodePipeline and CodeBuild, all designed to be scalable, secure, and ready for RDS MySQL integration.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Contributors

Languages