System Requirements
Software Prerequisites
- Node.js: v16.x or higher (v18.x recommended)
- MySQL: v5.7 or higher (v8.0 recommended)
- npm: v7.x or higher (comes with Node.js)
- Git: For version control
Hardware Requirements
- Minimum: 2GB RAM, 2 CPU cores, 10GB disk space
- Recommended: 4GB RAM, 4 CPU cores, 20GB disk space
Development Installation
Verify Node.js Installation
Install Dependencies
Install all required packages defined in This installs the following core dependencies:
package.json:package.json
Set Up Environment Variables
Create a
.env file in the project root directory:.env
Environment Variables Explained
| Variable | Description | Default |
|---|---|---|
PORT | HTTP server port | 4001 |
DB_HOST | MySQL server hostname | localhost |
DB_PORT | MySQL server port | 3306 |
DB_USER | MySQL username | root |
DB_PASS | MySQL password | (empty) |
DB_DATABASE | Database name | vlifedgo_db |
SUPER_KEY | Encryption key for sensitive data | key_cecc |
Create Required Directories
The application uses a directory for file uploads. Create it:
This directory is automatically excluded from Git via
.gitignore to prevent committing uploaded files.Production Installation
Using PM2 Process Manager
For production environments, use PM2 to manage the Node.js process:Using Nginx as Reverse Proxy
Configure Nginx to proxy requests to vLife DGO:Database Connection
The application uses MySQL2 connection pooling for optimal performance. Here’s how it’s configured:src/database/Connection.js
Application Structure
After installation, your application structure will be:Troubleshooting
Database Connection Errors
Database Connection Errors
Error: If successful, update your
Error:
ER_ACCESS_DENIED_ERRORSolution: Verify your MySQL credentials:.env file with the correct credentials.Error:
ECONNREFUSEDSolution: Ensure MySQL is running:Port Already in Use
Port Already in Use
Error: Or find and kill the process using port 4001:
EADDRINUSE: address already in use :::4001Solution: Either change the port in .env:.env
File Upload Issues
File Upload Issues
Error: Files not uploading or directory errorsSolution: Ensure the uploads directory exists with proper permissions:The application is configured to accept files up to 20MB:
src/app.js
Puppeteer Installation Issues
Puppeteer Installation Issues
Error: Chromium download fails during
npm installSolution: Install Chromium dependencies:Session Issues
Session Issues
Problem: Users getting logged out frequentlySolution: The application uses memory-based sessions. For production, consider using MySQL session store:
Verifying Installation
Test that all components are working:Check Database Connection
The application will log any database connection errors to the console. If you see:Without any errors, the database connection is successful.
Security Considerations
Next Steps
Now that vLife DGO is installed:- Review Environment Configuration for advanced settings
- Explore the Authentication API to understand available endpoints
- Learn about Evaluation Types and system design
- Review Database Configuration and connection setup