A Discord clone written in TypeScript.
Notes:
- File Upload is disabled.
- The live demo currently runs on the Go backend and uses websockets.
- Message, Channel, Server CRUD
- Authentication using Express Sessions
- Channel / Websocket Member Protection
- Realtime Events
- File Upload (Avatar, Icon, Messages) to S3
- Direct Messaging
- Private Channels
- Friend System
- Notification System
- Basic Moderation for the guild owner (delete messages, kick & ban members)
- NestJS with socket.io
- React with Chakra UI
- REST Endpoints
- React Query & Zustand for state management
For the websocket version check out the Websocket branch
For the mobile app check out ValkyrieApp
- Install NodeJS
- Install PostgreSQL and create a DB
- Install Redis
- Run
yarn
to install the dependencies - Rename
.env.example
to.env
and fill in the values
-
Required
DATABASE_URL="postgresql://<username>:<password>@localhost:5432/db_name" REDIS_URL=localhost:6379 CORS_ORIGIN=http://localhost:3000 SECRET=SUPERSECRET REDIS_HOST=localhost REDIS_PORT=6379 REDIS_PASSWORD=password
Redis Info is needed twice because the RedisCache Module can't use the REDIS_URL
directly.
-
Optional: Not needed to run the app, but you won't be able to upload files or send emails.
AWS_ACCESS_KEY=ACCESS_KEY AWS_SECRET_ACCESS_KEY=SECRET_ACCESS_KEY AWS_STORAGE_BUCKET_NAME=STORAGE_BUCKET_NAME AWS_S3_REGION=S3_REGION GMAIL_USER=GMAIL_USER GMAIL_PASSWORD=GMAIL_PASSWORD
- Run
yarn start
to run the server
- Run
yarn
to install the dependencies - Copy .env.example and fill in the values
- Run
yarn start
to start the client - Go to
localhost:3000
Once the server is running go to localhost:4000/api
to see all the HTTP endpoints
and localhost:4000/ws
for all the websocket events.