Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
22.16.0
35 changes: 34 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,43 @@ graph TD
- Lucide React (for icons)

## Installation

### Prerequisites
This project uses Node Version Manager (nvm) to manage Node.js versions. Make sure you have nvm installed globally.

#### Installing nvm (if not already installed)
```bash
# Install nvm
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash

# Reload your shell configuration
source ~/.bashrc

# Verify nvm installation
nvm --version
```

### Project Setup
1. Clone the repository
2. Run `npm install` to install dependencies
2. **Quick Setup (Recommended)**: Run the setup script which handles nvm and dependencies:
```bash
./setup.sh
```

**OR Manual Setup**:
- Use the correct Node.js version specified in `.nvmrc`:
```bash
nvm use
```
If the Node.js version isn't installed, nvm will prompt you to install it:
```bash
nvm install
```
- Run `npm install` to install dependencies
3. Start the development server with `npm run dev`

**Note**: The project includes a `.nvmrc` file that specifies the required Node.js version (22.16.0). Always run `nvm use` when switching to this project to ensure you're using the correct Node.js version.

## Available Scripts
- `dev`: Start development server
- `build`: Build for production
Expand Down
1 change: 1 addition & 0 deletions client/.nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
22.16.0
1 change: 1 addition & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"server"
],
"scripts": {
"preinstall": "echo 'Make sure to run \"nvm use\" before installing dependencies'",
"dev": "concurrently \"npm run server:dev\" \"npm run client:dev\"",
"client:dev": "cd client && vite",
"server:dev": "cd server && tsx watch src/server.ts",
Expand Down
1 change: 1 addition & 0 deletions server/.nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
22.16.0
46 changes: 46 additions & 0 deletions setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#!/bin/bash
set -e

# MCP Agents Hub - Environment Setup Script
# This script ensures the correct Node.js version is being used via nvm

echo "🚀 Setting up MCP Agents Hub development environment..."

# Source nvm (in case it's not in the current shell)
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"

# Check if nvm is available
if ! type nvm &> /dev/null; then
echo "❌ nvm is not installed or not sourced. Please install nvm first:"
echo " curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash"
echo " source ~/.bashrc"
exit 1
fi

# Use the Node.js version specified in .nvmrc
if [ -f ".nvmrc" ]; then
echo "📋 Found .nvmrc file, using specified Node.js version..."
nvm use
if [ $? -ne 0 ]; then
echo "⚠️ Node.js version not installed. Installing now..."
nvm install
nvm use
fi
else
echo "⚠️ No .nvmrc file found, using default Node.js version"
fi

# Display current versions
echo "✅ Node.js version: $(node --version)"
echo "✅ npm version: $(npm --version)"

# Install dependencies
echo "📦 Installing dependencies..."
npm ci

echo "🎉 Setup complete! You can now run:"
echo " npm run dev (start development server)"
echo " npm run build (build for production)"
echo " npm run lint (run linting)"