{"id":15198340,"url":"https://github.com/sentrionic/valkyrie","last_synced_at":"2025-09-13T19:44:14.240Z","repository":{"id":38141510,"uuid":"342607602","full_name":"sentrionic/Valkyrie","owner":"sentrionic","description":"A Fullstack Discord Clone using React and Go.","archived":false,"fork":false,"pushed_at":"2023-06-26T11:40:55.000Z","size":79737,"stargazers_count":315,"open_issues_count":2,"forks_count":75,"subscribers_count":13,"default_branch":"main","last_synced_at":"2025-04-07T06:11:25.017Z","etag":null,"topics":["chakra-ui","discord","gin-gonic","go","gorilla-websocket","nestjs","react","realtime","socket-io","typescript","websockets"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sentrionic.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2021-02-26T14:54:04.000Z","updated_at":"2025-02-27T15:14:52.000Z","dependencies_parsed_at":"2022-07-11T20:02:40.562Z","dependency_job_id":"b1de328b-eeaf-41c4-8744-f7708fca2c72","html_url":"https://github.com/sentrionic/Valkyrie","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sentrionic%2FValkyrie","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sentrionic%2FValkyrie/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sentrionic%2FValkyrie/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sentrionic%2FValkyrie/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sentrionic","download_url":"https://codeload.github.com/sentrionic/Valkyrie/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247601448,"owners_count":20964864,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["chakra-ui","discord","gin-gonic","go","gorilla-websocket","nestjs","react","realtime","socket-io","typescript","websockets"],"created_at":"2024-09-28T01:02:53.915Z","updated_at":"2025-04-07T06:11:30.740Z","avatar_url":"https://github.com/sentrionic.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Go Report Card](https://goreportcard.com/badge/github.com/sentrionic/Valkyrie)](https://goreportcard.com/report/github.com/sentrionic/Valkyrie)\n\n# Valkyrie\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://harmony-cdn.s3.eu-central-1.amazonaws.com/logo.png\"\u003e\n\u003c/p\u003e\n\nA [Discord](https://discord.com) clone using [React](https://reactjs.org/) and [Go](https://golang.org/).\n\n**Notes:**\n\n- The design does not fully match the current design of Discord anymore.\n- For the old [Socket.io](https://socket.io/) stack using [NestJS](https://nestjs.com/) check out the [v1](https://github.com/sentrionic/Valkyrie/tree/v1) branch.\n\n## Video\n\nhttps://user-images.githubusercontent.com/38354571/137365365-a7fe91d6-51d7-4739-8742-f68517223f8f.mp4\n\n## Features\n\n- Message, Channel, Server CRUD\n- Authentication using Express Sessions\n- Channel / Websocket Member Protection\n- Realtime Events\n- File Upload (Avatar, Icon, Messages) to S3\n- Direct Messaging\n- Private Channels\n- Friend System\n- Notification System\n- Basic Moderation for the guild owner (delete messages, kick \u0026 ban members)\n- Basic Voice Chat (one voice channel per guild + mute \u0026 deafen)\n\n## Stack\n\n### Server\n\n- [Gin](https://gin-gonic.com/) for the HTTP server\n- [Gorilla Websockets](https://github.com/gorilla/websocket) for WS communication\n- [Gorm](https://gorm.io/) as the database ORM\n- PostgreSQL to save all data\n- Redis for storing sessions and reset tokens\n- S3 for storing files and Gmail for sending emails\n\n### Web\n\n- React with [Chakra UI](https://chakra-ui.com/)\n- [React Query](https://react-query.tanstack.com/) \u0026 [Zustand](https://github.com/pmndrs/zustand) for state management\n- [Typescript](https://www.typescriptlang.org/)\n\nFor the mobile app using Flutter check out [ValkyrieApp](https://github.com/sentrionic/ValkyrieApp)\n\n---\n\n## Installation\n\n### Server\n\nIf you are familiar with `make`, take a look at the `Makefile` to quickly setup the following steps\nor alternatively copy the commands into your CLI.\n\n1. Install Docker and get the Postgresql and Redis containers (`make postgres` \u0026\u0026 `make redis`)\n2. Start both containers (`make start`) and create a DB (`make createdb`)\n3. Install the latest version of Go and get all the dependencies (`go mod tidy`)\n4. Rename `.env.example` to `.env` and fill in the values\n\n- `Required`\n\n        PORT=4000\n        DATABASE_URL=postgresql://\u003cusername\u003e:\u003cpassword\u003e@localhost:5432/valkyrie\n        REDIS_URL=redis://localhost:6379\n        CORS_ORIGIN=http://localhost:3000\n        SECRET=SUPERSECRET\n        HANDLER_TIMEOUT=5\n        MAX_BODY_BYTES=4194304 # 4MB in Bytes = 4 * 1024 * 1024\n\n- `Optional: Not needed to run the app, but you won't be able to upload files or send emails.`\n\n        AWS_ACCESS_KEY=ACCESS_KEY\n        AWS_SECRET_ACCESS_KEY=SECRET_ACCESS_KEY\n        AWS_STORAGE_BUCKET_NAME=STORAGE_BUCKET_NAME\n        AWS_S3_REGION=S3_REGION\n        GMAIL_USER=GMAIL_USER\n        GMAIL_PASSWORD=GMAIL_PASSWORD\n\n5. Run `go run github.com/sentrionic/valkyrie` to run the server\n\n**Alternatively**: If you only want to run the backend without installing Go and all dependencies, you can download the pre compiled server from the [Release tab](https://github.com/sentrionic/Valkyrie/releases) instead. You will still need to follow the above steps 1, 2 and 4.\n\n### Web\n\n1. Install Node 20 or the LTS version of Node.\n2. Install [yarn](https://classic.yarnpkg.com/lang/en/)\n3. Run `yarn` to install the dependencies\n4. Run `yarn start` to start the client\n5. Go to `localhost:3000`\n\n## Endpoints\n\nOnce the server is running go to `localhost:\u003cPORT\u003e/swagger/index.html` to see all the HTTP endpoints\nand `localhost:\u003cPORT\u003e` for all the websockets events.\n\n## Tests\n\nAll tests are run on all push and pull requests. Only if they are successful it will run the other Github Actions to automatically deploy the updates.\n\n### Server\n\nAll routes in `handler` have tests written for them.\n\nFunction calls in the `service` directory that do not just delegate work to the repository have tests written for them.\n\nRun `go test -v -cover ./service/... ./handler/...` (`make test`) to run all tests\n\nAdditionally this repository includes E2E tests for all successful requests. To run them you\nhave to have Postgres and Redis running in Docker and then run `go test github.com/sentrionic/valkyrie` (`make e2e`).\n\n### Web\n\nMost `useQuery` hooks have tests written for them.\n\nTo run them use `yarn test`.\n\nAdditionally [Cypress](https://www.cypress.io/) is used for E2E testing.\n\nTo run them you need to have the server and the client running.\nAfter that run `yarn cypress` to open the test window.\n\n**Note**: For unkown reasons websockets connection only randomly work during Cypress runs, which makes testing them impossible.\n\n## Credits\n\n[Ben Awad](https://github.com/benawad): The inital project is based on his Slack tutorial series and I always look at his repositories for inspiration.\n\n[Jacob Goodwin](https://github.com/JacobSNGoodwin/memrizr): This backend is built upon his tutorial series and uses his backend structure.\n\n[Jeroen de Kok](https://dev.to/jeroendk/building-a-simple-chat-application-with-websockets-in-go-and-vue-js-gao): The websockets structure is based on his tutorial.\n\n[ericellb](https://github.com/ericellb/React-Discord-Clone): His repository helped me implement voice chat.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsentrionic%2Fvalkyrie","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsentrionic%2Fvalkyrie","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsentrionic%2Fvalkyrie/lists"}