Complete Full-Stack Project Setup for AI-Powered Development
v1.0.0Active
Frontend Stack
React 18 + TypeScript 5
Tailwind CSS 3.3
Monaco Editor 0.40
Vite 4.3
React Router 6
Zustand 4.0
Backend Stack
Node.js 18 + Express 4.18
WebSocket (ws 8.13)
JWT Authentication
PostgreSQL 15
Prisma 4.0
Redis 4.6
DevOps & Tools
GitHub Actions
Docker + Compose
ESLint + Prettier
Jest + Testing Library
Husky 8.0
Prometheus + Grafana
Important Note
Before proceeding, ensure you have Node.js v18+, Docker, and PostgreSQL installed on your system. The setup assumes you have basic familiarity with terminal commands.
# Initialize backend with Node.js + Express + TypeScript cd .. && mkdir server && cd server npm init -y npm install express typescript ts-node @types/node @types/express npm install ws jsonwebtoken pg pg-hstore dotenv cors npm install prisma @prisma/client redis npm install --save-dev @types/ws @types/jsonwebtoken @types/cors npx tsc --init --outDir dist --rootDir src --module commonjs npx prisma init
# Set up development tools and configuration npm install -g concurrently cd .. && echo "node_modules" >> .gitignore echo "client/node_modules" >> .gitignore echo "server/node_modules" >> .gitignore echo "dist" >> .gitignore echo ".env" >> .gitignore echo ".DS_Store" >> .gitignore echo "*.log" >> .gitignore
GitHub Repository Setup
# Create new repository on GitHub (manually through UI) # Then link to local repository and push initial code: git remote add origin https://github.com/yourusername/ai-code-assistant.git git branch -M main git add . git commit -m "Initial project setup" git push -u origin main ✓ Successfully pushed initial commit to GitHub
# Add test scripts to package.json npm pkg set scripts.test="jest" npm pkg set scripts.test:watch="jest --watch" npm pkg set scripts.test:coverage="jest --coverage" ✓ Testing setup complete for both frontend and backend
CI/CD Pipeline Configuration
# Create GitHub Actions workflow for automated testing and deployment mkdir -p .github/workflows cat > .github/workflows/main.yml << 'EOF' name: CI/CD Pipeline on: push: branches: [ main ] pull_request: branches: [ main ] jobs: build-and-test: name: Build and Test runs-on: ubuntu-latest services: postgres: image: postgres:15 env: POSTGRES_PASSWORD: postgres POSTGRES_USER: postgres POSTGRES_DB: test ports: - 5432:5432 options: >- --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 redis: image: redis ports: - 6379:6379 steps: - uses: actions/checkout@v3 - name: Set up Node.js uses: actions/setup-node@v3 with: node-version: '18' cache: 'npm' - name: Install dependencies run: | cd client && npm install cd ../server && npm install - name: Run client tests run: cd client && npm test - name: Run server tests run: | cd server npm run build npm test - name: Build production run: cd client && npm run build - name: Docker build run: | docker build -t ai-code-assistant-client ./client docker build -t ai-code-assistant-server ./server deploy: name: Deploy to Production needs: build-and-test runs-on: ubuntu-latest if: github.ref == 'refs/heads/main' steps: - uses: actions/checkout@v3 - name: Install DigitalOcean CLI run: | curl -sL https://deb.nodesource.com/setup_18.x | sudo -E bash - sudo apt-get install -y nodejs sudo npm install -g doctl - name: Configure DigitalOcean CLI run: doctl auth init --access-token ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }} - name: Deploy to DigitalOcean App Platform run: doctl apps create --spec ./.do/app.yaml EOF
Setup Complete
Your AI Code Assistant project is now fully configured with:
Modern frontend with React + TypeScript
Scalable backend with Node.js + Express
Automated testing infrastructure
CI/CD pipeline ready for deployment
Docker containers for all services
Next Steps
Implement WebSocket connection for real-time collaboration
Set up authentication system with JWT
Create database schema for code snippets and user data
Integrate with AI APIs (OpenAI, Anthropic, etc.)
Develop the Monaco Editor interface with custom language support