-
Notifications
You must be signed in to change notification settings - Fork 1
Development
Md. Redwan Ahmed edited this page Feb 26, 2025
·
3 revisions
- Node.js 22.0.0 or higher
- npm 10.0.0 or higher
- AWS CLI configured
- Git
- VS Code (recommended)
- Clone the repository:
git clone https://github.com/redwan-cse/multi-platform-bot-system.git
cd multi-platform-bot-system- Install dependencies:
npm install- Set up environment:
cp .env.example .env- Create feature branch:
git checkout -b feature/your-feature-name- Run development environment:
npm run dev- Run tests while developing:
npm run test:watchsrc/
βββ lambda/ # Lambda function handlers
βββ types/ # TypeScript definitions
βββ utils/ # Shared utilities
βββ worker.js # Cloudflare Worker
-
src/lambda/*.js: AWS Lambda function handlers -
src/types/*.js: Type definitions -
src/utils/*.js: Shared utility functions -
src/worker.js: Cloudflare Worker script
- Use TypeScript JSDoc comments for type safety
- Enable strict type checking
- Document all public interfaces
- Use type inference where possible
- Use ES modules (import/export)
- Follow ESLint configuration
- Use async/await for promises
- Document complex logic
- Write unit tests for new features
try {
await someAsyncOperation();
} catch (error) {
console.error('Operation failed:', error);
throw new Error('Friendly error message');
}- Use appropriate log levels
- Include relevant context
- Don't log sensitive data
- Structure logs for easy parsing
describe('MyFunction', () => {
it('should handle successful case', async () => {
// Arrange
const input = {};
// Act
const result = await myFunction(input);
// Assert
expect(result).toBeDefined();
});
});- Test end-to-end flows
- Mock external services
- Verify database operations
- Test error scenarios
- Maintain 80% coverage minimum
- Focus on critical paths
- Test edge cases
- Mock external dependencies
- Create handler in
src/lambda/ - Define types in
src/types/ - Add utility functions in
src/utils/ - Update configuration
- Write tests
- Update documentation
- Update type definitions
- Modify utility functions
- Create migration script
- Update backup logic
- Test changes
- Document changes
- Use VS Code debugger
- Set breakpoints
- Inspect variables
- Step through code
- Check CloudWatch logs
- Monitor metrics
- Use correlation IDs
- Enable debug logging
- Use async operations
- Implement caching
- Optimize database queries
- Minimize dependencies
- Configure auto-scaling
- Optimize memory allocation
- Use provisioned capacity
- Enable caching
- Validate input
- Sanitize output
- Use parameterized queries
- Implement rate limiting
- Use least privilege
- Enable encryption
- Rotate credentials
- Monitor access logs
- Write code
- Run tests
- Create PR
- Review changes
- Merge to main
- Automated deployment
- Run integration tests
- Monitor performance
- Verify functionality
- Create release
- Deploy to production
- Monitor metrics
- Verify functionality
- Create feature branch
- Make changes
- Write tests
- Update documentation
- Create PR
- Address reviews
- Check functionality
- Verify tests
- Review documentation
- Check performance
- Validate security
- AWS Lambda
- DynamoDB
- Cloudflare Workers
- Discord API
- Telegram Bot API
- Meta Platform API
- Node.js
- TypeScript
- Jest
- ESLint
- VS Code
Copyright Β© 2025 Md. Redwan Ahmed