-
Notifications
You must be signed in to change notification settings - Fork 0
INSTALLATION
This guide provides step-by-step instructions for installing and setting up NEXUS Support System.
- Linux Installer - Linux/macOS installation script
- Windows Installer - Windows PowerShell installer
- Node.js Installer - Cross-platform installer
- Environment Example - Environment variables template
- Package Configuration - Dependencies and scripts
- Docker Configuration - Container setup
- Database Config - Database configuration
- MongoDB Setup - MongoDB connection
- Quick Start (Automated Installer)
- Prerequisites
- Manual Installation Steps
- Configuration
- Running the Application
- Verification
- Common Installation Issues
NEXUS includes automated installation scripts that handle the entire setup process automatically:
chmod +x install.sh
./install.shThe Linux/macOS installer will:
- Detect your operating system and distribution
- Install Node.js automatically
- Install MongoDB automatically
- Configure MongoDB as a service
- Generate secure secrets
- Create
.envfile - Start MongoDB service
- Run health checks
# Run as Administrator
.\install.ps1The Windows installer will:
- Check for administrator privileges
- Install Node.js via MSI
- Install MongoDB via MSI
- Configure MongoDB as Windows service
- Generate secure secrets
- Create
.envfile - Start MongoDB service
- Run health checks
node install.jsThe cross-platform installer will:
- Detect your operating system
- Check for Node.js/npm
- Install npm dependencies
- Generate secure secrets
- Create
.envfile - Create MongoDB data directory
- Start MongoDB (platform-specific)
- Run health checks
docker-compose up -dThe Docker setup will:
- Pull MongoDB container
- Build application container
- Configure networking
- Set up volume persistence
- Start both services
- Configure health checks
For detailed automated installer documentation, see AUTOMATED_INSTALL.md.
Before installing the GitHub Support Ticket System, ensure you have the following installed:
-
Node.js: Version 14.0.0 or higher
- Download from nodejs.org
- Verify installation:
node --version
-
npm: Version 6.0.0 or higher (comes with Node.js)
- Verify installation:
npm --version
- Verify installation:
-
MongoDB: Version 4.4 or higher
- Download from mongodb.com
- For local development, you can use MongoDB Community Server
- Verify installation:
mongod --version
-
Git: For version control (if cloning from repository)
- Download from git-scm.com
- Verify installation:
git --version
-
Postman or similar API testing tool
- For testing API endpoints during development
If cloning from a Git repository:
git clone <repository-url>
cd nexusIf downloading as a zip file:
- Extract the archive
- Navigate to the extracted directory
Install all required Node.js packages:
npm installThis will install the following dependencies:
-
express- Web framework -
mongoose- MongoDB ODM -
dotenv- Environment variable management -
cors- Cross-origin resource sharing -
axios- HTTP client for GitHub API -
helmet- Security headers -
express-rate-limit- Rate limiting -
jsonwebtoken- JWT authentication -
bcryptjs- Password hashing
Development dependencies:
-
nodemon- Auto-restart server during development
Copy the example environment file:
cp .env.example .envEdit the .env file with your configuration:
# Server Configuration
PORT=3000
NODE_ENV=development
# MongoDB Configuration
MONGODB_URI=mongodb://localhost:27017/githubb-support
# GitHub Configuration
GITHUB_WEBHOOK_SECRET=your_webhook_secret_here
GITHUB_TOKEN=your_github_personal_access_token_here
GITHUB_REPO_OWNER=your_github_username
GITHUB_REPO_NAME=your_repository_name
# JWT Secret
JWT_SECRET=your_jwt_secret_here_change_this_in_productionStart MongoDB server (if not already running):
# On Linux/macOS
mongod --dbpath /path/to/your/data/directory
# On Windows
mongod --dbpath C:\path\to\your\data\directory
# Or use MongoDB service
sudo systemctl start mongod # Linux
brew services start mongodb-community # macOSVerify MongoDB is running:
mongo
# In MongoDB shell
> show dbsThe application will automatically create collections when you first run it. However, you can optionally create an admin user via API:
curl -X POST http://localhost:3000/api/users/register \
-H "Content-Type: application/json" \
-d '{
"username": "admin",
"email": "admin@example.com",
"password": "secure_password",
"role": "admin"
}'Local MongoDB:
MONGODB_URI=mongodb://localhost:27017/nexus-supportMongoDB Atlas (Cloud):
MONGODB_URI=mongodb+srv://username:password@cluster.mongodb.net/nexus-support?retryWrites=true&w=majorityMongoDB with Authentication:
MONGODB_URI=mongodb://username:password@localhost:27017/nexus-support?authSource=admin- Go to GitHub Settings → Developer settings → Personal access tokens
- Click "Generate new token" (classic)
- Select the following scopes:
-
repo- Full control of private repositories -
issues- Read and write issues
-
- Generate the token and copy it
- Add it to your
.envfile asGITHUB_TOKEN
- Navigate to your GitHub repository
- Go to Settings → Webhooks → Add webhook
- Configure:
-
Payload URL:
https://your-domain.com/api/github/webhook - For local testing, use ngrok:
https://your-ngrok-url.ngrok.io/api/github/webhook -
Content type:
application/json -
Secret: Use the value from
GITHUB_WEBHOOK_SECRETin.env - Events: Select "Issues" and "Issue comments"
-
Payload URL:
- Click "Add webhook"
Generate a secure random string for your webhook secret:
# On Linux/macOS
openssl rand -hex 32
# On Windows (PowerShell)
-join ((48..57) + (65..90) + (97..122) | Get-Random -Count 32 | % {[char]$_})Generate a secure JWT secret:
# On Linux/macOS
openssl rand -hex 64
# On Windows (PowerShell)
-join ((48..57) + (65..90) + (97..122) | Get-Random -Count 64 | % {[char]$_})Important: Use different secrets for development and production.
Run with auto-restart on file changes:
npm run devThis uses nodemon to automatically restart the server when files are modified.
Run in production mode:
npm startOr with Node.js directly:
NODE_ENV=production node server.jsFor production deployment with PM2:
# Install PM2 globally
npm install -g pm2
# Start the application
pm2 start server.js --name nexus
# View logs
pm2 logs nexus
# Restart
pm2 restart nexus
# Stop
pm2 stop nexuscurl http://localhost:3000/api/healthExpected response:
{
"status": "ok",
"timestamp": "2024-01-01T00:00:00.000Z"
}Open your browser and navigate to:
http://localhost:3000
You should see the GitHub Support Ticket System interface with the sci-fi theme.
Create a test ticket:
curl -X POST http://localhost:3000/api/tickets \
-H "Content-Type: application/json" \
-d '{
"title": "Test Ticket",
"description": "This is a test ticket",
"createdBy": "Test User",
"createdByEmail": "test@example.com"
}'Check if collections were created:
mongo
> use nexus-support
> show collectionsYou should see:
ticketsusers
Symptom: Error message "MongoDB Connected: undefined" or connection timeout
Solutions:
- Verify MongoDB is running:
mongod --version - Check MongoDB URI in
.envfile - Ensure MongoDB is accessible on the specified port (default: 27017)
- Check firewall settings
- For MongoDB Atlas, verify IP whitelist includes your IP address
Symptom: Error "EADDRINUSE: address already in use"
Solutions:
- Change the PORT in
.envfile - Kill the process using the port:
# Find process lsof -i :3000 # Kill process kill -9 <PID>
Symptom: Error "Cannot find module 'express'"
Solutions:
- Run
npm installto install dependencies - Delete
node_modulesandpackage-lock.json, then runnpm installagain - Verify Node.js version is compatible
Symptom: Webhooks not being received or processed
Solutions:
- Verify webhook URL is publicly accessible (use ngrok for local testing)
- Check webhook secret matches in both GitHub and
.env - Review GitHub webhook delivery logs in repository settings
- Check server logs for webhook processing errors
- Ensure webhook events are selected (Issues, Issue comments)
Symptom: Browser console shows CORS errors
Solutions:
- Verify CORS is configured in
server.js - Check allowed origins in CORS configuration
- For development, ensure frontend and backend are on same origin or CORS allows it
Symptom: Authentication fails with "Invalid token" error
Solutions:
- Verify JWT_SECRET is set in
.env - Ensure token is being sent in Authorization header:
Bearer <token> - Check token expiration (default: 7 days)
- Regenerate token if needed
After successful installation:
- Read the Developer Guide for development instructions
- Review the API Documentation for endpoint details
- Set up GitHub webhooks for issue synchronization
- Configure authentication and user roles
- Deploy to production using the Deployment Guide
- MongoDB Documentation
- Node.js Documentation
- Express.js Documentation
- GitHub Webhooks Documentation
- JWT Documentation
For installation issues not covered in this guide:
- Check the Troubleshooting Guide
- Review GitHub Issues
- Contact support team