Forking for research
Go to file
2025-07-24 12:37:07 +05:30
__pycache__ dev-backup 2025-06-09 11:11:52 +05:30
docs dev-backup 2025-06-09 11:11:52 +05:30
public/images dev-backup 2025-06-09 11:11:52 +05:30
scripts dev-backup 2025-06-09 11:11:52 +05:30
src views per user 2025-07-24 12:37:07 +05:30
tests dev-backup 2025-06-09 11:11:52 +05:30
.DS_Store dev-backup 2025-06-09 11:11:52 +05:30
.env.example doc views by user 2025-07-23 19:41:42 +05:30
.gitignore deleted certificates folders, automation test 2025-06-09 19:24:02 +05:30
CHANGES.md dev-backup 2025-06-09 11:11:52 +05:30
chat.py dev-synv 2025-07-15 11:30:19 +05:30
checklist.txt doc views by user 2025-07-23 19:41:42 +05:30
Jenkinsfile Jnkinsfile, automation test trial2 2025-06-09 20:06:28 +05:30
model_manager.py dev-backup 2025-06-09 11:11:52 +05:30
nodemon.json dev-backup 2025-06-09 11:11:52 +05:30
package-lock.json dev-synv 2025-07-15 11:30:19 +05:30
package.json dev-synv 2025-07-15 11:30:19 +05:30
readme.md doc views by user 2025-07-23 19:41:42 +05:30
requirements.txt dev-backup 2025-06-09 11:11:52 +05:30

SpurrinAI Backend

A Node.js backend application for SpurrinAI platform.

Project Structure

project-root/
├── src/                    
│   ├── app.js              # App entry point
│   ├── config/             # Configuration files
│   ├── controllers/        # Route controllers with business logic
│   ├── middleware/         # Custom middleware
│   ├── migrations/         # Database migrations
│   ├── routes/             # Route definitions
│   ├── services/           # Business logic
│   └── utils/              # Utility functions
├── docs/                   # Documentation
├── logs/                   # Application logs
├── scripts/                # Build and setup scripts
├── tests/                  # Test files
└── uploads/                # User uploads

Prerequisites

  • Node.js >= 14.0.0
  • MySQL >= 5.7
  • npm >= 6.0.0

Installation

  1. Clone the repository:
git clone git_repository_url
cd spurrinai-backend (or respected folder )
  1. Install dependencies:
npm install
  1. Set up environment variables:
cp .env.example .env
# Edit .env with your configuration
  1. Run the setup script:
npm run setup

Development Mode

  1. Start the development server with hot-reload:
npm run dev

Run migrations up

npm run migrate:up

Production Mode

  1. Build the application:
npm run build
  1. Start the production server:
npm start
  1. For production deployment, ensure:
    • Set NODE_ENV=production in .env
    • Configure proper database credentials
    • Set up SSL/TLS certificates
    • Configure proper logging
    • Set up process manager (PM2 recommended)
  1. Install PM2 globally:
npm install -g pm2
  1. Start the application with PM2:
pm2 start src/app.js --name spurrinai-backend
  1. Other useful PM2 commands:
# Monitor application
pm2 monit

# View logs
pm2 logs spurrinai-backend

# Restart application
pm2 restart spurrinai-backend

# Stop application
pm2 stop spurrinai-backend

# Flush logs
pm2 flush

# Delete all logs
pm2 flush spurrinai-backend

# Reload application with zero downtime
pm2 reload spurrinai-backend

Database Migrations

# Create new migration
npm run migrate:create

# Run all migrations
npm run migrate

# Run migrations up
npm run migrate:up

# Run migrations down
npm run migrate:down

Support

For support, please contact:

License

UNLICENSED - All rights reserved by Tech4biz Solutions