Skip to content

Commit cc5bc74

Browse files
committed
refactor: migrate naming to StackClass and update license headers
1 parent fbe741b commit cc5bc74

61 files changed

Lines changed: 148 additions & 136 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.env.example

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
PORT=8080
33

44
# The path to git repositories.
5-
REPO_DIR=/tmp/codecraft/repos/
5+
REPO_DIR=/tmp/stackclass/repos/
66

77
# Base directory for storing cached repositories.
8-
CACHE_DIR=/tmp/codecraft/caches
8+
CACHE_DIR=/tmp/stackclass/caches
99

1010
# Database connection URL.
11-
DATABASE_URL=postgres://user:pass@localhost/db
11+
DATABASE_URL=postgresql://stackclass:123456@localhost/stackclass
1212

1313
# Allowed CORS origin.
1414
ALLOWED_ORIGIN=*

.github/workflows/docker.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
platform: [linux/amd64, linux/arm64]
2020
steps:
2121
- name: Set environment variable
22-
run: echo "IMAGE_NAME=ghcr.io/${{ github.repository_owner }}/codecraft-server" >> $GITHUB_ENV
22+
run: echo "IMAGE_NAME=ghcr.io/${{ github.repository_owner }}/stackclass-server" >> $GITHUB_ENV
2323

2424
- name: Checkout repository
2525
uses: actions/checkout@v4
@@ -73,7 +73,7 @@ jobs:
7373
needs: build
7474
steps:
7575
- name: Set environment variable
76-
run: echo "IMAGE_NAME=ghcr.io/${{ github.repository_owner }}/codecraft-server" >> $GITHUB_ENV
76+
run: echo "IMAGE_NAME=ghcr.io/${{ github.repository_owner }}/stackclass-server" >> $GITHUB_ENV
7777

7878
- name: Download digests
7979
uses: actions/download-artifact@v4

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ jobs:
5050
target: ${{ matrix.target }}
5151
- uses: taiki-e/upload-rust-binary-action@v1
5252
with:
53-
bin: codecraft-server
54-
archive: codecraft-server-${{ matrix.platform }}
53+
bin: stackclass-server
54+
archive: stackclass-server-${{ matrix.platform }}
5555
target: ${{ matrix.target }}
5656
token: ${{ secrets.GITHUB_TOKEN }}
5757
include: LICENSE,README.md

.gitmodules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[submodule "samples/build-your-own-interpreter"]
22
path = samples/build-your-own-interpreter
3-
url = https://github.com/wangeguo/build-your-own-interpreter.git
3+
url = https://github.com/stackclass/build-your-own-interpreter.git

CONTRIBUTING.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Before submitting your contribution, please take a moment to read the following
88
### Reporting Issues
99

1010
If you find a bug or have a feature request, please first check the
11-
[issue tracker](https://github.com/wangeguo/codecraft-server/issues)
11+
[issue tracker](https://github.com/stackclass/backend/issues)
1212
to see if the issue already exists. If it doesn't, please create a new issue
1313
and provide as much detail as possible, including:
1414

@@ -25,8 +25,8 @@ and provide as much detail as possible, including:
2525
2. **Clone the Repository**: Clone the forked repository to your local machine.
2626

2727
```bash
28-
git clone https://github.com/wangeguo/codecraft-server.git
29-
cd codecraft-server
28+
git clone https://github.com/stackclass/backend.git
29+
cd backend
3030
```
3131

3232
3. **Create a Branch**: Create a new branch for your changes.

Cargo.lock

Lines changed: 34 additions & 34 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
[package]
2-
name = "codecraft-server"
3-
description = "CodeCraft Backend Server"
4-
version = "0.17.0"
2+
name = "backend"
3+
description = "Backend API and services for StackClass"
4+
version = "0.18.0"
55
edition = "2021"
66

7-
default-run = "codecraft-server"
7+
default-run = "stackclass-server"
88

99
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
1010

1111
[lib]
12-
name = "codecraft"
12+
name = "stackclass"
1313
path = "src/lib.rs"
1414

1515
[[bin]]
16-
name = "codecraft-server"
17-
path = "src/bin/codecraft-server.rs"
16+
name = "stackclass-server"
17+
path = "src/bin/stackclass-server.rs"
1818

1919
[[bin]]
2020
name = "openapi-generator"

Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ RUN cargo chef cook --release --recipe-path recipe.json
3838
# all layers should be cached.
3939

4040
COPY . .
41-
RUN cargo build --release --bin codecraft-server
41+
RUN cargo build --release --bin stackclass-server
4242

4343
################################################################################
4444
# Create a final stage for running your application.
@@ -54,10 +54,10 @@ FROM gcr.io/distroless/cc-debian12:nonroot AS runtime
5454
# Copy the executable from the "building" stage.
5555
COPY --from=builder \
5656
--chown=nonroot:nonroot \
57-
/app/target/release/codecraft-server \
57+
/app/target/release/stackclass-server \
5858
/usr/local/bin/
5959

6060
EXPOSE 8080
6161

6262
# What the container should run when it is started
63-
ENTRYPOINT ["/usr/local/bin/codecraft-server"]
63+
ENTRYPOINT ["/usr/local/bin/stackclass-server"]

README.md

Lines changed: 28 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,23 @@
1-
# codecraft-server
1+
# Backend API and services for StackClass
22

3-
CodeCraft Backend Server
4-
5-
[![License](https://img.shields.io/github/license/wangeguo/codecraft-server)](https://github.com/wangeguo/codecraft-server/blob/master/LICENSE)
6-
[![GitHub contributors](https://img.shields.io/github/contributors/wangeguo/codecraft-server)](https://github.com/wangeguo/codecraft-server/graphs/contributors)
7-
[![GitHub issues](https://img.shields.io/github/issues/wangeguo/codecraft-server)](https://github.com/wangeguo/codecraft-server/issues)
3+
[![License](https://img.shields.io/github/license/stackclass/backend)](https://github.com/stackclass/backend/blob/master/LICENSE)
4+
[![GitHub contributors](https://img.shields.io/github/contributors/stackclass/backend)](https://github.com/stackclass/backend/graphs/contributors)
5+
[![GitHub issues](https://img.shields.io/github/issues/stackclass/backend)](https://github.com/stackclass/backend/issues)
86

97
## Installation
108

119
Prebuilt binaries Windows, Linux and macOS can be downloaded from the
12-
[Github release page](https://github.com/wangeguo/codecraft-server/releases/latest).
10+
[Github release page](https://github.com/stackclass/backend/releases/latest).
1311
If there is no distro package available in your preferred manager,
1412
you need [Rust and cargo](https://www.rust-lang.org/tools/install) to build it.
1513

1614
### Install from source:
1715

18-
1. Clone the repository with `git clone https://github.com/wangeguo/codecraft-server.git`
19-
2. From the `codecraft-server` directory, run `cargo build --release` to
16+
1. Clone the repository with `git clone https://github.com/stackclass/backend.git`
17+
2. From the `stackclass-server` directory, run `cargo build --release` to
2018
build the application in release mode.
2119
3. After a successful compilation, launch the executable with:
22-
`target/release/codecraft-server`.
20+
`target/release/stackclass-server`.
2321

2422
### Install with cargo
2523

@@ -28,7 +26,7 @@ version from git. However, this is not fully tested. That means you're probably
2826
going to have more bugs despite having the latest bug fixes.
2927

3028
```
31-
cargo install --git https://github.com/wangeguo/codecraft-server
29+
cargo install --git https://github.com/stackclass/backend
3230
```
3331

3432
This will download the source from the main branch, build and install it in
@@ -37,14 +35,25 @@ Cargo's global binary directory (`~/.cargo/bin/` by default).
3735
## Usage
3836

3937
```text
40-
Usage: codecraft-server [OPTIONS] --repo-dir <REPO_DIR> --cache-dir <CACHE_DIR>
38+
Usage: stackclass-server [OPTIONS] --repo-dir <REPO_DIR> --cache-dir <CACHE_DIR> --database-url <DATABASE_URL> --git-server-endpoint <GIT_SERVER_ENDPOINT>
4139
4240
Options:
43-
--port <PORT> The Server port [env: PORT] [default: 8080]
44-
--repo-dir <REPO_DIR> The path to git repositories [env: REPO_DIR]
45-
--cache-dir <CACHE_DIR> Base directory for storing cached repositories [env: CACHE_DIR]
46-
--github-token <GITHUB_TOKEN> A personal token to use for authentication [env: GITHUB_TOKEN]
47-
-h, --help Print help
41+
--port <PORT>
42+
The Server port [env: PORT=8080] [default: 8080]
43+
--repo-dir <REPO_DIR>
44+
The path to git repositories [env: REPO_DIR=/tmp/stackclass/repos/]
45+
--cache-dir <CACHE_DIR>
46+
Base directory for storing cached repositories [env: CACHE_DIR=/tmp/stackclass/caches]
47+
--github-token <GITHUB_TOKEN>
48+
A personal token to use for authentication [env: GITHUB_TOKEN=]
49+
--database-url <DATABASE_URL>
50+
Database connection URL [env: DATABASE_URL=postgresql://stackclass:123456@localhost/stackclass]
51+
--allowed-origin <ALLOWED_ORIGIN>
52+
Allowed CORS origin [env: ALLOWED_ORIGIN=*]
53+
--git-server-endpoint <GIT_SERVER_ENDPOINT>
54+
Git server endpoint [env: GIT_SERVER_ENDPOINT=http://localhost:8080/git]
55+
-h, --help
56+
Print help
4857
```
4958

5059
## Development
@@ -57,7 +66,7 @@ To build this project, you will need to install the following pre-requisites:
5766
Clone the Repository
5867

5968
```bash
60-
git clone --recurse-submodules https://github.com/wangeguo/codecraft-server.git
69+
git clone --recurse-submodules https://github.com/stackclass/backend.git
6170
```
6271

6372
*(If you’ve already cloned the repository without submodules, run `git submodule update --init --recursive` to initialize them.)*
@@ -75,7 +84,7 @@ submitting pull requests to the project.
7584

7685
## License
7786

78-
Copyright (c) wangeguo. All rights reserved.
87+
Copyright (c) The StackClass Authors. All rights reserved.
7988

8089
Licensed under the Apache License, Version 2.0 (the "License");
8190
you may not use this file except in compliance with the License.

justfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,4 @@ all:
4545

4646
# Run the main program
4747
run:
48-
cargo run --bin codecraft-server
48+
cargo run --bin stackclass-server

0 commit comments

Comments
 (0)