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>
141 lines
3.7 KiB
Bash
Executable File
141 lines
3.7 KiB
Bash
Executable File
#!/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 ""
|