Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

51 Commits

Folders and files

Repository files navigation

Messaging App API

Frontend Repo (Vite, React, TS)

Live Demo

REST API backend for a real-time messaging application. Handles user authentication, friend requests, conversations, and message delivery. The frontend is a separate Vite + React + TypeScript app.

Tech Stack

  • Runtime: Bun. Originally written for Node.js, migrated to the Bun runtime with minimal changes. It is still a standard Express.js app.
  • Framework: Express.js
  • Database: MongoDB via Mongoose
  • Real-time: Socket.IO used for live message delivery between connected clients
  • Authentication: JWT bearer tokens. Protected routes require a valid Authorization: Bearer <token> header.
  • Validation: Zod schemas applied via Express middleware on all incoming request bodies and params
  • Testing: Bun's built-in test runner with Supertest and mongodb-memory-server for in-process integration tests. Originally used Jest, replaced with bun:test later. Bun's test runner is Jest-compatible.

Features

  • User registration and login
  • Friend request system
  • One-on-one conversations between users
  • Paginated message history
  • Real-time messaging via Socket.IO rooms

Deployment

Containerized with Docker. A multi-stage Dockerfile compiles the app into a single self-contained executable using bun build --compile. Docker BuildKit secrets are used to inject environment variables at build time without leaking them into image layers.

The live demo runs on a Hetzner VPS.

Local development

bun run dev

Local build (single-file executable)

bun run build
bun run start

Docker

bun run docker:build
bun run docker:run

Tests

bun test
bun test --watch

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages