Skip to content

Commit

Permalink
refactor: making it even more friendly
Browse files Browse the repository at this point in the history
  • Loading branch information
dd84ai committed Jun 8, 2024
1 parent 17e53b7 commit 776845e
Showing 1 changed file with 41 additions and 35 deletions.
76 changes: 41 additions & 35 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,54 +27,50 @@

![forum tracking notifications](docs/index_assets/forum_tracking.png)

# Architecture
# Getting started with development:

The project has 5 package parts parts:
- create your own Discord app link and invite it to some Discord server
- If you are me, then just use your dev env inviting link you already created:

- scrappy scraps third party REST APIs and web forum for data. Stores in in storage (memory) to other modules
- configurator is interacting with SQL database to store user settings
- listener is Discord API connected application, that accepts user commands from channel and sends to consoler, and gives from it answer
- consoler is a CLI interface to accept input from listener and render its CLI answer back
- viewer is application that in a loop gets user settings and connected channels, and rerenders to them view based on available data in scrappy and configurator settings
- https://discord.com/api/oauth2/authorize?client_id=1071516990348460033&permissions=8&scope=bot
- Ensure you have set [Environment variables](./.vscode/settings.example.json) documented in .vscode

![architecture, TODO refactor to mermaid.js](architecture/architecture.drawio.svg)
- [App specific configurations](./app/settings/main.go) can be found here.
- Launch app as `go run . run` (see `go run . --help` for other available commands)
- Visit your Discord server again where bot is connected. Select empty channel and write `; connect`

# Tech stack
- By default Console prefix to use command is `;`. Seee `; --help` for other commands.
- Try smth list `; base tags list`
- Optionally install [Taskfile](https://taskfile.dev/usage/)

- golang
- discordgo
- cobra-cli
- gorm (sqlite3)
- docker
- terraform (hetzner / docker cli ami image)
- terraform docker provider

# Dev commands

install taskfile.dev for dev commands
- and run dev commands like `task test` for running unit tests
- or see them inside [Taskfile](Taskfile.yml) for manual copy pasting to shell
- `task --list-all` to list available commands

go run . --help
If you wish making changes to mkdocs:

task test # to test
task --list-all # to list other commands
- We use static site generator via mkdocs to document stuff for end users
- install preferably [Taskfile](https://taskfile.dev/usage/) or peak commands in it for manual copy pasting
- Install python3 of version no less than it is mention in [CI file](.github/workflows/pages.yml)
- run `task mkdocs:dev` to open web server with documentation at http://127.0.0.1:8000/ , then change files in [/docs](docs/index.md) folder

See [Taskfile.yml](<./Taskfile.yml>) for the rest of available dev commands
Note for deployment

# Dev Configurations:
- The project depends on having two private URL from Discovery API for its running. Provided by Alex.
- Development is possible without them as with env var you can mock data receved from them.
- by default DEV_ENV_MOCK_API=true for convinience of easier getting started

- create your own Discord app link and use it for development
by providing it through [Environment variables documentated there](./.vscode/settings.example.json)
# Architecture

- If you are me, then just use your dev env inviting link you already created:
- https://discord.com/api/oauth2/authorize?client_id=1071516990348460033&permissions=8&scope=bot
The project has 5 package parts parts:

- [App specific configurations](./app/settings/main.go) can be found here.
- By default Console prefix to use command is `;`. Like `; --help` for dev env.
- We use README for dev specific stuff to documetn
- We use static site generator via mkdocs to document stuff for end users
- scrappy scraps third party REST APIs and web forum for data. Stores in in storage (memory) to other modules
- configurator is interacting with SQL database to store user settings
- listener is Discord API connected application, that accepts user commands from channel and sends to consoler, and gives from it answer
- consoler is a CLI interface to accept input from listener and render its CLI answer back
- viewer is application that in a loop gets user settings and connected channels, and rerenders to them view based on available data in scrappy and configurator settings

- The project depends on having two private URL from Discovery API for its running. Provided by Alex.
- Development is possible without them as with env var you can mock data receved from them.
![architecture, TODO refactor to mermaid.js](architecture/architecture.drawio.svg)

# Dev standards

Expand All @@ -85,6 +81,16 @@ by providing it through [Environment variables documentated there](./.vscode/set
- Keep amount of dependencies low for easier long term maintanance. (TODO Recheck which dependencies u can delete later)
- To simplify long term maintanance, dependencies will be vendored in.

# Tech stack

- golang
- discordgo
- cobra-cli
- gorm (sqlite3)
- docker
- terraform (hetzner / docker cli ami image)
- terraform docker provider

# Project status

- Finished its core development of features
Expand Down

0 comments on commit 776845e

Please sign in to comment.