Skip to content

Commit a1ff963

Browse files
committed
chore: add readme to hachimitsu
1 parent bca3d04 commit a1ff963

1 file changed

Lines changed: 100 additions & 0 deletions

File tree

apps/hachimitsu/README.md

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
<p align="center">
2+
<a href="https://discord.gg/UttZbEd9zn" target="blank"><img src="https://raw.githubusercontent.com/jurienhamaker/Yugen/main/assets/hachimitsu%20sticker.png" width="200" alt="Hachimitsu logo" /></a>
3+
</p>
4+
5+
<p align="center">A automatic banning honeypot bot for <a href="http://discord.com" target="_blank">Discord</a>.</p>
6+
<p align="center">
7+
<img src="https://img.shields.io/github/license/jurrienhamaker/yugen" alt="Package License" />
8+
<img src="https://img.shields.io/github/actions/workflow/status/jurienhamaker/yugen/hachimitsu.yml" alt="CircleCI" />
9+
<a href="https://discord.gg/UttZbEd9zn" target="_blank"><img src="https://img.shields.io/badge/discord-online-brightgreen.svg" alt="Discord"/></a>
10+
</p>
11+
<!--[![Backers on Open Collective](https://opencollective.com/nest/backers/badge.svg)](https://opencollective.com/nest#backer)
12+
[![Sponsors on Open Collective](https://opencollective.com/nest/sponsors/badge.svg)](https://opencollective.com/nest#sponsor)-->
13+
14+
## Running Hachimitsu
15+
16+
### Getting started
17+
18+
```bash
19+
git clone [email protected]:jurienhamaker/yugen.git
20+
```
21+
22+
**Copy the `.env.example` to `.env` and change the values in the `.env` file**
23+
**Copy the `apps/hachimitsu/.env.example` to `apps/hachimitsu/.env` and change the values in the `.env` file**
24+
25+
---
26+
27+
### Docker (Recommended)
28+
29+
#### Prerequisite
30+
31+
- [Docker](https://www.docker.com/)
32+
33+
### Running the app
34+
35+
Migrations will automatically run when the bot starts.
36+
37+
```bash
38+
docker-compose up -d db
39+
docker-compose up hachimitsu
40+
```
41+
42+
### Running migrations separately
43+
44+
```bash
45+
docker-compose exec -it hachimitsu make hachimitsu-migrate
46+
```
47+
48+
---
49+
50+
### Go
51+
52+
#### Prerequisite
53+
54+
- [go 1.25](https://go.dev/doc/install)
55+
- [PostgresDB](https://www.postgresql.org/)
56+
- [Atlas CLI](https://atlasgo.io/docs#installation)
57+
58+
### Building the bot & running the bot
59+
60+
```bash
61+
# watch mode (recommended)
62+
$ make hachimitsu
63+
64+
# production mode
65+
$ make hachimitsu-build
66+
$ ./dist/hachimitsu
67+
```
68+
69+
### Running migrations
70+
71+
Migrations use [Ent](https://entgo.io/) for the ORM and [Atlas](https://atlasgo.io/) for schema migrations.
72+
73+
```bash
74+
# Apply pending migrations
75+
$ make hachimitsu-migrate
76+
77+
# Move to hachimitsu directory
78+
$ cd apps/hachimitsu
79+
80+
# Generate a new migration after schema changes
81+
$ make migrate-diff name=<migration_name>
82+
83+
# Validate migration checksums
84+
$ make migrate-validate
85+
86+
# Regenerate Ent code after schema changes
87+
$ make ent-generate
88+
```
89+
90+
---
91+
92+
## Stay in touch
93+
94+
- Author - [Jurien Hamaker](https://jurien.dev)
95+
- Website - [jurien.dev](https://jurien.dev/)
96+
- Ko-Fi - [ko-fi.com/jurienhamaker](https://ko-fi.com/jurienhamaker)
97+
98+
## License
99+
100+
Hachimitsu is [GPL licensed](../../LICENSE).

0 commit comments

Comments
 (0)