Skip to content

Commit

Permalink
refactor!: ground up rewrite
Browse files Browse the repository at this point in the history
  • Loading branch information
AlphaKeks committed Dec 13, 2023
1 parent 53fd97f commit f2be2dd
Show file tree
Hide file tree
Showing 128 changed files with 7,068 additions and 6,397 deletions.
3 changes: 3 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
[build]
rustdocflags = "-D warnings"

[profile.dev.package."*"]
opt-level = 3
Empty file added .clippy.toml
Empty file.
3 changes: 0 additions & 3 deletions .dockerignore

This file was deleted.

7 changes: 3 additions & 4 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
# Editor-agnostic settings.
#
# See <https://editorconfig.org/> for more information.
# https://editorconfig.org

root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = tab

[*.{nix,toml,yml,md}]
[*.{md,toml,yml,nix}]
indent_style = space
indent_size = 2
8 changes: 8 additions & 0 deletions .env.docker
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# These are overrides necessary for docker.
# If the API is going to run in a container, it needs to reference the other container by its name
# rather than IP and also use the default database port.
#
# These will be added to the database container automatically and you should not need to change
# them.
DATABASE_PORT=3306
DATABASE_URL=mysql://kz:csgo-kz-is-dead-boys@cs2kz-database:3306/cs2kz
17 changes: 11 additions & 6 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
API_IP=127.0.0.1
API_PORT=42069
API_PUBLIC_URL=http://127.0.0.1:42069
# Database
DATABASE_PORT=8070

DATABASE_URL=mysql://kz:csgo-kz-is-dead-boys@127.0.0.1:8070/cs2kz-api
# Note: we cannot interpolate `$DATABASE_PORT` here because Rust will not recursively evaluate
# nested environment variables when loading them with `std::env::var`.
DATABASE_URL=mysql://kz:csgo-kz-is-dead-boys@127.0.0.1:8070/cs2kz

# For docker
# DATABASE_URL=mysql://kz:csgo-kz-is-dead-boys@cs2kz-database:3306/cs2kz-api
# API
RUST_LOG=cs2kz_api=trace,sqlx=debug,axum=trace,warn
KZ_API_IP=127.0.0.1
KZ_API_PORT=42069
KZ_API_URL=https://cs2.kz
KZ_API_JWT_SECRET=Y3Nnby1rei1pcy1kZWFkLWJveXMK
23 changes: 8 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: CS2KZ API CI
name: CS2KZ API

on:
push:
Expand All @@ -9,39 +9,32 @@ env:
CARGO_TERM_COLOR: always

jobs:
lint:
name: Clippy
compile:
name: Compilation and Linting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: moonrepo/setup-rust@v1
with:
components: clippy
- run: make lint
- run: cargo clippy --all-features --workspace -- -D warnings

format:
name: RustFmt
name: Formatting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: moonrepo/setup-rust@v1
with:
channel: nightly
components: rustfmt
- run: make format-check
- run: cargo +nightly fmt --all

docs:
name: Documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: moonrepo/setup-rust@v1
- run: make docs

spech-check:
name: OpenAPI Spec Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: moonrepo/setup-rust@v1
- run: make spec-check
- run: cargo doc --all-features --workspace --document-private-items --no-deps
- run: cargo run --package cs2kz-api-spec-generator -- --check api-spec.json
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.direnv
target
database/volumes/**
database/volumes
.direnv
.env
2 changes: 0 additions & 2 deletions .rustfmt.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# For details on what these mean visit this website:
#
# https://rust-lang.github.io/rustfmt?version=v1.7.0

edition = "2021"
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

This file was deleted.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

This file was deleted.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

This file was deleted.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

This file was deleted.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit f2be2dd

Please sign in to comment.