Valkyrie

screenshot of Valkyrie
nestjs
react
chakra-ui

A Fullstack Discord Clone using React and Go.

Overview:

Valkyrie is a Discord clone built using React and Go. It includes features such as message, channel, and server CRUD operations, authentication using Express Sessions, real-time events, file uploads to S3, direct messaging, private channels, a friend system, and basic moderation and voice chat capabilities. The stack includes Gin for the HTTP server, Gorilla Websockets for WS communication, Gorm as the database ORM, PostgreSQL for data storage, Redis for session storage, S3 for file storage, and Gmail for sending emails. The theme is designed with React and Chakra UI, and state management is handled with React Query and Zustand.

Features:

  • Message, Channel, Server CRUD: Create, read, update, and delete messages, channels, and servers.
  • Authentication using Express Sessions: Secure user authentication using Express Sessions.
  • Channel / Websocket Member Protection: Protection of channels and websockets for authorized members only.
  • Realtime Events: Real-time updates and events within the application.
  • File Upload (Avatar, Icon, Messages) to S3: Upload and store files such as avatars, icons, and messages to S3.
  • Direct Messaging: Private messaging between users.
  • Private Channels: Creation and management of private channels within the server.
  • Friend System: A system for adding and managing friends within the application.
  • Notification System: Notifications for messages, friend requests, and other events.
  • Basic Moderation: Basic moderation features for guild owners, including message deletion, member kicking, and banning.
  • Basic Voice Chat: Voice chat functionality with one voice channel per guild, and mute and deafen options.

Server:

  1. If you are familiar with make, you can look at the Makefile to quickly setup the following steps. Alternatively, copy the commands into your CLI.
  2. Install Docker and get the PostgreSQL and Redis containers by running make postgres && make redis.
  3. Start both containers by running make start and create a DB by running make createdb.
  4. Install the latest version of Go and get all the dependencies by running go mod tidy.
  5. Rename .env.example to .env and fill in the values.
  6. Run go run github.com/sentrionic/valkyrie to start the server.

Alternatively:

If you only want to run the backend without installing Go and all the dependencies, you can download the pre-compiled server from the Release tab. Note that you will still need to follow steps 1, 2, and 4.

Web:

  1. Install Node 20 or the LTS version of Node.
  2. Install yarn.
  3. Run yarn to install the dependencies.
  4. Run yarn start to start the client.
  5. Go to localhost:3000 to access the application.

Endpoints:

Once the server is running, go to localhost:<PORT>/swagger/index.html to see all the HTTP endpoints, and localhost:<PORT> for all the websocket events.

Summary:

Valkyrie is a Discord clone built using React and Go. It offers a range of features similar to Discord, including messaging, channel and server management, authentication, file uploads, direct messaging, private channels, friend system, moderation capabilities, and voice chat. The application is built using a stack of technologies including Gin, Gorilla Websockets, Gorm, PostgreSQL, Redis, S3, React, Chakra UI, React Query, and Zustand. Installation instructions are available for setting up the server and web components separately.

nestjs
Nest

A progressive Node.js framework for building efficient, scalable, and enterprise-grade server-side applications with TypeScript/JavaScript.

react
React

React is a widely used JavaScript library for building user interfaces and single-page applications. It follows a component-based architecture and uses a virtual DOM to efficiently update and render UI components

chakra-ui
Chakra UI

Chakra UI is a popular open-source React component library that provides a set of accessible and customizable UI components to help developers create modern web applications.

typescript
Typescript

TypeScript is a superset of JavaScript, providing optional static typing, classes, interfaces, and other features that help developers write more maintainable and scalable code. TypeScript's static typing system can catch errors at compile-time, making it easier to build and maintain large applications.