Skip to content

el-mike/gochat

Repository files navigation

gochat

build Go Report Card License

Gochat is a simple chatting application, created for learning purposes.

Running the application

  1. Gochat uses godotenv to store local env variables. Add .env file to the root directory, with following structure:
POSTGRES_USER=
POSTGRES_PASSWORD=
POSTGRES_DB=
POSTGRES_PORT=
POSTGRES_HOST=

PGADMIN_DEFAULT_EMAIL=
PGADMIN_DEFAULT_PASSWORD=

REDIS_HOST=
REDIS_PORT=
REDIS_PASSWORD=

API_SECRET=

GOCHAT_ADMIN_PASSWORD=
GOCHAT_ADMIN_EMAIL=

  1. Run go install to compile and install all required packages and dependencies.
  2. Run docker-compose up to start Gochat API and all required dependencies.

Debugging

There is VSC launch configuration available in the repository. In order to run Gochat API using VSC debugging, run docker-compose up postgres redis or ./scripts/run_deps.sh, and then start [Gochat] Launch API VSC configuration.

Development

Prerequisites

  1. Install golangci-lint
  2. Set your IDE to use golangci-lint (instructions)
  3. Install python3
  4. Run git config core.hooksPath .githooks to wire up project's git hooks
  5. Install migrate CLI

Conventions

This repository follows ConventionalCommits specification for creating commit messages. There is prepare-commit-msg hook set up to ensure following those rules. Branch names should also reflect the type of work it contains - one of following should be used:

  • feature/<task-description>
  • bugfix/<task-description>
  • chore/<task-description>