Skip to content

Repository files navigation

Team

A knowledge-sharing tool for teams. Bring articles, daily reports, code snippets, and short updates together in one place, with everything broadcast to Slack.

Demo

Try the live demo: https://team.huatuo.xyz

  • Post — knowledge articles written in Markdown (tags, comments, stock, pin, co-editing)
  • Nippo — daily reports with a template-equipped editor
  • Gist — code snippets with syntax highlighting
  • Tweet — short updates and replies
  • Slack notifications — every activity is delivered as a unified Block Kit message
  • Auth — username/password or Google sign-in (with optional domain restriction)
  • Light / dark theme

Screenshots

Feed Post
Feed Post
Editor Tweet
Editor Tweet

Tech Stack

  • Backend: Rust / Axum + Tokio
  • Database: PostgreSQL (tokio-postgres + deadpool)
  • Templates: Handlebars (server-side rendering)
  • Frontend: Vanilla JS + custom CSS

Setup

1. Environment variables

cp .env.example .env

.env is loaded automatically by both the app itself (dotenvy) and docker compose. See .env.example for a description of each variable.

2-a. Run with Docker

docker compose up

The app starts at http://localhost:3000 (PostgreSQL included; the source directory is mounted, so changes rebuild automatically).

2-b. Run locally

createdb team
psql team < ddl.sql

cargo run
# or with hot reload during development
cargo install cargo-watch
cargo watch -x run

Test

cargo test

Deploy

Docker Compose

compose.prod.yml builds a release image (Dockerfile) and runs it. Point TEAM_DATABASE_URL in .env to your database, then:

docker compose -f compose.prod.yml up --build -d

Deploying directly on a server

  1. Build (or transfer a binary built by CI):

    cargo build --release
  2. Place target/release/team on the server along with the templates/ and public/ directories (templates and static assets are read from the working directory at runtime).

  3. Run it as a systemd service:

    # /etc/systemd/system/team.service
    [Unit]
    Description=Team
    After=network.target postgresql.service
    
    [Service]
    WorkingDirectory=/opt/team
    ExecStart=/opt/team/team
    EnvironmentFile=/opt/team/.env
    Restart=always
    
    [Install]
    WantedBy=multi-user.target
    sudo systemctl enable --now team
  4. In production, terminate TLS with a reverse proxy such as Nginx and set TEAM_DOMAIN to the public URL (e.g. https://team.example.com).

License

MIT License

Copyright (c) 2019 Dongri Jin

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

About

Free Knowledge Groupware

Topics

Resources

Stars

62 stars

Watchers

4 watching

Forks

Releases

Sponsor this project

Packages

Used by

Contributors

Languages