SendHelp is a real-time chat application built with modern web technologies. The project is structured as a monorepo using pnpm workspaces, with three main packages:
- @sendhelp/core - Shared types and interfaces
- @sendhelp/server - Backend server using Express.js and Socket.IO
- @sendhelp/web - Frontend application built with Next.js and React
2110471-project/
├── .docker/
│ ├── default.conf # nginx config
│ ├── docker-compose.yaml
│ ├── proxy.Dockerfile
│ └── server.Dockerfile
├── packages/
│ ├── core/ # Shared types and utilities
│ ├── server/ # Backend server
│ └── web/ # Frontend Next.js application
├── .dockerignore # Workspace configuration
├── pnpm-workspace.yaml # Workspace configuration
└── pnpm-lock.yaml # Dependencies lock file
- Frontend: Next.js 15, React 19, Tailwind CSS, shadcn/ui components
- Backend: Express.js, Socket.IO, LowDB (for simple data persistence)
- State Management: Zustand
- Build Tools: TypeScript, pnpm
- Persistent message
- Color-coded user
- Message timestamp
- Room message preview
Message does not disappear after the chat is closed or even when the server is restarted.
- Make sure you have Node.js (>=20) and pnpm@10 installed
- Install dependencies:
pnpm install- Build core dependency
pnpm --filter=core build- Start the development server:
# In one terminal, start the backend
pnpm --filter=server start
# In another terminal, start the frontend
cd packages/web
pnpm --filter=web dev- Open your browser at http://localhost:3000
docker compose -f .docker/docker-compose.yaml --project-directory . up- Real-time messaging
- Create and join chat rooms
- Persistent message history
- Modern UI with Tailwind CSS
The core package contains shared TypeScript interfaces for messages, rooms, and other data structures used throughout the application.
The server is built with Express.js and uses Socket.IO for real-time communication. It stores data in a simple JSON database (LowDB). The server implements the following features:
- User authentication (basic implementation)
- Chat room creation and management
- Message broadcasting
- Persistent message storage
The web application is built with Next.js and React. It uses:
- Socket.IO Client for real-time communication
- Zustand for state management
- Tailwind CSS for styling
- shadcn/ui for UI components
-
Create a new branch for your feature:
git checkout -b feature/your-feature-name -
Make your changes
-
Test your changes:
# Build and test server cd packages/server pnpm build pnpm start # Test web app cd packages/web pnpm dev -
Commit your changes with a descriptive message
-
Push your branch and create a pull request
- Update shared types in
packages/core/src/types.tsif needed - Create new components in
packages/web/src/components - Update state management in
packages/web/src/store.tsif needed - Implement socket handlers in
packages/web/src/hooks/chat.tsif needed
- Update shared types in
packages/core/src/types.tsif needed - Create a new use case in
packages/server/src/usecases - Implement socket handlers in
packages/server/src/index.ts - Update database schema in
packages/server/src/db.tsif needed
src/types.ts: Shared TypeScript interfaces
src/index.ts: Main server entry pointsrc/db.ts: Database configurationsrc/usecases/: Business logic separated by use case
src/app/: Next.js app router and pagessrc/components/: React componentssrc/hooks/: Custom React hookssrc/lib/: Utility functionssrc/store.ts: Zustand storesrc/socket.ts: Socket.IO client configuration