Installation - RumenDamyanov/js-chess GitHub Wiki

Installation Guide

Complete setup instructions for the JS Chess Framework Showcase.

Prerequisites

Optional Requirements

Quick Installation

1. Clone the Repository

git clone https://github.com/RumenDamyanov/js-chess.git
cd js-chess

2. Install Dependencies

# Install all project dependencies
npm install

# Verify installation
npm run build

3. Start Development

# Start the development server
npm start

# Open http://localhost:4200 in your browser

Framework-Specific Setup

Angular (Default)

cd angular-chess
npm install
npm start

React

cd react-chess
npm install
npm start

Vue.js

cd vue-chess
npm install
npm run dev

Vanilla JavaScript

cd vanilla-chess
# No build step required
# Open index.html in browser or use live server

jQuery

cd jquery-chess
# No build step required
# Open index.html in browser or use live server

Backend Setup (Optional)

The chess logic backend provides AI opponents and game validation.

Local Go Backend

# Clone the backend repository
git clone https://github.com/RumenDamyanov/go-chess.git
cd go-chess

# Install dependencies
go mod download

# Run the server
go run main.go

Docker Backend

# Start backend with Docker
docker run -p 8080:8080 rumendamyanov/go-chess:latest

Verification

Test Your Installation

# Run all tests
npm test

# Build all frameworks
npm run build:all

# Check linting
npm run lint

Expected Output

  • Angular app: http://localhost:4200
  • React app: http://localhost:3000
  • Vue app: http://localhost:5173
  • API server: http://localhost:8080

Common Issues

Node.js Version Issues

# Check your Node.js version
node --version

# Update if needed (using nvm)
nvm install 18
nvm use 18

Port Conflicts

# If ports are in use, specify different ones:
npm start -- --port 4201

Permission Issues (macOS/Linux)

# Fix npm permissions
sudo chown -R $(whoami) ~/.npm

Windows-Specific Issues

# Enable execution policy for PowerShell
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser

IDE Setup

VS Code (Recommended)

  1. Install recommended extensions:

    • Angular Language Service
    • ES7+ React/Redux/React-Native snippets
    • Vue Language Features (Volar)
    • Go extension
  2. Open workspace settings:

    {
      "typescript.preferences.importModuleSpecifier": "relative",
      "editor.formatOnSave": true,
      "editor.codeActionsOnSave": {
        "source.fixAll.eslint": true
      }
    }
    

JetBrains IDEs

  • WebStorm: Built-in support for all frameworks
  • IntelliJ IDEA: Install JavaScript and Go plugins

Environment Configuration

Development Environment

# Copy environment template
cp .env.example .env

# Edit configuration
CHESS_API_URL=http://localhost:8080
NODE_ENV=development

Production Environment

# Set production variables
export NODE_ENV=production
export CHESS_API_URL=https://your-api-domain.com

Next Steps

  1. Quick Start: Follow the Quick Start Guide for a 5-minute setup
  2. Project Structure: Understand the codebase with Project Structure
  3. Choose Framework: Pick your preferred framework guide:

Support


Need help? Check the Troubleshooting Guide or open an issue on GitHub.