Skip to content

lucasqdn/windows-xd

Repository files navigation

windows-xd

A pixel-perfect recreation of Windows 98 on the web with modern features including real-time multiplayer chat and an AI-powered Clippy assistant.

Features

  • πŸ–₯️ Authentic Windows 98 UI: Pixel-perfect recreation with functional window management
  • πŸ’¬ Real-time Chat: Multiplayer chatroom powered by PartyKit WebSocket
  • πŸ€– AI Clippy: LLM-powered assistant using Google Gemini
  • 🎨 Draggable Windows: Fully functional window system with minimize, maximize, close
  • ⚑ Built with Next.js 16: Modern React framework with App Router

Quick Setup (Recommended)

Prerequisites

  • Node.js: v22.14.0 or later (Download)
  • npm: Comes with Node.js
  • Git: For cloning the repository

Automated Setup

Run the setup script to automatically install all dependencies:

# Clone the repository
git clone <your-repo-url>
cd windows-xd

# Run the automated setup script
./setup.sh

The script will:

  • βœ… Check your Node.js version
  • βœ… Install all npm dependencies using npm ci (ensures exact versions)
  • βœ… Create .env.local from template
  • βœ… Verify everything is ready to run

Manual Setup

If you prefer to set up manually:

# 1. Use the correct Node.js version (if using nvm)
nvm use

# 2. Install dependencies (use 'npm ci' to ensure exact versions)
npm ci

# 3. Create environment file
cp .env.example .env.local

# 4. (Optional) Add your Gemini API key to .env.local for Clippy feature
# Get your key from: https://aistudio.google.com/app/apikey

Running the Project

Development Server

npm run dev

Open http://localhost:3000 in your browser.

Deploying to Production

For production deployment instructions, see the deployment documentation.

Key deployment guides:

Production Build

npm run build    # Build for production
npm start        # Start production server

Linting

npm run lint     # Run ESLint

Important: Keeping Dependencies in Sync

This project uses package-lock.json to lock dependency versions.

For New Team Members

Always use npm ci instead of npm install when setting up the project:

npm ci           # βœ… Installs exact versions from package-lock.json
npm install      # ❌ May install different versions

When Adding New Dependencies

# Install and save to package.json
npm install <package-name>

# Commit BOTH files
git add package.json package-lock.json
git commit -m "feat: add <package-name> dependency"

After Pulling Latest Changes

If someone added new dependencies:

git pull
npm ci           # Reinstall from updated package-lock.json

Pro Tip: The setup.sh script automatically uses npm ci to ensure consistency.

Project Structure

windows-xd/
β”œβ”€β”€ app/
β”‚   β”œβ”€β”€ components/       # React components
β”‚   β”‚   β”œβ”€β”€ apps/         # Application windows (Notepad, Paint, Chat, etc.)
β”‚   β”‚   └── ...
β”‚   β”œβ”€β”€ hooks/            # Custom React hooks
β”‚   β”œβ”€β”€ types/            # TypeScript type definitions
β”‚   β”œβ”€β”€ layout.tsx        # Root layout
β”‚   └── page.tsx          # Main page
β”œβ”€β”€ party/                # PartyKit WebSocket server
β”œβ”€β”€ docs/                 # Documentation
β”‚   β”œβ”€β”€ deployment/       # Deployment guides
β”‚   └── development/      # Development docs
β”œβ”€β”€ .planning/            # Project planning and documentation
β”œβ”€β”€ .nvmrc                # Node.js version lock
β”œβ”€β”€ setup.sh              # Automated setup script
└── package.json          # Dependencies and scripts

Tech Stack

  • Framework: Next.js 16.1.6 (App Router)
  • Language: TypeScript 5 (strict mode)
  • Styling: Tailwind CSS 4
  • State Management: React Context API
  • Real-time: PartyKit (WebSocket)
  • AI: Google Gemini API
  • Window Management: react-rnd

Development Workflow

See CONTRIBUTING.md for detailed development guidelines.

Troubleshooting

"Module not found" errors

# Reinstall dependencies with exact versions
rm -rf node_modules package-lock.json
npm install

Port 3000 already in use

# Kill the process using port 3000
lsof -i :3000
kill -9 <PID>

TypeScript errors

# Check for type errors
npx tsc --noEmit

License

[Your License Here]

Contributing

Contributions are welcome! Please read CONTRIBUTING.md first.

About

A revamp of an old windows version on a website, BUT, with a twist

Resources

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors