-
Notifications
You must be signed in to change notification settings - Fork 0
SETUP
Complete setup instructions for NEXUS Support System.
- System Requirements
- Installation
- Configuration
- Database Setup
- GitHub Integration Setup
- Running the Application
- Verification
- Troubleshooting
- CPU: 1 core
- RAM: 2GB
- Storage: 20GB
- OS: Linux, macOS, or Windows
- Node.js: Version 14.0.0 or higher
- npm: Version 6.0.0 or higher
- MongoDB: Version 4.4 or higher
- Git: Version 2.0 or higher (optional)
- CPU: 2+ cores
- RAM: 4GB+
- Storage: 50GB+
- MongoDB: Version 6.0+
git clone <repository-url>
cd nexus- Download the latest release from GitHub
- Extract the archive
- Navigate to the extracted directory
npm installThis installs all required packages:
- express, mongoose, dotenv, cors, axios
- helmet, express-rate-limit
- jsonwebtoken, bcryptjs
- nodemon (development)
npm listEnsure all dependencies are installed without errors.
cp .env.example .envEdit .env with your configuration:
# Server
PORT=3000
NODE_ENV=development
# CORS Configuration (optional - restrict to specific domains in production)
CORS_ORIGIN=*
# Database
MONGODB_URI=mongodb://localhost:27017/nexus-support
# MongoDB SSL/TLS Configuration (optional - for production)
MONGODB_SSL=false
MONGODB_TLS=false
MONGODB_TLS_ALLOW_INVALID_CERTS=false
MONGODB_TLS_CA_FILE=
MONGODB_TLS_CERT_KEY_FILE=
MONGODB_TLS_CERT_KEY_PASSWORD=
# JWT Secret (required)
JWT_SECRET=<generate-secure-random-string>Generate JWT Secret:
# Linux/macOS
openssl rand -hex 64
# Windows PowerShell
-join ((48..57) + (65..90) + (97..122) | Get-Random -Count 64 | % {[char]$_})GitHub Integration (optional):
GITHUB_WEBHOOK_SECRET=<generate-secure-random-string>
GITHUB_TOKEN=<github-personal-access-token>
GITHUB_REPO_OWNER=<your-github-username>
GITHUB_REPO_NAME=<your-repository-name>Ubuntu/Debian:
wget -qO - https://www.mongodb.org/static/pgp/server-6.0.asc | sudo apt-key add -
echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/6.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-6.0.list
sudo apt update
sudo apt install -y mongodb-orgmacOS:
brew tap mongodb/brew
brew install mongodb-communityWindows: Download from mongodb.com
# Linux/macOS
mongod --dbpath /path/to/data/directory
# Or use service
sudo systemctl start mongod # Linux
brew services start mongodb-community # macOSmongo
> show dbs- Create account at mongodb.com/cloud/atlas
- Create a free cluster (M0 tier)
- Create database user
- Whitelist IP address (0.0.0.0/0 for all)
- Get connection string
- Update
.env:
MONGODB_URI=mongodb+srv://username:password@cluster.mongodb.net/nexus-support?retryWrites=true&w=majoritydocker run -d -p 27017:27017 --name mongodb mongo:6.0Update .env:
MONGODB_URI=mongodb://localhost:27017/githhbb-support- Go to GitHub Settings → Developer settings → Personal access tokens
- Click "Generate new token" (classic)
- Select scopes:
-
repo- Full control of private repositories -
issues- Read and write issues
-
- Generate and copy the token
- Add to
.envasGITHUB_TOKEN
# Linux/macOS
openssl rand -hex 32
# Windows PowerShell
-join ((48..57) + (65..90) + (97..122) | Get-Random -Count 32 | % {[char]$_})Add to .env as GITHUB_WEBHOOK_SECRET
GITHUB_REPO_OWNER=your-username
GITHUB_REPO_NAME=your-repository-name- Go to your GitHub repository
- 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: Your
GITHUB_WEBHOOK_SECRET - Events: "Issues" and "Issue comments"
-
Payload URL:
- Click "Add webhook"
For local testing with ngrok:
# Install ngrok
brew install ngrok # macOS
snap install ngrok # Linux
# Start ngrok
ngrok http 3000
# Use the ngrok URL for GitHub webhookAuto-restart on file changes:
npm run devnpm startOr with environment variable:
NODE_ENV=production npm start# Install PM2
npm install -g pm2
# Start application
pm2 start server.js --name githhb-uupportb-support
# View logs
pm2 logs githhb-uupportb-support
# Restart
pm2 restart nexus
# Stop
pm2 stop nexus
# Configure to start on boot
pm2 startup
pm2 savecurl http://localhost:3000/api/healthExpected response:
{
"status": "ok",
"timestamp": "2024-01-01T00:00:00.000Z"
}Open browser: http://localhost:3000
Via web interface or API:
curl -X POST http://localhost:3000/api/tickets \
-H "Content-Type: application/json" \
-d '{
"title": "Setup Test",
"description": "Testing the system",
"createdBy": "Test User",
"createdByEmail": "test@example.com"
}'mongo
> use nexus-support
> show collections
> db.tickets.find()Create a GitHub issue and verify it creates a ticket, or sync a ticket to GitHub.
Error: "MongoNetworkError"
Solutions:
- Verify MongoDB is running
- Check MONGODB_URI in
.env - Ensure MongoDB port (27017) is accessible
- Check firewall settings
Error: "EADDRINUSE: address already in use :::3000"
Solutions:
- Change PORT in
.env - Kill process using port 3000:
lsof -i :3000 kill -9 <PID>
Solutions:
- Clear npm cache:
npm cache clean --force - Delete node_modules and package-lock.json
- Run
npm installagain - Try with different Node.js version
Solutions:
- Verify webhook URL is publicly accessible
- Use ngrok for local testing
- Check webhook secret matches
- Review GitHub webhook delivery logs
- Check server logs
Solutions:
- Verify JWT_SECRET is set in
.env - Check token format:
Bearer <token> - Verify token hasn't expired (7 days)
For more issues, see Troubleshooting Guide.
- Change all secrets from default values
- Use strong, random secrets for JWT and webhook
- Enable HTTPS with SSL/TLS
- Restrict CORS to specific origins
- Enable rate limiting (already configured)
- Use environment-specific configs
- Never commit
.envfile - Regular security updates for dependencies
Never commit .env to version control. Use .env.example as template.
- Enable MongoDB authentication
- Use strong passwords
- Restrict network access
- Use TLS/SSL for connections
- Regular backups
Add indexes for frequently queried fields:
// In models/Ticket.js
ticketSchema.index({ ticketId: 1 });
ticketSchema.index({ status: 1 });
ticketSchema.index({ priority: 1 });
ticketSchema.index({ createdAt: -1 });Configure MongoDB connection pool:
mongoose.connect(uri, {
maxPoolSize: 10,
minPoolSize: 5,
socketTimeoutMS: 45000,
serverSelectionTimeoutMS: 5000
});Consider implementing caching for:
- User sessions
- Ticket lists
- GitHub repository info
After successful NEXUS setup:
- Configure GitHub Integration
- Review NEXUS API Documentation
- Set up Systemd Service
- Configure Monitoring
- Deploy to production with NEXUS Deployment Guide
- Installation Guide - Detailed installation instructions
- Developer Guide - For developers
- API Documentation - Complete API reference
- Deployment Guide - Production deployment
- Troubleshooting Guide - Common issues and solutions
- FAQ - Frequently asked questions