Skip to content

sentrionic/Valkyrie

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

76 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Valkyrie

A Discord clone written in TypeScript.

Live Demo

Notes:

Video

Game

Features

  • 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)

Stack

For the websocket version check out the Websocket branch

For the mobile app check out ValkyrieApp


Installation

Server

  1. Install NodeJS
  2. Install PostgreSQL and create a DB
  3. Install Redis
  4. Run yarn to install the dependencies
  5. 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
    
  1. Run yarn start to run the server

Web

  1. Run yarn to install the dependencies
  2. Copy .env.example and fill in the values
  3. Run yarn start to start the client
  4. Go to localhost:3000

Endpoints

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.