This repository has been archived on 2026-11-17. You can view files and clone it, but cannot push or open issues or pull requests.
gitgram-ai/gitgram/deploy-repos.sh
caelum0x 49b183818c Unify gitgram + aitimemachine into the monorepo (de-submodule) and merge vendored engines
Convert gitgram/ and aitimemachine/ from embedded git repos (which showed as
opaque submodule gitlinks on GitHub) into fully-tracked first-party content.

AITM now merges its 7 vendored repos as first-party engines:
- memory: beads (Go task DAG) + context7 (docs SDK), unified into saved_contexts
- git: vendored C git (bundled binary) + gitnexus (in-process code intelligence)
- agentic: a2a (@a2a-js/sdk) + pal (AITM-managed Python subprocess)

Includes the full session's product build: Gitgram web/mobile/backend features,
AITM website/CLI/MCP, the unified memory layer, engine build tooling
(scripts/build-engines.sh, Dockerfile, CI), docs (README, ENGINES.md, ARCHITECTURE.md),
and extensive test suites.

Build artifacts, node_modules, external/, and gemini-cli are gitignored.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-23 14:14:09 +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 ""