dragonite Svelte Themes

Dragonite

A Federated Multi-Party Chat System in Golang and Svelte, using Matrix Protocol

Dragonite

A Federated Multi-Party Chat System in Golang and Svelte, using Matrix Protocol.

This project is in the scope of a Distribuited Systems Introduction Course. Dragonite is a multi-party federated chat, using the Matrix.org Protocol, to create a federated chat-app, our server is built using the Go programming language, while the client uses SvelteKit and the matrix-js-sdk. Finnaly, as you can see on the banner, we're inspired by the dragonite mailer from the Pokemon© franchise.

Install

Prerequisites

  1. To install the client, clone this project.
git clone https://github.com/caio-bernardo/dragonite.git

See the following for the frontend:

  1. Enter the frontend folder
cd frontend
  1. Install the dependencies
npm install

Usage

Considering you have cloned this project. Make a copy of the .env.example file and rename to .env. Fill the environmet variables.

Client

To run the client just use npm:

npm run dev

Access the endpoint on the terminal, normally http://localhost:5173.

Server

  1. (Optionally) create a container for the database
make docker-run

After running the container for the first time you need to create the tables inside the database do that using the migrate.sh script as follows:

export DB_URL=postgres://user:pass@localhost:5432/dbname?sslmode=disable
./migrate.sh up

Use the same values as in .env file.

  1. Run the project using the Makefile (see more commands at Makefile).
make run
  1. Use Ctrl-C to stop the server and make docker-down to disable the container.

Project Organization

.
├── air.toml
├── cmd
├── docker-compose.yml
├── frontend
├── go.mod
├── go.sum
├── internal
│    ├── database
│    ├── model
│    ├── repository
│    ├── server
│    ├── services
│    │    ├── client
│    │    └── server
│    ├── services
│    ├── types
│    └── util
├── LICENSE
├── Makefile
├── migrations
├── README.md
└── static
  • cmd/api: entrypoint to run the server
  • frontend: directory containing the client webapp
  • internal: source code for the server
  • internal/database: database connection service
  • internal/model: data models
  • internal/repository: interfaces and implementations for database access
  • internal/server: implementation of the HTTP server
  • internal/services: Business Logic
  • internal/services/client: implementation of Client-Server communication
  • internal/services/server: implementation of Server-Server communication
  • types: common types (like errors)
  • util: useful functions to parse JSON, SQL, etc.
  • migrations: SQL scripts

Maintainers

  • Caio Bernardo
  • Lucas Neves
  • Willian Farias

Contributing

Feel free to Open a New Issue or Submit a Pull Request. See our CONTRIBUTING file for more information in how to contribute in more specific ways. Don't forget to check our Code of Conduct for the repository guidelines.

License

This project is under the MIT license. For more info see LICENSE.

This file was made with Make Your Reads.

Top categories

Loading Svelte Themes