
Product
Socket Now Protects the Chrome Extension Ecosystem
Socket is launching experimental protection for Chrome extensions, scanning for malware and risky permissions to prevent silent supply chain attacks.
@diagramers/api
Advanced tools
Diagramers API - A comprehensive Node.js API template with TypeScript, Firebase Functions, and Socket.io
A comprehensive Node.js API template with TypeScript, Firebase Functions, Socket.io, and extensive authentication and communication capabilities.
Email System:
SMS System:
Push Notifications:
Payment Processing:
Analytics:
npm install @diagramers/api
npx diagramers-cli api init my-api-project
cd my-api-project
cp .env.example .env
# Edit .env with your configuration
npm install --legacy-peer-deps
npm run dev
The API supports extensive configuration through environment variables:
NODE_ENV=development
PORT=3000
HOST=localhost
APP_URL=http://localhost:3000
DATABASE_TYPE=mongodb
DATABASE_URL=mongodb://localhost:27017/diagramers
DATABASE_NAME=diagramers
JWT_SECRET=your-super-secret-jwt-key
JWT_EXPIRES_IN=1h
AUTH_DEFAULT_PROVIDER=internal
EMAIL_ENABLED=true
EMAIL_PROVIDER=nodemailer
SMTP_HOST=smtp.gmail.com
SMTP_PORT=587
SMTP_USER=your-email@gmail.com
SMTP_PASS=your-app-password
SMS_ENABLED=false
SMS_PROVIDER=twilio
TWILIO_ACCOUNT_SID=your-twilio-account-sid
TWILIO_AUTH_TOKEN=your-twilio-auth-token
TWILIO_PHONE_NUMBER=+1234567890
POST /api/auth/register
- User registrationPOST /api/auth/login
- User loginPOST /api/auth/logout
- User logoutPOST /api/auth/refresh
- Refresh JWT tokenPOST /api/auth/forgot-password
- Password reset requestPOST /api/auth/reset-password
- Password resetGET /api/auth/oauth/:provider
- OAuth provider authenticationGET /api/auth/oauth/:provider/callback
- OAuth callbackPOST /api/auth/sms/send-code
- Send SMS verification codePOST /api/auth/sms/verify-code
- Verify SMS codePOST /api/auth/email/send-code
- Send email verification codePOST /api/auth/email/verify-code
- Verify email codeGET /api/users
- Get all usersGET /api/users/:id
- Get user by IDPUT /api/users/:id
- Update userDELETE /api/users/:id
- Delete userGET /api/email/configs
- Get email configurationsPOST /api/email/configs
- Create email configurationPUT /api/email/configs/:id
- Update email configurationDELETE /api/email/configs/:id
- Delete email configurationPOST /api/email/send
- Send emailGET /api/notifications
- Get notificationsPOST /api/notifications
- Create notificationPUT /api/notifications/:id
- Update notificationDELETE /api/notifications/:id
- Delete notificationnpm run dev # Start development server
npm run build # Build for production
npm run start # Start production server
npm run clean # Clean build artifacts
npm run seed # Seed database
npm run seed:force # Force seed database
npm run seed:reset # Reset and seed database
npm run seed:truncate # Truncate database
npm run generate:module # Generate new module
npm run generate:endpoint # Generate new endpoint
npm run generate:table # Generate database table
npm run generate:relation # Generate database relation
npm run lint # Run ESLint
npm run lint:fix # Fix ESLint issues
npm run type-check # TypeScript type checking
npm run format # Format code with Prettier
npm run format:check # Check code formatting
npm run docs # Generate documentation
npm run docs:serve # Serve documentation
npm run docker:build # Build Docker image
npm run docker:run # Run Docker container
npm run docker:compose # Start with Docker Compose
npm run docker:compose:down # Stop Docker Compose
npm run backup # Backup database
npm run backup:restore # Restore database backup
npm run migrate # Run database migrations
npm run migrate:create # Create new migration
npm run migrate:rollback # Rollback migration
npm run health # Health check
npm run logs # View application logs
npm run logs:clear # Clear application logs
npm run monitor # Start monitoring
The API supports a plugin system for extending functionality:
src/plugins/
βββ base/
β βββ manager.ts
β βββ plugin.ts
βββ registry/
βββ auth.plugin.ts
import { BasePlugin } from '../base/plugin';
export class CustomPlugin extends BasePlugin {
async initialize(): Promise<void> {
// Plugin initialization logic
}
async execute(data: any): Promise<any> {
// Plugin execution logic
}
}
TEST_DATABASE_URL=mongodb://localhost:27017/diagramers-api-test
TEST_JWT_SECRET=test-jwt-secret
npm test # Run all tests
npm run test:unit # Run unit tests
npm run test:integration # Run integration tests
npm run test:coverage # Run tests with coverage
npm run deploy # Deploy to Firebase Functions
npm run deploy:staging # Deploy to staging
npm run deploy:production # Deploy to production
npm run docker:build
npm run docker:run
npm run deploy:staging # Deploy to staging environment
npm run deploy:production # Deploy to production environment
LOG_LEVEL=info
LOG_FORMAT=colored
LOG_FILE_ENABLED=true
LOG_FILE_PATH=logs/app.log
curl http://localhost:3000/health
MIT License - see LICENSE file for details
For support and questions:
FAQs
Diagramers API - A comprehensive Node.js API template with TypeScript, Firebase Functions, and Socket.io
The npm package @diagramers/api receives a total of 607 weekly downloads. As such, @diagramers/api popularity was classified as not popular.
We found that @diagramers/api demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago.Β It has 0 open source maintainers 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.
Product
Socket is launching experimental protection for Chrome extensions, scanning for malware and risky permissions to prevent silent supply chain attacks.
Product
Add secure dependency scanning to Claude Desktop with Socket MCP, a one-click extension that keeps your coding conversations safe from malicious packages.
Product
Socket now supports Scala and Kotlin, bringing AI-powered threat detection to JVM projects with easy manifest generation and fast, accurate scans.