Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sanjay-sol/hosthub
Users can deploy their React Projects by providing GitHub URL that spins up Docker container to generate build scripts and upload files to AWS S3. Build logs are pub/sub to Redis with sockets for subscriptions, reverse proxy optimizes S3 object streaming.
https://github.com/sanjay-sol/hosthub
docker nodejs redis s3 socket-io
Last synced: 21 days ago
JSON representation
Users can deploy their React Projects by providing GitHub URL that spins up Docker container to generate build scripts and upload files to AWS S3. Build logs are pub/sub to Redis with sockets for subscriptions, reverse proxy optimizes S3 object streaming.
- Host: GitHub
- URL: https://github.com/sanjay-sol/hosthub
- Owner: sanjay-sol
- Created: 2024-02-20T12:17:19.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2024-03-09T12:32:19.000Z (10 months ago)
- Last Synced: 2024-11-06T22:26:10.946Z (2 months ago)
- Topics: docker, nodejs, redis, s3, socket-io
- Language: TypeScript
- Homepage: https://host-hub.vercel.app/
- Size: 10.6 MB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# HostHub
HostHub is a platform that allows users to deploy their React projects by providing a GitHub URL. It spins up a Docker container to generate build scripts and uploads files to AWS S3. Build logs are pub/sub to Redis with sockets for subscriptions, and a reverse proxy optimizes S3 object streaming.
## System Architecture
## Demo Video
https://github.com/sanjay-sol/hostHub/assets/114111046/1d17ae56-967a-4486-b974-1c3ba8a10d47
## Tech Stack
- Docker
- Node.js
- AWS S3
- Redis
- Socket.io# Local Setup
# api-server
1. setup .env
```
AWS_ACCESSKEY_ID = 'AKIA....'
AWS_SECRET_ACCESS_KEY = 'mq++8uqQ.....'
AWS_REGION = "ap-south-1" // any...
AWS_CLUSTER = "arn:aws:ecs:ap-south-1:855...."
AWS_TASK = "arn:aws:ecs:ap-south-1:855829953...."
AWS_SUBNET1 = "zp---"
AWS_SUBNET2 = "zp---"
AWS_SUBNET3 = "zp---"REDIS_URL = "rediss:/default:AVNS_uwUrvXtzo......"
DATABASE_URL="postgres://avnadmin:AVNS_gDGU......."```
For redis and postgreSQL urls - setup locally OR get from here [aiven](https://aiven.io/)
2. setup prisma
```
npx prisma init --datasource-provider sqlite
npx prisma migrate dev --name init
```
3. run the file
```
npm start```
4. view the DB - open localhost:5000
```
npx prisma studio
```# s3-reverse-proxy
1. setup .env
```
BASE_PATH = "aws bucketpath ...."
```2. Run the files
```
node index.js```
```
# server1. setup .env
```
AWS_ACCESSKEY_ID='AKI...........'
AWS_SECRET_ACCESS_KEY = '4b0B0........./'
AWS_REGION = "ap-s..."
AWS_BUCKET_NAME = "bucket-name"
```
2. setup docker
```
1. aws ecr get-login-password --region ap-south-1 | docker login --username AWS --password-stdin 8558....amazonaws.com
2. docker build -t build-server .
3. docker tag build-server:latest 8558......amazonaws.com/build-server:latest
4. docker push 855....1.amazonaws.com/build-server:latest
```# web-sockets
1. setup .env
```
REDIS_URL = "aiven:23...." // setup locally or get from here [aiven] https://aiven.io/```
2. run the files
```
node index.js
```