[!IMPORTANT]
Migration will only be triggered if the current free tier of any service is exceeded or if the app reaches 100+ active weekly users currently we only have 2 :(
[!NOTE]
This is only for discussion and suggestions; this will happen very late because we are far ahead of getting any sponsors and far ahead of finishing the project; hopefully, it will be completed by fall 25.
Description:
As part of the Zephyr project’s infrastructure upgrade, we are migrating from the current serverless setup using Vercel, Cloudflare R2, and Upstash Redis to a custom VPS hosted with Hostinger. This migration will involve setting up the following components on the new VPS.
Goals:
[ ] Replace Vercel deployments with self-hosted VPS deployment.
[ ] Replace Cloudflare R2 with MinIO for self-hosted object storage.
[ ] Replace Upstash Redis with a self-hosted Redis instance on the VPS.
[ ] Replace Uploadthing with custom user avatar storage solution on the VPS.
[ ] Set up PostgreSQL on the VPS to replace Vercel PostgreSQL.
[ ] Set up Coolify for easy deployment and management of services.
[ ] Set up a custom domain from GoDaddy for the application and object storage endpoints.
[ ] Set up Traefik for load balancing, SSL termination, and routing.
[ ] Set up Prometheus for server and application monitoring.
Components to Migrate:
Domain and DNS:
[ ] Purchase and configure a custom domain from GoDaddy (₹1.6k ~ $18.96 for 3 years).
[ ] Set up DNS records to point to the VPS IP for the application and object storage.
VPS Setup (Hostinger):
[ ] Choose a VPS plan with 2 vCPU cores, 8GB RAM, 100GB NVMe disk space, and 8TB bandwidth (₹13.3k ~ $154.22 for 2 years).
[ ] Install and configure Coolify for deployment management.
[ ] Set up PostgreSQL on the VPS and migrate the current database schema.
[ ] Set up Redis on the VPS for caching and session management.
[ ] Set up MinIO for object storage (replacing Cloudflare R2).
[ ] Set up custom storage solution for user avatars (replacing Uploadthing).
Application Deployment:
[ ] Set up the Next.js app (from Turborepo) on the VPS using Coolify.
[ ] Set up proper cron jobs to handle scheduled tasks (e.g., aggregating trending posts, cleaning up data).
[ ] Configure the app to use PostgreSQL, Redis, and MinIO via environment variables in Coolify.
Load Balancing and SSL:
[ ] Install and configure Traefik for reverse proxying, load balancing, and SSL certificate management using Let's Encrypt.
[ ] Set up Traefik to route traffic to the appropriate containers (Next.js app, PostgreSQL, Redis, MinIO).
Monitoring and Alerts:
[ ] Install and configure Prometheus for monitoring VPS health (CPU, memory, disk usage) and application performance (response times, database query times).
[ ] Set up Grafana (optional) for better visualization of Prometheus data.
Steps:
[ ] Set up the VPS from Hostinger.
[ ] Configure DNS for the custom domain.
[ ] Install and configure Coolify on the VPS.
[ ] Set up PostgreSQL, Redis, and MinIO containers using Coolify.
[ ] Deploy the Next.js app on the VPS via Coolify.
[ ] Install and configure Traefik for load balancing and SSL termination.
[ ] Set up monitoring with Prometheus and optionally Grafana.
[ ] Update application code to point to self-hosted services (PostgreSQL, Redis, MinIO).
[ ] Test the entire system, ensuring all components (aggregator, community posts, user avatars, etc.) are working correctly.
Acceptance Criteria:
[ ] The application is deployed and fully functional on the VPS with the custom domain.
[ ] All data aggregation works as expected, pulling from Twitter, Reddit, 4chan, HackerNews, and Tumblr.
[ ] Users can create communities, post content, and start conversations.
[ ] User avatars are stored and retrieved from the self-hosted solution.
[ ] Postgres, Redis, and MinIO are running on the VPS and connected to the app.
[ ] Traefik is properly routing traffic, and SSL is configured for secure connections.
[ ] Monitoring is set up and accessible through Prometheus (Grafana optional).
Notes:
[ ] Ensure to follow security best practices for each service (e.g., securing PostgreSQL and Redis, setting up firewalls, etc.).
[ ] Backup strategies need to be considered for PostgreSQL and MinIO.
[ ] Make sure the VPS is sized appropriately for scaling if the user base grows.
Description:
As part of the Zephyr project’s infrastructure upgrade, we are migrating from the current serverless setup using Vercel, Cloudflare R2, and Upstash Redis to a custom VPS hosted with Hostinger. This migration will involve setting up the following components on the new VPS.
Goals:
Components to Migrate:
Domain and DNS:
VPS Setup (Hostinger):
Application Deployment:
Load Balancing and SSL:
Monitoring and Alerts:
Steps:
Acceptance Criteria:
Notes: