Minimal real-time chat app. Client: React + Vite + Tailwind + Redux with Google OAuth. Server: Mojo.js HTTP/WebSocket, Prisma/PostgreSQL, Zod validation.
- Node.js >= 22
- PostgreSQL >= 14
- Package manager: pnpm
For Linux (apt) you can install PostgreSQL with:
sudo apt install -y postgresql postgresql-contribCreate a user with:
sudo -u postgres psql -c "CREATE USER <username> WITH SUPERUSER PASSWORD '<password>';"Create a database with:
createdb <dbname>mojo-chat/
├─ client/
│ ├─ public/
│ ├─ src/
│ │ ├─ app/ # Redux store
│ │ ├─ components/ # UI components
│ │ ├─ features/ # Redux slices
│ │ ├─ pages/ # Routes (Login/Register, Chat)
│ │ ├─ App.jsx
│ │ └─ main.jsx
│ ├─ index.html
│ ├─ vite.config.js
│ ├─ tailwind.config.js
│ └─ package.json
├─ server/
│ ├─ controllers/ # chat, user, download
│ ├─ helpers/ # schemas, validators, utils
│ ├─ prisma/ # schema + migrations
│ ├─ test/ # API & WS tests
│ ├─ index.js
│ └─ package.json
├─ LICENSE
├─ Makefile
└─ README.md
make all: Runs build, format, lint, and test.make build: Installs deps (pnpm) for client/server and builds the client.make build-clean: Same as build, but with--frozen-lockfile(exact lockfile versions).make format: Formats client/server and Prisma schema.make lint: Type-checks the server (pnpm tsc).make test: Generates Prisma client, prepares test DB, runs tests.
- Make sure you've set up the environment variables in the
.envfile correctly. - Run
maketo build the project and run tests. - Cd into server and run
pnpm devto start the server in development mode. - Cd into client and run
pnpm devto start the client in development mode. - Client app should be available at http://localhost:3000.