AI Code Assistant

Complete Full-Stack Project Setup for AI-Powered Development

v1.0.0 Active

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.

Project Initialization

# Create project directory structure and initialize git repository
mkdir -p ai-code-assistant/{client,server,scripts,docs} && cd ai-code-assistant
git init
echo "# AI Code Assistant - Full Stack Project" >> README.md
echo "Project structure:" >> README.md
echo "- client: Frontend React application" >> README.md
echo "- server: Backend Node.js service" >> README.md
echo "- scripts: Deployment and utility scripts" >> README.md
echo "- docs: Project documentation" >> README.md
# Initialize frontend with Vite + React + TypeScript
npm create vite@latest client -- --template react-ts
cd client && npm install
npm install @monaco-editor/react @uiw/react-markdown-preview
npm install tailwindcss postcss autoprefixer @tailwindcss/typography
npx tailwindcss init -p
npm install react-router-dom @tanstack/react-query zustand
npm install --save-dev @types/node @types/react @types/react-dom
# 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

Automated Testing Setup

# Frontend testing configuration (React)
cd client && npm install --save-dev jest @testing-library/react
npm install @testing-library/jest-dom @testing-library/user-event
npm install --save-dev @types/jest jest-environment-jsdom
echo "module.exports = {" > jest.config.js
echo " preset: 'ts-jest'," >> jest.config.js
echo " testEnvironment: 'jsdom'," >> jest.config.js
echo " setupFilesAfterEnv: ['/jest.setup.ts']," >> jest.config.js
echo " moduleNameMapper: {" >> jest.config.js
echo " '^@/(.*)$': '/src/$1'" >> jest.config.js
echo " }" >> jest.config.js
echo "}" >> jest.config.js
echo "import '@testing-library/jest-dom';" > jest.setup.ts
# Backend testing configuration (Node.js)
cd ../server && npm install --save-dev jest ts-jest @types/jest
npm install supertest @types/supertest
echo "module.exports = {" > jest.config.js
echo " preset: 'ts-jest'," >> jest.config.js
echo " testEnvironment: 'node'," >> jest.config.js
echo " testRegex: '(/__tests__/.*|(\\.|/)(test|spec))\\.tsx?$'," >> jest.config.js
echo " moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node']," >> jest.config.js
echo " collectCoverage: true," >> jest.config.js
echo " coverageDirectory: 'coverage'," >> jest.config.js
echo " coverageReporters: ['text', 'lcov']" >> jest.config.js
echo "}" >> jest.config.js
# 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

  1. Implement WebSocket connection for real-time collaboration
  2. Set up authentication system with JWT
  3. Create database schema for code snippets and user data
  4. Integrate with AI APIs (OpenAI, Anthropic, etc.)
  5. Develop the Monaco Editor interface with custom language support
  6. Configure monitoring with Prometheus and Grafana

Made with DeepSite LogoDeepSite - 🧬 Remix