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.
hostHub-demo.mp4
- Docker
- Node.js
- AWS S3
- Redis
- Socket.io
- 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
- setup prisma
npx prisma init --datasource-provider sqlite
npx prisma migrate dev --name init
- run the file
npm start
- view the DB - open localhost:5000
npx prisma studio
- setup .env
BASE_PATH = "aws bucketpath ...."
- Run the files
node index.js```
- setup .env
AWS_ACCESSKEY_ID='AKI...........'
AWS_SECRET_ACCESS_KEY = '4b0B0........./'
AWS_REGION = "ap-s..."
AWS_BUCKET_NAME = "bucket-name"
- 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
- setup .env
REDIS_URL = "aiven:23...." // setup locally or get from here [aiven] https://aiven.io/
- run the files
node index.js