Skip to content

ChatDan/chatdan_backend

Repository files navigation

Contributors Forks Stargazers Issues Apache License


ChatDan Backend

a message box and 'biaobai' platform for Fudaners
Explore the docs »

View Demo · Report Bug · Request Feature

About The Project

a message box and 'biaobai' platform for Fudaners

Built With

Go Swagger

Getting Started

Build and Run locally

run

git clone https://github.com/ChatDan/chatdan_backend.git
cd chatdan_backend
# install swag and generate docs
go install github.com/swaggo/swag/cmd/swag@latest
swag init --parseInternal --parseDepth 1 # to generate the latest docs, this should be run before compiling
# build for debug
go build -o chatdan.exe
# build for release
go build -ldflags "-s -w" -o chatdan.exe
# run
export STANDALONE=true
./treehole.exe

For documentation, please open http://localhost:8000/docs after running app

test

export MODE=test
go test -v ./tests/...

benchmark

export MODE=bench
go test -v -benchmem -cpuprofile=cpu.out -benchtime=1s ./benchmarks/... -bench .

Production Deploy

Install mysql and redis. Quick start using docker.

docker run -d --name mysql \
  -e MYSQL_PASSWORD={MYSQL_PASSWORD} \
  mysql:latest
  
docker run -d --name redis redis:latest

then Install Apisix for API Gateway and jwt-auth. Please follow Apisix Documentation

then start container

docker run -d --name chatdan_backend \
  -e DB_URL={DB_URL} \
  -e REDIS_URL={REDIS_URL} \
  -e APISIX_URL={APISIX_URL} \
  -e APISIX_ADMIN_KEY={APISIX_ADMIN_KEY} \
  jingyijun3104/chatdan_backend:latest

Usage

For more examples, please refer to the Documentation

Roadmap

  • user management
  • message box
  • chat
  • hole and floor
  • wall

See the open issues for a full list of proposed features (and known issues).

Contributors

This project exists thanks to all the people who contribute.

contributors

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

Distributed under the Apache 2.0 License. See LICENSE.txt for more information.

Contact

JingYiJun - [email protected]

Project Link: https://github.com/ChatDan/chatdan_backend

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published