# autonomous.contact

A hub for communities as a single service with no required external dependencies.

## Screenshots

![chat](/screenshots/screenshot-chat.png)

## TODO

These are in no particular order. Pull requests updating this section welcome for
feature discussions.

- [X] the core is a stream of events
- [X] get a first-pass podman/docker setup up
- [X] sign up
- [X] check for logged in user session
- [X] log in
- [X] refactor login/sessions/totp
- [/] media uploads
	- [X] local upload support (keep it simple for small instances)
	- [ ] S3 support (then self-host with your friends: https://garagehq.deuxfleurs.fr/)
		- [ ] test mounting an s3 volume under /files and having no s3 support in the codebase
- [X] user profile page
	- [X] logout button
	- [/] profile editing
	- [X] avatar uploads
- [X] chat channels
	- [X] chat messages
	- [ ] membership and presence
		- [ ] add memberships to channels
			- [ ] join to get notifications
			- [ ] join for additional permissions
			- [ ] filters for allowing joining a channel based on criteria on the user?
			- [ ] display channel members somehwere
		- [ ] emit presence events on join/leave
		- [ ] display user presence
	- [ ] chat message actions
		- [X] '...' button to show actions
		- [ ] delete message
		- [ ] reply to message
		- [X] copy message link
	- [ ] @-prefixing of users for notifications/highlighting
		- [ ] chat input box should auto-complete users for you
		- [ ] messages to you should be highlighted somehow
	- [/] chat message reactions
	- [X] sidebar on mobile needs to show/hide via a button
	- [/] clean up after initial implementation
		- [X] split the monolithic talk.html up
		- [X] rename talk => chat
		- [ ] way too much spaghetti has accumulated in the frontend - take a cleanup pass
	- [/] chat message processing
		- [X] auto-link urls
			- [X] use this regex: `(?:(?<protocol>[a-zA-Z]+):)?(?:\/\/)?(?:(?<auth>(?<username>\S.+)\:(?<password>.+))\@)?(?<host>(?:(?<hostname>[-a-zA-Z0-9\.]+)\.)?(?<domain>(?:[-a-zA-Z0-9]+?\.(?<tld>[-a-zA-Z0-9]{2,64}))|localhost)(?:\:(?<port>[0-9]{1,6}))?)\b(?<path>[-a-zA-Z0-9@:%_{}\[\]<>\(\)\+.~&\/="]*?(?<extension>\.[^\.?/#"\n<>]+)?)(?:\?(?<query>[a-zA-Z0-9!$%&<>()*+,-\.\/\:\;\=\?\@_~"]+))?(?:#(?<hash>[a-zA-Z0-9!$&'()*+,-\.\/\:\;\=\?\@_~"]*?))?(?:$|\s)`
		- [ ] :emoji: replacements
		- [ ] preview cards for links
			- [ ] add a button to allow for loading a preview
				- we want to do this loading client-side, and so should only do it if they ask us to
			- [ ] parse head meta, eg: https://github.com/AndrejGajdos/link-preview-generator/blob/master/index.js
		- [/] embedded video for
			- [X] youtube
			- [X] vimeo
			- [ ] tiktok
		- [/] embedded audio or audio cards for:
			- [X] tidal
			- [X] spotify
			- [ ] youtube (any way to differentiate for yt music?)
			- [X] direct uploads
				- [X] make the direct upload audio player look decent for a first pass
				- [ ] make the display cooler - clicking the spectrum should toggle to different display modes
		- [ ] add action buttons to embeds
			- [ ] copy original link (hopefully just a button with some onclick we can slap next to the iframe and style?)
			- [ ] toggle embed (toggle between showing the embed and the original link)
		- [X] punycode urls before url extraction? (see: https://stackoverflow.com/a/26618995)
		- [/] gif support
			- [X] gif embeds
			- [X] mp4 embeds
			- [ ] start/stop gif control
			- [ ] hide control
		- [/] inline image support
			- [X] inline images
			- [ ] fullscreen images on click to show largest version
			- [ ] hide control
	- [X] try to select immediate sibling messages from the same user and hide mulitple avatars
- [ ] emoji support
	- [ ] inline replace for :rofl: style
	- [ ] emoji picker
- [ ] custom emoji support
	- [ ] upload custom gif emoji
- [/] Notifications
	- [X] if web notifications are not enabled, show a button to turn them on
	- [ ] if web notifications are enabled, emit on events
	- [ ] ability to mute
		- [ ] users
		- [ ] channels
		- [ ] tags (#tags?)
- [ ] admin panel
	- [ ] add invite code generation
		- [ ] AC_REQUIRE_INVITE_CODE: boolean env var/setting
	- [ ] AC_DIRECTORY_SERVERS: |-separated list of directory servers to report to
          these central servers could be distributed directories - your town might run one,
		  your state, your country, or you could publish to a public one that is organized
		  around interests
- [ ] combined "bulletin board" instead of exchange/work?
	- [ ] post-it style notes with tag and keyword filtering?
- [ ] simple wiki for resources
- [ ] simple calendar with public/private event tracking
	- [ ] caldav support
- [X] smart forms
	- [X] use the api for forms so requests will be authenticated
	- [X] support multiple methods
	- [X] add `on_parsed` to allow injecting additional data
	- [X] refine `on_response`/`on_reply`

## Getting Started Developing

1) Install Deno

	Run their shell script (note: as yourself, not root)

	```
	curl -fsSL https://deno.land/install.sh | sh
	```

	Or using Nix:

	```
	nix-shell -p deno
	```

2) Clone the repo:

	`git clone https://andyburke.dev/andyburke/autonomous.contact.git`

3) Start the server:

	`deno run task serve`

4) Navigate to http://localhost:8000

5) Edit some code and check it out.
