Skip to content

Commit cd08455

Browse files
authored
Merge pull request #19 from SkyCryptWebsite/dev
bump prod
2 parents b5418c6 + 80fae0a commit cd08455

5 files changed

Lines changed: 203 additions & 162 deletions

File tree

NotEnoughUpdates-REPO

README.md

Lines changed: 194 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,194 @@
1+
<p align="center">
2+
<picture>
3+
<source media="(prefers-color-scheme: light)" srcset="static/img/logo_black.avif">
4+
<img alt="SkyCrypt" height="96px" src="https://github.com/SkyCryptWebsite/SkyCrypt-Frontend/raw/dev/static/img/logo.avif">
5+
</picture>
6+
</p>
7+
<h1 align="center">SkyCrypt Backend</h1>
8+
<h3 align="center">A Hypixel SkyBlock Profile Viewer</h3>
9+
10+
<p align="center">
11+
<a href="https://www.patreon.com/shiiyu"><img alt="Sponsor" src="https://img.shields.io/badge/sponsor-30363D?style=for-the-badge&logo=GitHub-Sponsors&logoColor=#white" /></a>
12+
&nbsp;
13+
<a href="https://github.com/SkyCryptWebsite/SkyCrypt-Backend/stargazers"><img alt="GitHub Repo stars" src="https://img.shields.io/github/stars/SkyCryptWebsite/SkyCrypt-Backend?style=for-the-badge" /></a>
14+
</p>
15+
16+
A high-performance Go backend API for [SkyCrypt](https://github.com/SkyCryptWebsite/SkyCrypt), providing statistics and data processing for Hypixel SkyBlock players.
17+
18+
Originally inspired by [LeaPhant's skyblock-stats](https://github.com/LeaPhant/skyblock-stats).
19+
20+
**Website**: https://sky.shiiyu.moe \
21+
**Development Website**: https://cupcake.shiiyu.moe
22+
23+
**Frontend**: [SkyCrypt-Frontend](https://github.com/SkyCryptWebsite/SkyCrypt-Frontend)
24+
25+
## Table of Contents
26+
27+
- [Requirements](#requirements)
28+
- [Installation](#installation)
29+
- [System Dependencies](#system-dependencies)
30+
- [Go Installation](#go-installation)
31+
- [Redis Installation](#redis-installation)
32+
- [MongoDB Installation](#mongodb-installation)
33+
- [Configuration](#configuration)
34+
- [Development](#development)
35+
- [Common Issues](#common-issues)
36+
37+
## Requirements
38+
39+
- Go 1.25.1 or later
40+
- Redis 7.0 or later
41+
- MongoDB 6.0 or later
42+
- Git (for submodule initialization)
43+
44+
## Installation
45+
46+
The following instructions are written for Arch Linux. Adjust package manager commands accordingly for other distributions.
47+
48+
### System Dependencies
49+
50+
Update your system and install essential build tools:
51+
52+
```bash
53+
sudo pacman -Syu
54+
sudo pacman -S base-devel git
55+
```
56+
57+
### Go Installation
58+
59+
Install Go from the official Arch Linux repositories:
60+
61+
```bash
62+
sudo pacman -S go
63+
```
64+
65+
Verify the installation:
66+
67+
```bash
68+
go version
69+
```
70+
71+
### Redis Installation
72+
73+
Install Redis:
74+
75+
```bash
76+
sudo pacman -S redis
77+
```
78+
79+
Enable and start the Redis service:
80+
81+
```bash
82+
sudo systemctl enable redis
83+
sudo systemctl start redis
84+
```
85+
86+
Verify Redis is running:
87+
88+
```bash
89+
redis-cli ping
90+
```
91+
92+
Expected output: `PONG`
93+
94+
### MongoDB Installation
95+
96+
Install MongoDB from the AUR. Using an AUR helper such as `yay`:
97+
98+
```bash
99+
yay -S mongodb-bin
100+
```
101+
102+
Alternatively, build from source:
103+
104+
```bash
105+
git clone https://aur.archlinux.org/mongodb-bin.git
106+
cd mongodb-bin
107+
makepkg -si
108+
```
109+
110+
Enable and start the MongoDB service:
111+
112+
```bash
113+
sudo systemctl enable mongodb
114+
sudo systemctl start mongodb
115+
```
116+
117+
Verify MongoDB is running:
118+
119+
```bash
120+
mongosh --eval "db.runCommand({ ping: 1 })"
121+
```
122+
123+
## Configuration
124+
125+
### Environment Variables
126+
127+
Create a `.env` file in the project root directory. Use `.env.example` as a template:
128+
129+
```bash
130+
cp .env.example .env
131+
```
132+
133+
Edit the `.env` file with your configuration:
134+
135+
```dotenv
136+
HYPIXEL_API_KEY=""
137+
DISCORD_WEBHOOK=""
138+
DEV="true"
139+
ENABLE_ARMOR_HEX="false"
140+
MONGO_URI="mongodb://localhost:27017"
141+
MONGO_DB_NAME="SkyCrypt"
142+
```
143+
144+
### Environment Variable Reference
145+
146+
| Variable | Description | Default | Required |
147+
|----------|-------------|---------|----------|
148+
| `HYPIXEL_API_KEY` | Your Hypixel API key. Obtain from [Hypixel Developer Portal](https://developer.hypixel.net/) | - | Yes |
149+
| `DISCORD_WEBHOOK` | Discord webhook URL for error notifications and startup messages | - | No |
150+
| `DEV` | Enable development mode. Set to `true` for local development | `false` | No |
151+
| `ENABLE_ARMOR_HEX` | Enable hexadecimal armor color support | `false` | No |
152+
| `MONGO_URI` | MongoDB connection URI | `mongodb://localhost:27017` | No |
153+
| `MONGO_DB_NAME` | MongoDB database name | `SkyCrypt` | No |
154+
| `REDIS_HOST` | Redis server hostname | `localhost` | No |
155+
| `REDIS_PORT` | Redis server port | `6379` | No |
156+
| `REDIS_PASSWORD` | Redis authentication password | - | No |
157+
158+
## Development
159+
160+
Clone the repository with submodules:
161+
162+
```bash
163+
git clone --recurse-submodules https://github.com/SkyCryptWebsite/SkyCrypt-Backend.git
164+
cd SkyCrypt-Backend
165+
```
166+
167+
If you have already cloned the repository without submodules:
168+
169+
```bash
170+
git submodule update --init --recursive
171+
```
172+
173+
Download Go dependencies:
174+
175+
```bash
176+
go mod download
177+
```
178+
179+
Run the application:
180+
181+
```bash
182+
go run main.go
183+
```
184+
185+
## Common Issues
186+
187+
### Submodule Not Initialized
188+
189+
If the `NotEnoughUpdates-REPO` directory is empty:
190+
191+
```bash
192+
git submodule update --init --recursive
193+
```
194+

go.mod

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ require (
99
github.com/gofiber/fiber/v2 v2.52.9
1010
github.com/joho/godotenv v1.5.1
1111
github.com/swaggo/swag/v2 v2.0.0-rc4
12-
github.com/yokeTH/gofiber-scalar v0.1.1
12+
go.mongodb.org/mongo-driver v1.17.6
1313
)
1414

1515
// replace github.com/DuckySoLucky/SkyCrypt-Types => ../SkyCrypt-Types
@@ -35,15 +35,10 @@ require (
3535
github.com/go-openapi/jsonpointer v0.22.1 // indirect
3636
github.com/go-openapi/jsonreference v0.21.2 // indirect
3737
github.com/go-openapi/spec v0.22.0 // indirect
38-
github.com/go-openapi/swag v0.25.1 // indirect
39-
github.com/go-openapi/swag/cmdutils v0.25.1 // indirect
4038
github.com/go-openapi/swag/conv v0.25.1 // indirect
41-
github.com/go-openapi/swag/fileutils v0.25.1 // indirect
4239
github.com/go-openapi/swag/jsonname v0.25.1 // indirect
4340
github.com/go-openapi/swag/jsonutils v0.25.1 // indirect
4441
github.com/go-openapi/swag/loading v0.25.1 // indirect
45-
github.com/go-openapi/swag/mangling v0.25.1 // indirect
46-
github.com/go-openapi/swag/netutils v0.25.1 // indirect
4742
github.com/go-openapi/swag/stringutils v0.25.1 // indirect
4843
github.com/go-openapi/swag/typeutils v0.25.1 // indirect
4944
github.com/go-openapi/swag/yamlutils v0.25.1 // indirect
@@ -60,20 +55,15 @@ require (
6055
github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 // indirect
6156
github.com/skeema/knownhosts v1.3.1 // indirect
6257
github.com/sv-tools/openapi v0.2.1 // indirect
63-
github.com/swaggo/fiber-swagger v1.3.0 // indirect
64-
github.com/swaggo/files v1.0.1 // indirect
65-
github.com/swaggo/swag v1.16.6 // indirect
6658
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
6759
github.com/xanzy/ssh-agent v0.3.3 // indirect
6860
github.com/xdg-go/pbkdf2 v1.0.0 // indirect
6961
github.com/xdg-go/scram v1.1.2 // indirect
7062
github.com/xdg-go/stringprep v1.0.4 // indirect
7163
github.com/youmark/pkcs8 v0.0.0-20240726163527-a2c0da244d78 // indirect
72-
go.mongodb.org/mongo-driver v1.17.6 // indirect
7364
go.yaml.in/yaml/v3 v3.0.4 // indirect
7465
golang.org/x/arch v0.21.0 // indirect
7566
golang.org/x/crypto v0.43.0 // indirect
76-
golang.org/x/mod v0.29.0 // indirect
7767
golang.org/x/net v0.46.0 // indirect
7868
golang.org/x/sync v0.17.0 // indirect
7969
golang.org/x/tools v0.38.0 // indirect
@@ -93,10 +83,9 @@ require (
9383
github.com/mattn/go-colorable v0.1.14 // indirect
9484
github.com/mattn/go-isatty v0.0.20 // indirect
9585
github.com/mattn/go-runewidth v0.0.19 // indirect
96-
github.com/rivo/uniseg v0.4.7 // indirect
9786
github.com/valyala/bytebufferpool v1.0.0 // indirect
9887
github.com/valyala/fasthttp v1.67.0 // indirect
99-
golang.org/x/exp v0.0.0-20250718183923-645b1fa84792
88+
golang.org/x/exp v0.0.0-20250718183923-645b1fa84792 // indirect
10089
golang.org/x/sys v0.37.0 // indirect
10190
golang.org/x/text v0.30.0
10291
)

0 commit comments

Comments
 (0)