
Research
/Security News
Toptal’s GitHub Organization Hijacked: 10 Malicious Packages Published
Threat actors hijacked Toptal’s GitHub org, publishing npm packages with malicious payloads that steal tokens and attempt to wipe victim systems.
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
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
Threat actors hijacked Toptal’s GitHub org, publishing npm packages with malicious payloads that steal tokens and attempt to wipe victim systems.
Research
/Security News
Socket researchers investigate 4 malicious npm and PyPI packages with 56,000+ downloads that install surveillance malware.
Security News
The ongoing npm phishing campaign escalates as attackers hijack the popular 'is' package, embedding malware in multiple versions.