
Research
/Security News
60 Malicious Ruby Gems Used in Targeted Credential Theft Campaign
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.
expressjs-vidlab-skeleton
Advanced tools
A modern, production-ready Express.js API skeleton with international standards, built-in validation, and comprehensive error handling
A modern, production-ready Express.js API skeleton with international standards, built-in validation, and comprehensive error handling.
Clone the repository
git clone git@github.com:appvidlab/expressjs-vidlab-skeleton.git
cd expressjs-vidlab-skeleton
Install dependencies
yarn install
Configure environment
cp .env.example .env
# Edit .env with your configurations
Start the server
# Development mode
yarn dev
# Production mode
yarn start
src/
βββ config/ # Configuration management
β βββ index.js # Centralized config with validation
βββ controllers/ # Request handlers
β βββ VersionController.js
βββ middleware/ # Custom middleware
β βββ logger.js # Request logging middleware
β βββ security.js # Security middleware collection
βββ repositories/ # Data access layer
β βββ VersionRepository.js
βββ routes/ # API routes
β βββ index.js # Route aggregator
β βββ VersionRoute.js # Version-specific routes
βββ traits/ # Reusable utilities
β βββ ResponseTrait.js # Standardized API responses
βββ utils/ # Common utility functions
β βββ index.js # Helper functions and utilities
βββ validators/ # Request validation
β βββ VersionValidator.js
βββ index.js # Application configuration
βββ server.js # Server startup and lifecycle
.vscode/ # VS Code workspace configuration
βββ settings.json # Editor settings and preferences
βββ tasks.json # Build and development tasks
βββ launch.json # Debug configurations
βββ extensions.json # Recommended extensions
βββ keybindings.json # Custom keyboard shortcuts
βββ api-schema.json # API request/response schemas
βββ javascript.json # JavaScript-specific settings
βββ expressjs-vidlab-skeleton.code-workspace # Workspace file
This project includes comprehensive VS Code configuration for optimal development experience:
π Note: The
.vscode/
folder is included in version control to ensure all team members have a consistent development environment. Personal settings can be overridden using.vscode/settings.local.json
(ignored by git).
To customize VS Code settings without affecting the team configuration:
.vscode/settings.local.example.json
to .vscode/settings.local.json
settings.local.json
.vscode/expressjs-vidlab-skeleton.code-workspace
Ctrl+Shift+D
to start development serverCtrl+Shift+T
to run testsF5
to debug the applicationPOST /api/version
- Get version information for specific instance (also serves as health check)GET /api/version/all
- Get version information for all instancesGET /api/version/health
- Comprehensive health check with system metricsGET /api/version/ping
- Simple ping/pong endpoint for availability checkGET /
- API information and available endpointsPOST /api/version
Content-Type: application/json
{
"instance": "production"
}
{
"success": true,
"status": 200,
"message": "Version retrieved successfully",
"data": {
"version": "1.0.0",
"instance": "production",
"timestamp": "2025-07-14T10:30:00.000Z",
"environment": "development"
},
"timestamp": "2025-07-14T10:30:00.000Z"
}
{
"success": true,
"status": 200,
"message": "Application is healthy",
"data": {
"status": "healthy",
"version": "1.0.0",
"response_time_ms": 5,
"timestamp": "2025-07-14T10:30:00.000Z",
"environment": "development",
"uptime": 3600.123,
"memory_usage": {
"rss": 52428800,
"heapTotal": 20971520,
"heapUsed": 18874368,
"external": 1879048
}
},
"timestamp": "2025-07-14T10:30:00.000Z"
}
All API responses follow a consistent format:
{
"success": true,
"status": 200,
"message": "Operation successful",
"data": { ... },
"timestamp": "2025-07-14T10:30:00.000Z"
}
{
"success": false,
"status": 400,
"message": "Error description",
"errors": [
{
"field": "fieldName",
"message": "Error message",
"value": "invalid-value"
}
],
"timestamp": "2025-07-14T10:30:00.000Z"
}
Key environment variables (see .env
for complete list):
# Server Configuration
PORT=3000
NODE_ENV=development
yarn start # Start production server
yarn dev # Start development server with nodemon
yarn test # Run tests once
yarn test:watch # Run tests in watch mode
yarn test:coverage # Run tests with coverage report
yarn test:ci # CI optimized test run
yarn health # Check server health status
yarn clean # Clean temporary files and logs
yarn lint # Run code linting (configure ESLint)
yarn format # Format code (configure Prettier)
yarn security # Run security audit (configure tools)
yarn docs # Generate documentation (configure JSDoc)
This project includes comprehensive testing with Jest and Supertest.
# Run all tests
yarn test
# Run tests in watch mode (for development)
yarn test:watch
# Run tests with coverage report
yarn test:coverage
# Run tests for CI/CD (with coverage and no watch)
yarn test:ci
test/
βββ setup.js # Global test configuration
βββ version.test.js # Original version endpoint tests
βββ enhanced-version.test.js # Enhanced version endpoint tests
βββ response-trait.test.js # ResponseTrait utility tests
βββ config.test.js # Configuration management tests
βββ utils.test.js # Utility functions tests
The project maintains high test coverage with the following achievements:
The project enforces minimum coverage thresholds:
// Example test case
it('should return version information with valid instance', async () => {
const response = await request(app)
.post('/api/version')
.send({ instance: 'production' })
.expect(200);
expect(response.body).toHaveProperty('success', true);
expect(response.body.data).toHaveProperty('version');
});
Tests are automatically run in CI/CD pipeline with:
Jest is configured with:
src/
directorysrc/controllers/
src/repositories/
(if needed)src/validators/
src/routes/
src/routes/index.js
import { ResponseTrait } from '../traits/ResponseTrait.js';
class ExampleController {
async getExample(req, res) {
try {
// Your logic here
return ResponseTrait.success(res, data, 'Success message');
} catch (error) {
console.error('Error:', error);
return ResponseTrait.serverError(res, 'Error message');
}
}
}
export default ExampleController;
The application includes comprehensive logging:
NODE_ENV=production
git checkout -b feature/amazing-feature
)git commit -m 'Add amazing feature'
)git push origin feature/amazing-feature
)This project is licensed under the MIT License - see the LICENSE file for details.
Built with β€οΈ by VidLab Team
FAQs
A modern, production-ready Express.js API skeleton with international standards, built-in validation, and comprehensive error handling
The npm package expressjs-vidlab-skeleton receives a total of 2 weekly downloads. As such, expressjs-vidlab-skeleton popularity was classified as not popular.
We found that expressjs-vidlab-skeleton demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago.Β It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
/Security News
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.
Security News
The CNA Scorecard ranks CVE issuers by data completeness, revealing major gaps in patch info and software identifiers across thousands of vulnerabilities.
Research
/Security News
Two npm packages masquerading as WhatsApp developer libraries include a kill switch that deletes all files if the phone number isnβt whitelisted.