Code Monkey home page Code Monkey logo

chitchat's Introduction

chitchat

Go

Aims to be easy to set up for anyone interested in a privately hosted messenger-like service.

Demo user available: [email protected] / test

This service is by no means complete. Follow issues to keep updated.

Prerequisites

  1. Docker 20.10 or greater (https://docs.docker.com/get-docker/).

Kicking the tires

  1. docker compose up

Start developing

  1. Golang 1.21 or greater (https://go.dev/doc/install).
  2. docker compose up -d --scale chitchat=0 to start database only.
  3. go mod tidy to install dependencies.
  4. go run main.go to start.

Running migrations

We only have one migration yet. The initial one, but when we reach V1 there will need to be separate ones. The current migration strategy is:

  1. docker compose exec db mysql -uchitchat -ppassword chitchat (please use something difrferent in production).
    • PS: The db container need to be fully running before attempting to connect. Ut has a health check that should read "healtly" in docker compose ps
  2. Paste and run new migrations manually from the schema folder.

Troubleshooting

Not seeing any changes after pulling repo

  • If you're running everything in docker compose, you may need to trigger a manual rebuild:
    1. docker compose build
    2. docker compose up

If chitchat fails to start check logs

  • It logs complains about prepared statements you'll need to either manually run migrations, or just nuke the database entierly. The latter will of course be unacceptable in production :)
    1. docker compose down (nukes database)
    2. docker compose up

Instabilities be damned, lets run it now anyway!

Very well then! You will need a hosting service, or host it at home. There are plenty of guides on now to host web services, so I'll leave it up to you. But here's the short list of requirements:

  • MySQL / MariaDB
  • Able to run containers
    • Although you could build it manually and run it directly if you'd like
  • A domain (preferrably) and SSL cert to get https.
    • At this time you may run on http, but I encourage you to read up on why that's perhaps not the greatest idea.
    • In addition, you won't be able to make use of future services like; web push, passkey login etc.

I encourage you to have a look at the included docker-compose.yml file to check out available environment variables to set.

chitchat's People

Contributors

emilhauk avatar dependabot[bot] avatar eirik-haukeland avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

tashuuuu

chitchat's Issues

Add "Create new channel" button

Could perhaps be located here:
image

A button could be added after after this line:

{{template "channel-list" .Channels}}

Backend facilities should be in place already, so you can take inspiration from this line which does the same thing:

<p>Select channel from the menu, or <a href="/im/new-channel" hx-get="/im/new-channel" hx-push-url="true" hx-target="main" hx-swap="innerHTML">start a new one</a>.</p>

We need some styling to make it look like a button, but I think for ARIA purposes it should be a link in the markup. It should look like any other button I think. Not red as is the crappy screenshot I painted on :)

Styles are added in static/styles.css for now at least. We should probably introduce Tailwind or something soon, but this'll do for now.

Can invite through link

Create an invitation link.
Should be tune-able if single use or permanent (until manually deleted)

Support editing own messages

To fix annoying spelling-mistakes.

Should be marked as edited, and everyone that can see the message, should also be able to request its history.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.