railyard/apps/ritgram/deploy-repos.sh
caelum0x f80b04ae0f feat(ritgram): move GitGram app into railyard as Ritgram, next to Rithub
Moved later/gitgram-ai/gitgram/ to apps/ritgram/ (fresh history; full history stays in caelum0x/gitgram).
AITimeMachine stays separate in later/gitgram-ai per the Rithub master plan.
Logs, pid files and env files are ignored; GPL-3.0 mobile/proximity noted in THIRD_PARTY_NOTICES.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-11-13 04:18:46 +03:00

141 lines
3.7 KiB
Bash
Executable File
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
echo "๐Ÿš€ Deploying Universal Repository Support"
echo "=========================================="
echo ""
# Colors
GREEN='\033[0;32m'
BLUE='\033[0;34m'
RED='\033[0;31m'
NC='\033[0m' # No Color
# Check if we're in the right directory
if [ ! -d "backend" ] || [ ! -d "web" ]; then
echo -e "${RED}โŒ Error: Run this script from the gitgram root directory${NC}"
exit 1
fi
echo -e "${BLUE}๐Ÿ“‹ Pre-deployment Checklist${NC}"
echo ""
# 1. Check database migration
echo "1. Checking database migration..."
cd backend
if npx prisma migrate status 2>&1 | grep -q "Database schema is up to date"; then
echo -e "${GREEN}โœ… Database is up to date${NC}"
else
echo -e "${RED}โš ๏ธ Database needs migration${NC}"
echo " Run: cd backend && npx prisma migrate deploy"
fi
# 2. Check if Prisma client is generated
echo ""
echo "2. Checking Prisma client..."
if [ -d "node_modules/@prisma/client" ]; then
echo -e "${GREEN}โœ… Prisma client exists${NC}"
else
echo -e "${RED}โš ๏ธ Generating Prisma client...${NC}"
npx prisma generate
fi
# 3. Check environment variables
echo ""
echo "3. Checking environment variables..."
if [ -f ".env" ]; then
echo -e "${GREEN}โœ… .env file exists${NC}"
if grep -q "DATABASE_URL" .env; then
echo -e "${GREEN}โœ… DATABASE_URL configured${NC}"
else
echo -e "${RED}โŒ DATABASE_URL missing${NC}"
fi
if grep -q "GITHUB_TOKEN" .env; then
echo -e "${GREEN}โœ… GITHUB_TOKEN configured (5000 req/hour)${NC}"
else
echo -e "${BLUE}โ„น๏ธ GITHUB_TOKEN not set (60 req/hour limit)${NC}"
echo " Get token: https://github.com/settings/tokens"
fi
else
echo -e "${RED}โŒ .env file missing${NC}"
fi
cd ..
# 4. Test backend compilation
echo ""
echo "4. Testing backend compilation..."
cd backend
if npm run build > /dev/null 2>&1; then
echo -e "${GREEN}โœ… Backend compiles successfully${NC}"
else
echo -e "${RED}โš ๏ธ Backend has compilation errors (may still work)${NC}"
fi
cd ..
# 5. Check frontend
echo ""
echo "5. Checking frontend..."
cd web
if [ -f "package.json" ]; then
echo -e "${GREEN}โœ… Frontend package.json exists${NC}"
else
echo -e "${RED}โŒ Frontend package.json missing${NC}"
fi
cd ..
echo ""
echo -e "${BLUE}๐Ÿ“ฆ New Files Created${NC}"
echo ""
echo "Backend:"
echo " โœ… src/services/repositoryService.ts"
echo " โœ… src/controllers/repositoryController.ts"
echo " โœ… src/routes/repositories.ts"
echo ""
echo "Frontend:"
echo " โœ… components/CreatePostWithRepo.tsx"
echo " โœ… app/repo/[owner]/[name]/page.tsx"
echo " โœ… app/explore/repos/page.tsx"
echo ""
echo "Mobile:"
echo " โœ… services/repositoryService.ts"
echo " โœ… app/repo/search.tsx"
echo " โœ… app/repo/[owner]/[name].tsx"
echo ""
echo -e "${BLUE}๐Ÿงช Testing Endpoints${NC}"
echo ""
echo "Start backend: cd backend && npm run dev"
echo "Then test:"
echo ""
echo " curl http://localhost:3001/api/repositories/search?q=vscode"
echo " curl http://localhost:3001/api/repositories/microsoft/vscode"
echo " curl http://localhost:3001/api/repositories/trending"
echo ""
echo -e "${BLUE}๐Ÿš€ Deployment Commands${NC}"
echo ""
echo "Backend (Railway/Render):"
echo " cd backend"
echo " npx prisma migrate deploy"
echo " git push production main"
echo ""
echo "Frontend (Vercel):"
echo " cd web"
echo " vercel --prod"
echo ""
echo -e "${GREEN}โœ… Pre-deployment check complete!${NC}"
echo ""
echo "Next steps:"
echo " 1. Test locally (see commands above)"
echo " 2. Deploy backend"
echo " 3. Deploy frontend"
echo " 4. Create seed posts about popular repos"
echo ""
echo "๐Ÿ“š Documentation:"
echo " - QUICK_START.md - Start in 3 steps"
echo " - DEPLOYMENT_CHECKLIST.md - Full deploy guide"
echo " - API_EXAMPLES.md - API usage"
echo ""