AWS Logo
Menu
RapidHost : A Website Hosting System

RapidHost : A Website Hosting System

A website hosting platform made using lambda, s3 and cloudfront services

Published Jan 7, 2025

Introduction

RapidHost is a serverless website hosting platform designed to provide an easy and efficient way to host static websites. The system have user friendly frontend interface which allows users to use the system efficiently. The platform leverages the power of AWS services such as Lambda, S3, API Gateway, and CloudFront to offer a scalable, secure, and cost-effective solution for hosting HTML, CSS, and JavaScript files.
The system enables users to upload their website files, which are automatically deployed to an AWS S3 bucket. A unique URL is then generated via CloudFront, making the website publicly accessible. The serverless approach ensures that users don't need to worry about managing servers, making the platform ideal for developers, students, and small businesses.
GitHub link :- https://github.com/jayeshgatfane/RapidHost
Connect with me on Linkedin :- https://www.linkedin.com/in/jayesh-gatfane

System Overview

The RapidHost platform consists of two main components: the frontend interface and the backend infrastructure.

Frontend Interface

The frontend interface of RapidHost is designed to be intuitive and user-friendly. It allows users to upload their website files (HTML, CSS, and JavaScript) through a set of distinct buttons for each file type. After all files are uploaded, the user can click a "Deploy Website" button, which triggers the backend deployment process. Upon successful deployment, the system automatically generates a public URL for the hosted website, which is accessible via AWS CloudFront.
The frontend interface uses basic web technologies like HTML, CSS, and JavaScript, avoiding complex frameworks to maintain simplicity and ensure ease of use.

Backend Infrastructure

The backend of RapidHost which is powered by AWS serverless technologies, with the primary logic handled by AWS Lambda. Below is a breakdown of the core services involved:

AWS Lambda

AWS Lambda is the heart of the RapidHost platform, providing the core functionality for handling file uploads, storing files in S3, and generating a CloudFront URL for the deployed website. When a user uploads a file, AWS Lambda functions are triggered to process the uploaded files, store them in unique folders in the S3 bucket, and generate a public URL for the website using CloudFront.
Lambda also handles folder creation dynamically for each user to ensure that their files are stored in isolated directories, preventing any conflicts or overwriting of files between users. The system uses a unique identifier for each user to create these folders.

AWS S3 (Simple Storage Service)

Amazon S3 is used for storing the static website files uploaded by the user. The S3 bucket acts as the persistent storage for the HTML, CSS, and JavaScript files, ensuring that they are securely stored and easily accessible by CloudFront.
Each user’s files are organized in unique folders within the S3 bucket, ensuring that the data of one user does not overwrite the data of another. S3 buckets are configured with proper permissions, and the files are kept private to ensure secure access only through CloudFront.

AWS CloudFront

AWS CloudFront is a Content Delivery Network (CDN) service used to serve the static content (website files) from S3 to the end-users. Once the files are uploaded and stored in S3, CloudFront distributes them across its global network of edge locations, ensuring low-latency and fast content delivery to users worldwide.
CloudFront also handles HTTPS encryption, making sure that the content is delivered securely to the users. After the deployment process is triggered, a public URL is generated through CloudFront that provides access to the hosted website.

API Gateway

API Gateway is used to connect the frontend interface with the backend logic powered by AWS Lambda. It serves as the communication layer between the user’s browser and the AWS Lambda functions. API Gateway is configured with Cross-Origin Resource Sharing (CORS) to ensure that requests from the frontend are allowed without security issues, enabling seamless communication between the frontend and backend, even when they are hosted on different domains.
The API Gateway allows the frontend to interact with Lambda functions through HTTP requests, ensuring that the file upload process and deployment trigger are handled efficiently.

AWS IAM (Identity and Access Management)

To ensure the security and proper access control of resources, AWS IAM (Identity and Access Management) is used to define roles and permissions for the various services (Lambda, API Gateway, S3, and CloudFront). Each service is assigned specific permissions to access the necessary resources.
For instance, Lambda functions have permissions to read and write files to the S3 bucket, while CloudFront has permissions to access the files stored in S3 and serve them to users. This role-based access control ensures that only authorized services can interact with each resource, providing a secure environment for users' data.

Key Features

1. Dynamic Folder Creation for Multiple Users

To support multiple users without file conflicts, AWS Lambda creates unique folders within the S3 bucket for each user. This structure ensures that no two users' files will overwrite each other, allowing the platform to scale efficiently. Each user's data is isolated in their own folder, enhancing security.

2. Seamless CORS Integration

CORS is configured in the API Gateway to allow secure, cross-origin communication between the frontend (hosted on one domain) and the backend (hosted on AWS services). This ensures that users can upload their files and trigger the deployment process from a browser without encountering any CORS-related issues.

3. Automated URL Generation for Accessing the Hosted Website

Once the website files are deployed to S3 and served via CloudFront, an automated URL is generated, making it easy for users to access their hosted website. The URL is publicly accessible and provides secure access to the content, thanks to the HTTPS encryption provided by CloudFront.

4. Serverless Architecture

RapidHost utilizes a serverless architecture, meaning there is no need for manual server management. Services like AWS Lambda, API Gateway, and CloudFront scale automatically based on usage, ensuring high availability and minimal operational costs. This architecture simplifies the deployment and maintenance process, making it ideal for small-scale hosting.

5. Cost Efficiency

By leveraging AWS’s serverless services, RapidHost eliminates the need for dedicated server infrastructure, reducing costs. The platform incurs minimal operational costs due to Lambda's pay-per-use model and S3’s cost-effective storage.
 

Comments