Documentation
Languages and Frameworks/Web Development

Web Development Support

ThinkCode provides comprehensive support for modern web development, offering specialized tools, intelligent code assistance, and powerful features to enhance your productivity when working on web applications, from simple static sites to complex full-stack applications.

Supported Web Technologies

ThinkCode supports a wide range of web development technologies:

Frontend

  • HTML & CSS

    • HTML5 and CSS3 features
    • Emmet abbreviations for rapid coding
    • Live preview and validation
  • JavaScript & TypeScript

    • ECMAScript latest features
    • Type checking and inference
    • Modern module systems
  • Frontend Frameworks

    • React (with JSX/TSX)
    • Vue (with SFC support)
    • Angular
    • Svelte
    • Solid
    • Lit
  • CSS Tools & Frameworks

    • Sass/SCSS
    • Less
    • Tailwind CSS
    • CSS Modules
    • CSS-in-JS (styled-components, Emotion, etc.)

Backend

  • Server-side Technologies

    • Node.js
    • Deno
    • Python (Django, Flask, FastAPI)
    • Ruby (Rails)
    • PHP (Laravel, Symfony)
    • Java (Spring)
    • .NET (ASP.NET Core)
    • Go (Gin, Echo, Fiber)
  • Database Integration

    • SQL (MySQL, PostgreSQL, SQLite)
    • NoSQL (MongoDB, Redis, Elasticsearch)
    • ORM support (Prisma, Sequelize, TypeORM, etc.)

Full-stack Frameworks

  • Unified Frameworks

    • Next.js
    • Remix
    • Nuxt.js
    • SvelteKit
    • Astro
    • Qwik City
  • Meta-frameworks

    • T3 Stack
    • RedwoodJS
    • Blitz.js
    • Create React App
    • Vite
    • Nx

Getting Started

Project Setup

ThinkCode makes it easy to start new web projects:

  1. Create New Project:

    • Command Palette (Ctrl+Shift+P / Cmd+Shift+P)
    • Type "ThinkCode: Create New Project"
    • Select Web Development category
    • Choose from various project templates:
      • Static HTML/CSS/JS site
      • React/Vue/Angular application
      • Next.js/Nuxt.js application
      • Full-stack application
      • And more...
  2. Import Existing Project:

    • Open an existing web project folder
    • ThinkCode automatically detects project type and configures the environment
  3. Project Explorer:

    • Navigate your web project structure
    • Special views for frontend and backend components
    • Specialized icons for different file types

Frontend Development

HTML & CSS Tools

ThinkCode provides powerful tools for HTML and CSS development:

  • Intelligent Editing:

    • Context-aware auto-completion for HTML tags and attributes
    • CSS property and value suggestions
    • Emmet abbreviation expansion for rapid HTML/CSS writing
  • Linting & Validation:

    • Real-time syntax checking
    • Accessibility validation
    • Best practice suggestions
  • Preview & Visualization:

    • Live preview of HTML pages
    • CSS property visualization
    • Layout debugging tools

Example of HTML editing with intelligent assistance:

{/* ThinkCode provides intelligent assistance for HTML */}
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>My Web Page</title>
  <link rel="stylesheet" href="styles.css">
</head>
<body>
  {/* ThinkCode offers autocompletion and validation */}
  <header>
    <nav>
      <ul>
        <li><a href="#home">Home</a></li>
        <li><a href="#about">About</a></li>
        <li><a href="#contact">Contact</a></li>
      </ul>
    </nav>
  </header>
  
  <main>
    <section id="home">
      <h1>Welcome to My Website</h1>
      <p>This is a sample website built with HTML and CSS.</p>
    </section>
  </main>
  
  <footer>
    <p>&copy; 2023 My Website</p>
  </footer>
</body>
</html>

Example of CSS editing with intelligent assistance:

/* ThinkCode provides intelligent assistance for CSS */
:root {
  --primary-color: #3498db;
  --secondary-color: #2ecc71;
  --text-color: #333;
  --background-color: #f9f9f9;
}
 
/* ThinkCode offers property completion and validation */
body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--background-color);
  margin: 0;
  padding: 0;
}
 
/* ThinkCode provides suggestions for modern CSS features */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}
 
/* ThinkCode shows browser compatibility information */
.card {
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  transition: transform 0.3s ease;
}
 
.card:hover {
  transform: translateY(-5px);
}

JavaScript & TypeScript Support

ThinkCode offers exceptional support for JavaScript and TypeScript:

  • Intelligent Code Assistance:

    • Type checking and inference
    • Auto-imports
    • Code navigation
    • Refactoring tools
  • Modern JavaScript Support:

    • Latest ECMAScript features
    • Module systems (ESM, CommonJS)
    • JSX/TSX support
    • API suggestions
  • Frontend Framework Integration:

    • Component intelligence
    • Framework-specific snippets
    • State management visualization
    • Performance optimization tools

Example of React component with intelligent assistance:

// ThinkCode provides intelligent assistance for React
import React, { useState, useEffect } from 'react';
import { useRouter } from 'next/router';
import { Button } from './Button';
import styles from './ProductCard.module.css';
import type { Product } from '@/types/product';
 
interface ProductCardProps {
  product: Product;
  onAddToCart: (product: Product) => void;
  featured?: boolean;
}
 
export const ProductCard: React.FC<ProductCardProps> = ({ 
  product, 
  onAddToCart, 
  featured = false 
}) => {
  const [isInCart, setIsInCart] = useState(false);
  const router = useRouter();
  
  useEffect(() => {
    // ThinkCode provides smart suggestions for hooks
    const checkCartStatus = () => {
      // Implementation...
      setIsInCart(false);
    };
    
    checkCartStatus();
  }, [product.id]);
  
  const handleAddToCart = () => {
    onAddToCart(product);
    setIsInCart(true);
  };
  
  const handleViewDetails = () => {
    router.push(`/products/${product.slug}`);
  };
  
  return (
    <div className={`${styles.card} ${featured ? styles.featured : ''}`}>
      <img src={product.image} alt={product.name} className={styles.image} />
      <div className={styles.content}>
        <h3 className={styles.title}>{product.name}</h3>
        <p className={styles.price}>${product.price.toFixed(2)}</p>
        <p className={styles.description}>{product.description}</p>
        <div className={styles.actions}>
          <Button onClick={handleViewDetails} variant="outline">
            View Details
          </Button>
          <Button 
            onClick={handleAddToCart} 
            disabled={isInCart}
            variant="primary"
          >
            {isInCart ? 'In Cart' : 'Add to Cart'}
          </Button>
        </div>
      </div>
    </div>
  );
};

CSS Frameworks Support

ThinkCode integrates with popular CSS frameworks:

  • Tailwind CSS:

    • Class autocompletion
    • Preview hover
    • Configuration assistance
    • Unused class detection
  • CSS Modules:

    • Module autocompletion
    • Class name navigation
    • Refactoring support
  • Styled Components / Emotion:

    • Syntax highlighting
    • Autocompletion in template literals
    • Component style navigation

Backend Development

Server-Side Languages

ThinkCode provides intelligent support for various backend languages:

  • Node.js / Express:

    • Route detection and navigation
    • Middleware assistance
    • Request/response object completion
    • HTTP method suggestions
  • Python Web Frameworks:

    • Django template support
    • Flask/FastAPI route detection
    • ORM intelligence
  • PHP Web Development:

    • Laravel/Symfony support
    • Template engine integration
    • PHP 8.x features

Example of Node.js/Express API with intelligent assistance:

// ThinkCode provides intelligent assistance for Express.js
const express = require('express');
const mongoose = require('mongoose');
const cors = require('cors');
const bodyParser = require('body-parser');
const productRoutes = require('./routes/products');
const userRoutes = require('./routes/users');
 
// ThinkCode offers import completion and route suggestions
const app = express();
const PORT = process.env.PORT || 3000;
 
// Middleware
app.use(cors());
app.use(bodyParser.json());
app.use(express.static('public'));
 
// Routes
app.use('/api/products', productRoutes);
app.use('/api/users', userRoutes);
 
// ThinkCode provides suggestions for error handling
app.use((err, req, res, next) => {
  console.error(err.stack);
  res.status(500).json({
    message: 'Something went wrong!',
    error: process.env.NODE_ENV === 'production' ? {} : err
  });
});
 
// Connect to MongoDB
mongoose.connect(process.env.MONGODB_URI)
  .then(() => {
    console.log('Connected to MongoDB');
    app.listen(PORT, () => {
      console.log(`Server running on port ${PORT}`);
    });
  })
  .catch(err => {
    console.error('Failed to connect to MongoDB', err);
    process.exit(1);
  });

Database Integration

ThinkCode offers robust database integration:

  • SQL Support:

    • Syntax highlighting and validation
    • Schema visualization
    • Query completion
  • ORM Support:

    • Prisma, Sequelize, TypeORM intelligence
    • Schema navigation
    • Relationship visualization
  • NoSQL Integration:

    • MongoDB query completion
    • Document structure suggestions
    • Aggregation pipeline assistance

Example of Prisma schema with intelligent assistance:

// ThinkCode provides intelligent assistance for Prisma
datasource db {
  provider = "postgresql"
  url      = env("DATABASE_URL")
}
 
generator client {
  provider = "prisma-client-js"
}
 
// ThinkCode offers schema validation and suggestions
model User {
  id        String   @id @default(uuid())
  email     String   @unique
  name      String?
  password  String
  role      Role     @default(USER)
  posts     Post[]
  profile   Profile?
  createdAt DateTime @default(now())
  updatedAt DateTime @updatedAt
}
 
model Post {
  id        String   @id @default(uuid())
  title     String
  content   String?
  published Boolean  @default(false)
  author    User     @relation(fields: [authorId], references: [id])
  authorId  String
  tags      Tag[]
  createdAt DateTime @default(now())
  updatedAt DateTime @updatedAt
}
 
model Profile {
  id     String @id @default(uuid())
  bio    String?
  avatar String?
  user   User   @relation(fields: [userId], references: [id])
  userId String @unique
}
 
model Tag {
  id    String @id @default(uuid())
  name  String @unique
  posts Post[]
}
 
enum Role {
  USER
  ADMIN
}

Full-stack Frameworks

Next.js Support

ThinkCode provides comprehensive support for Next.js:

  • App Router Intelligence:

    • Route detection and navigation
    • Server components vs. client components
    • Data fetching method suggestions
    • Middleware completion
  • Project Structure:

    • Specialized view for Next.js projects
    • Page and API route navigation
    • Component hierarchy visualization
  • Build and Deployment:

    • Integrated build tools
    • Vercel deployment support
    • Performance analysis

Example of Next.js App Router page with intelligent assistance:

// ThinkCode provides intelligent assistance for Next.js
import { Suspense } from 'react';
import { notFound } from 'next/navigation';
import { ProductDetails } from '@/components/ProductDetails';
import { RelatedProducts } from '@/components/RelatedProducts';
import { getProductBySlug, getRelatedProducts } from '@/lib/products';
import type { Metadata } from 'next';
 
// ThinkCode offers specialized Next.js features like generateMetadata
export async function generateMetadata({ 
  params 
}: { 
  params: { slug: string }
}): Promise<Metadata> {
  const product = await getProductBySlug(params.slug);
  
  if (!product) {
    return {
      title: 'Product Not Found',
      description: 'The requested product could not be found.'
    };
  }
  
  return {
    title: product.name,
    description: product.description,
    openGraph: {
      images: [{ url: product.image }]
    }
  };
}
 
export default async function ProductPage({ 
  params 
}: { 
  params: { slug: string } 
}) {
  const product = await getProductBySlug(params.slug);
  
  if (!product) {
    notFound();
  }
  
  // ThinkCode provides suggestions for parallel data fetching
  const relatedProductsPromise = getRelatedProducts(product.category, product.id);
  
  return (
    <main className="container mx-auto py-8">
      <ProductDetails product={product} />
      
      <Suspense fallback={<div>Loading related products...</div>}>
        <RelatedProductsSection promise={relatedProductsPromise} />
      </Suspense>
    </main>
  );
}
 
// ThinkCode understands and provides suggestions for Suspense components
async function RelatedProductsSection({ promise }: { promise: Promise<any> }) {
  const relatedProducts = await promise;
  
  return <RelatedProducts products={relatedProducts} />;
}

Other Framework Support

ThinkCode supports various other full-stack frameworks:

  • Nuxt.js:

    • Vue.js integration
    • Pages and layouts
    • Modules and plugins
  • SvelteKit:

    • Svelte component intelligence
    • Routing and endpoints
    • Server-side rendering
  • Remix:

    • Route module intelligence
    • Loader and action functions
    • Route navigation

Web Development Tools

Browser Integration

ThinkCode integrates with web browsers for testing and debugging:

  • Live Preview:

    • Real-time preview of web pages
    • Multi-browser testing
    • Responsive design view
  • Browser Developer Tools:

    • Chrome DevTools integration
    • Element inspection
    • Network monitoring
  • Browser Debugging:

    • JavaScript debugging
    • DOM breakpoints
    • Network request inspection

Testing Tools

Comprehensive testing support for web applications:

  • Unit Testing:

    • Jest, Vitest, Mocha integration
    • Test runner and explorer
    • Coverage reporting
  • Component Testing:

    • React Testing Library
    • Vue Test Utils
    • Svelte Testing Library
  • E2E Testing:

    • Playwright integration
    • Cypress support
    • Test recorder and playback

Example of a Jest test with intelligent assistance:

// ThinkCode provides intelligent assistance for Jest
import { render, screen, fireEvent } from '@testing-library/react';
import { ProductCard } from './ProductCard';
 
// ThinkCode offers test template suggestions
describe('ProductCard component', () => {
  const mockProduct = {
    id: '1',
    name: 'Test Product',
    description: 'This is a test product',
    price: 99.99,
    image: '/test-product.jpg',
    slug: 'test-product'
  };
  
  const mockAddToCart = jest.fn();
  
  beforeEach(() => {
    jest.clearAllMocks();
  });
  
  test('renders product information correctly', () => {
    render(<ProductCard product={mockProduct} onAddToCart={mockAddToCart} />);
    
    expect(screen.getByText('Test Product')).toBeInTheDocument();
    expect(screen.getByText('This is a test product')).toBeInTheDocument();
    expect(screen.getByText('$99.99')).toBeInTheDocument();
    expect(screen.getByAltText('Test Product')).toHaveAttribute('src', '/test-product.jpg');
  });
  
  test('calls onAddToCart when Add to Cart button is clicked', () => {
    render(<ProductCard product={mockProduct} onAddToCart={mockAddToCart} />);
    
    fireEvent.click(screen.getByText('Add to Cart'));
    
    expect(mockAddToCart).toHaveBeenCalledTimes(1);
    expect(mockAddToCart).toHaveBeenCalledWith(mockProduct);
    
    // Button text should change after clicking
    expect(screen.getByText('In Cart')).toBeInTheDocument();
  });
  
  test('navigates to product details when View Details button is clicked', () => {
    const mockRouter = { push: jest.fn() };
    jest.mock('next/router', () => ({
      useRouter: () => mockRouter
    }));
    
    render(<ProductCard product={mockProduct} onAddToCart={mockAddToCart} />);
    
    fireEvent.click(screen.getByText('View Details'));
    
    expect(mockRouter.push).toHaveBeenCalledWith('/products/test-product');
  });
});

Build and Deployment

ThinkCode supports modern build and deployment workflows:

  • Build Tools:

    • Webpack, Rollup, Vite integration
    • Configuration assistance
    • Bundle analysis
  • Deployment Services:

    • Vercel, Netlify, GitHub Pages integration
    • Deployment configuration
    • Environment management
  • CI/CD Integration:

    • GitHub Actions
    • CircleCI
    • Jenkins

AI-Powered Web Development

Code Generation

Generate web components and functionality with AI:

  1. Component Generation:

    • Add a comment describing component purpose
    • Press Alt+I / Option+I for AI implementation

    Example:

    // Generate a responsive navigation bar with mobile menu toggle
    // Press Alt+I here and ThinkCode generates the implementation
    function Navbar({ links, logo, theme = 'light' }) {
      const [isMenuOpen, setIsMenuOpen] = useState(false);
      
      const toggleMenu = () => {
        setIsMenuOpen(!isMenuOpen);
      };
      
      return (
        <nav className={`navbar navbar-${theme}`}>
          <div className="navbar-container">
            <div className="navbar-logo">
              <img src={logo} alt="Logo" />
            </div>
            
            <button className="navbar-toggle" onClick={toggleMenu} aria-label="Toggle menu">
              <span className="toggle-bar"></span>
              <span className="toggle-bar"></span>
              <span className="toggle-bar"></span>
            </button>
            
            <ul className={`navbar-menu ${isMenuOpen ? 'active' : ''}`}>
              {links.map((link) => (
                <li key={link.url} className="navbar-item">
                  <a href={link.url} className="navbar-link">
                    {link.text}
                  </a>
                </li>
              ))}
            </ul>
          </div>
        </nav>
      );
    }
  2. CSS Generation:

    • Describe the styling needs in a comment
    • ThinkCode generates CSS or CSS-in-JS code
  3. API Route Generation:

    • Describe API endpoint functionality
    • ThinkCode generates backend route code

UI Pattern Recognition

ThinkCode recognizes common UI patterns and offers intelligent assistance:

  • Component Patterns:

    • Forms with validation
    • Data tables with sorting and filtering
    • Navigation menus
    • Modal dialogs
  • Layout Patterns:

    • Responsive grid layouts
    • Card layouts
    • Hero sections
    • Sidebar layouts

Web Accessibility

AI-powered accessibility improvements:

  • Accessibility Checking:

    • WCAG compliance checking
    • Color contrast analysis
    • Keyboard navigation verification
  • Accessibility Suggestions:

    • Automatic fixes for common issues
    • Semantic HTML recommendations
    • ARIA attribute suggestions

Performance Optimization

Frontend Performance

Tools for optimizing frontend performance:

  • Performance Analysis:

    • Core Web Vitals measurement
    • Lighthouse integration
    • Bundle size analysis
  • Optimization Suggestions:

    • Image optimization
    • Code splitting recommendations
    • Render performance improvements
  • Runtime Performance:

    • Identify expensive operations
    • Detect memory leaks
    • Optimize rendering cycles

Backend Performance

Tools for optimizing backend performance:

  • API Performance:

    • Response time analysis
    • Database query optimization
    • Caching recommendations
  • Server Monitoring:

    • Resource usage tracking
    • Request throughput analysis
    • Error rate monitoring

Customization

Extension Points

Extend ThinkCode's web development capabilities:

  • Custom Snippets: Create reusable code snippets
  • Project Templates: Define custom project templates
  • Build Tasks: Configure custom build workflows
  • Linting Rules: Set up custom linting rules

Configuration Options

Comprehensive configuration for web development:

{
  "thinkcode.web": {
    "preview": {
      "defaultBrowser": "chrome",
      "serverOptions": {
        "port": 3000,
        "https": false
      },
      "refreshMode": "live" // Options: "live", "on-save", "manual"
    },
    "formatting": {
      "html": {
        "wrapLineLength": 120,
        "formatOnSave": true
      },
      "css": {
        "preferSingleQuote": false,
        "formatOnSave": true
      },
      "javascript": {
        "semi": true,
        "singleQuote": true,
        "tabWidth": 2,
        "formatOnSave": true
      }
    },
    "linting": {
      "html": true,
      "css": true,
      "javascript": true,
      "accessibility": true
    },
    "frameworks": {
      "react": {
        "emmetCompletions": true,
        "componentCasing": "PascalCase"
      },
      "vue": {
        "vueVersion": 3,
        "formatScriptOnSave": true
      },
      "tailwind": {
        "cssVarsIntelliSense": true,
        "hovers": true
      }
    }
  }
}

Resources and Learning

Learning Paths

Integrated learning resources:

  • Web Development Tutorials: Learn modern web concepts
  • Framework Guides: Framework-specific learning paths
  • Interactive Challenges: Practice with coding exercises
  • Sample Projects: Explore and learn from example projects

Access learning resources:

  1. Command Palette
  2. Type "ThinkCode: Open Learning Hub"
  3. Select Web Development category

Community Integration

Connect with the web development community:

  • Documentation: Access web technology documentation inline
  • Stack Overflow: Search solutions directly from ThinkCode
  • GitHub: Find example implementations
  • Community Templates: Access community-created project templates

Further Information