Skills & Interests

A mix of technical expertise and personal curiosity. These are the skills I’ve honed over time, along with areas that keep me motivated and always learning.

Things I Do

A collection of technologies and practices that make up my development workflow.

Node.js Server Setup

// Express server setupimport express from 'express';import helmet from 'helmet';import cors from 'cors';const app = express();app.use(express.json(), helmet(), cors());app.listen(3000, () => console.log('Server running'));

Auth Flow with Validation

// Login route with Zod & JWTconst schema = z.object({  email: z.string().email(),  password: z.string().min(6)});app.post('/login', async (req, res) => {  const result = schema.safeParse(req.body);  if (!result.success) return res.status(400).json(result.error);  const user = await User.findByEmail(result.data.email);  const token = jwt.sign({ id: user.id }, process.env.JWT_SECRET!);  res.json({ token });});

SQL & ORM Example

-- Simple PostgreSQL querySELECT users.name, SUM(orders.total) AS revenueFROM usersJOIN orders ON users.id = orders.user_idWHERE orders.created_at >= NOW() - INTERVAL '1 month'GROUP BY users.name;// TypeORM mapping example@Entity()export class Order {  @PrimaryGeneratedColumn()  id: number;  @Column()  total: number;}

Third-Party Integrations

// Stripe webhook handlerimport Stripe from 'stripe';app.post('/webhook',  express.raw({ type: 'application/json' }),  (req, res) => {    const event = stripe.webhooks.constructEvent(      req.body,      req.headers['stripe-signature']!,      process.env.STRIPE_SECRET!    );    console.log(event.type);    res.json({ received: true });  });

Swagger Documentation

// NestJS Swagger decorators@ApiTags('users')@Controller('users')export class UsersController {  @Post()  @ApiOperation({ summary: 'Create a new user' })  @ApiBody({ type: CreateUserDto })  @ApiResponse({ status: 201, type: User })  async create(@Body() dto: CreateUserDto) {    return this.usersService.create(dto);  }}

Redis Caching

// Redis caching with TTL and cache-aside patternconst getUser = async (userId) => {  const cacheKey = `user:${userId}`;  const cached = await redis.get(cacheKey);    if (cached) return JSON.parse(cached);    const user = await User.findById(userId);  await redis.setex(cacheKey, 3600, JSON.stringify(user));  return user;};

Queue Processing

// Bull queue for email processingconst emailQueue = new Queue('email processing', {  redis: { host: 'localhost', port: 6379 }});emailQueue.process('welcome-email', async (job) => {  const { userId, email } = job.data;  await sendWelcomeEmail(email);  console.log(`Welcome email sent to ${email}`);});// Add job to queueemailQueue.add('welcome-email', { userId: 123, email: 'user@example.com' });

Error Handling & Logging

// Global error handler with structured loggingconst errorHandler = (err, req, res, next) => {  logger.error({    error: err.message,    stack: err.stack,    url: req.url,    method: req.method,    ip: req.ip,    userId: req.user?.id  });    if (err.name === 'ValidationError') {    return res.status(400).json({ error: 'Validation failed' });  }  res.status(500).json({ error: 'Internal server error' });};

Docker & CI/CD

# Multi-stage Dockerfile for Node.jsFROM node:18-alpine AS builderWORKDIR /appCOPY package*.json ./RUN npm ci --only=productionFROM node:18-alpine AS productionRUN addgroup -g 1001 -S nodejs && adduser -S nodejs -u 1001COPY --from=builder /app/node_modules ./node_modulesCOPY . .USER nodejsEXPOSE 3000CMD ["node", "dist/main.js"]

API Rate Limiting

// Express rate limiting with Redis storeconst rateLimit = require('express-rate-limit');const RedisStore = require('rate-limit-redis');const limiter = rateLimit({  store: new RedisStore({ client: redisClient }),  windowMs: 15 * 60 * 1000, // 15 minutes  max: 100, // limit each IP to 100 requests per windowMs  message: 'Too many requests, please try again later.',  standardHeaders: true,});app.use('/api/', limiter);

API Testing

// Test endpoint with curlcurl -X POST https://api.example.com/webhook \  -H "Content-Type: application/json" \  -d '{"type":"order.created","data":{"id":"123"}}'// Express handlerapp.post('/webhook', (req, res) => res.status(200).send('OK'));

NestJS API

// NestJS Controller example@Controller('users')export class UsersController {  constructor(private usersService: UsersService) {}  @Get()  findAll() {    return this.usersService.findAll();  }  @Get(':id')  findOne(@Param('id') id: string) {    return this.usersService.findById(id);  }}