4.3 אקספרס תרגול
למדו ותרגלו בעצמכם באקספרס.
הנה checklist של דברים שאתם יכולים לעשות וללמוד כדי לתרגל עוד.
יסודות (Core)
- יצירת שרת HTTP
- בניית Routing (GET / POST / PUT / DELETE)
- עבודה עם JSON
- הצבת Query params / Route params
- פיתוח Middleware בסיסי
- החזרת סטטוסים נכונים (200 / 201 / 400 / 404 / 500)
- מבנה פרויקט נכון
- הפרדת Routes / Controllers / Models
- טיפול בשגיאות (Error middleware)
- שימוש בAsync / Await ב-Express
-
עבודה עם קבצים (fs)
עבודה עם מסד נתונים -
חיבור MongoDB / SQL
- שימוש בCRUD מלא
- אינדקסים
- Transactions
- Pagination
- Sorting
- Filtering
- Search (Regex / Text index)
- Aggregation (Mongo)
- Relationships / Populate
- Soft delete
- Migrations
Authentication & Security
- JWT Authentication
- Refresh Tokens
- Cookies vs Headers
- Hashing (bcrypt)
- Rate Limit
- Helmet
- CORS
- CSRF Protection
- XSS Protection
- SQL / NoSQL Injection Prevention
- Secure Headers
- API Keys
- IP Whitelisting
- Brute Force Protection
- Session vs Stateless
Authorization (הרשאות)
- Roles (Admin / User)
- Permissions
- RBAC
- Ownership checks
- Multi-tenant security
- ACL
Validation & Data Integrity
- Validation (Joi / Zod / Yup)
- Sanitization
- Schema validation
- Request validation middleware
- DTO pattern
- Input filtering
ביצועים (Performance)
- Compression (gzip)
- Caching (Memory / Redis)
- HTTP Cache headers
- ETag
- Streaming
- Cluster mode
- Load balancing
- Keep-Alive
- Event loop understanding
- Non-blocking code
- Avoiding memory leaks
קבצים ו-Media
- Upload files (Multer)
- Image processing
- File streaming
- S3 / Object storage
- Static files serving
- Signed URLs
Realtime
- WebSockets
- Socket.io
- Realtime notifications
- Presence systems
- Pub/Sub
- Live dashboards
Background Jobs & Queues
- Job Queue (Bull / BullMQ)
- Email workers
- Video / Image processing
- Retry logic
- Dead letter queues
- Scheduling jobs (Cron)
API מתקדם
- REST best practices
- Versioning (/v1 /v2)
- HATEOAS
- GraphQL עם Express
- API Gateway
- Rate limiting מתקדם לפי משתמש
- API documentation (Swagger / OpenAPI)
- Idempotency
- Request tracing
Logging & Monitoring
- Request logging (morgan / pino)
- Structured logs
- Error tracking
- Metrics
- Health checks (/health)
- APM monitoring
- Performance profiling
ארכיטקטורה
- MVC
- Clean Architecture
- Layered architecture
- Microservices
- Monolith vs Services
- Modular Express
- Dependency injection
- Config management
- Environment handling
Production & Deployment
- Docker
- Reverse proxy (Nginx)
- HTTPS / TLS
- Environment configs
- Secrets management
- CI/CD
- Zero downtime deploy
- Horizontal scaling
- Graceful shutdown
Testing
- Unit tests
- Integration tests
- API testing (Supertest)
- Mocking DB
- Load testing
- Security testing
SaaS / מערכות גדולות
- Multi-tenant architecture
- Billing hooks
- Usage tracking
- Feature flags
- Audit logs
- Admin APIs
- Rate limit לפי plan
- Tenant isolation
דברים מתקדמים מאוד
- Custom middleware framework
- Request lifecycle tracing
- Distributed caching
- Event driven architecture
- Message brokers (Kafka / RabbitMQ)
- CQRS
- Event sourcing
- High throughput APIs
- Backpressure handling
- Streaming APIs