Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Backend Rewrite #457

Draft
wants to merge 40 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
c9659f9
feat(backend): remove old backend
KavikaPalletenne Oct 5, 2023
d6b5fa4
feat(backend): add README for new backend structure
KavikaPalletenne Oct 5, 2023
262445e
feat(backend): Update README.md to include postgres in techstack
KavikaPalletenne Oct 7, 2023
0f7c413
feat(backend): add OAuth2 token and email fetching for Google callback
KavikaPalletenne Oct 25, 2023
15a51dc
Merge remote-tracking branch 'origin/CHAOS-224-KHAOS-rewrite' into CH…
KavikaPalletenne Oct 25, 2023
fe3d0e2
feat(backend): add prisma-cli and design schema
dhj03 Oct 25, 2023
aadc37c
fix(backend): add migrations to .gitignore
dhj03 Oct 25, 2023
2c2ce07
fix(backend): add .idea folder to .gitignore
KavikaPalletenne Oct 27, 2023
888a9f0
Implement extractors for AuthUser and SuperUser (#458)
KavikaPalletenne Feb 11, 2024
03a4877
OAuth flow account creation/login (#460)
KavikaPalletenne Feb 11, 2024
f442048
fix(backend): Add dotenvy to server and prisma (#466)
KavikaPalletenne Mar 29, 2024
88da782
feat(ci): add postgres and migration to actions workflow (#467)
KavikaPalletenne Mar 29, 2024
7398aa2
fix(ci): Fix incorrect working directory in Rust workflow file (#468)
KavikaPalletenne Mar 29, 2024
0e75ddf
fix(ci): Fix build errors and cargo fmt/clippy (#469)
KavikaPalletenne Mar 29, 2024
9ee127c
fix(ci): rust-cache keys and cargo fmt working directory fix (#470)
KavikaPalletenne Mar 29, 2024
7e9d7c7
fix(ci): rust-cache workspaces fix (#471)
KavikaPalletenne Mar 29, 2024
70eda4b
fix(ci): cargo fmt remove manifest-path arg (#472)
KavikaPalletenne Mar 29, 2024
46b104d
API Spec for Users and Organisations (#477)
KavikaPalletenne Apr 5, 2024
8ef0cca
Draft API Documentation for User, Organisation and Campaign (#478)
KavikaPalletenne Apr 6, 2024
80556ba
feat(backend): Switch from Prisma schema to SQL schema (#479)
KavikaPalletenne Apr 6, 2024
c1b4fb7
fix(backend): Create index on lower(email)
KavikaPalletenne Apr 7, 2024
048f0fe
Update backend README.md
KavikaPalletenne Apr 7, 2024
d6d581a
feat(backend): Rust error handling with anyhow & custom types (#482)
KavikaPalletenne Apr 7, 2024
37595e4
add operationId's to api spec
KavikaPalletenne Apr 14, 2024
84f6324
Add JSON version of api spec
KavikaPalletenne Apr 14, 2024
1405e97
Error handling with `thiserror` (#494)
KavikaPalletenne Jun 28, 2024
5fe7add
Organisations CRUD (#485)
alexlai18 Jun 28, 2024
16972da
feat(backend): added database dev env install script (#495)
fritzrehde Jul 11, 2024
ff4cff4
Chaos 463 campaigns crud (#486)
pigeonseverywhere Jul 20, 2024
ba6fb2b
Campaign Role CRUD (#497)
AlexMIaoPU Jul 20, 2024
f140dd6
Chaos 502 application crud (#503)
AlexMIaoPU Aug 2, 2024
45c8324
User CRUD (#493)
HellenMelon Aug 2, 2024
15aa828
feat(backend): improved error handling for dev env setup script (#500)
fritzrehde Aug 2, 2024
f1994a7
Question types framework + ShortAnswer & MultiChoice implementations …
KavikaPalletenne Nov 5, 2024
47aef32
Ratings CRUD (#516)
fritzrehde Nov 12, 2024
361d92a
Question & Answer CRUD (#526)
KavikaPalletenne Nov 23, 2024
088a48e
Chaos 475 api documentation (#523)
AlexMIaoPU Nov 23, 2024
2ec5c18
Email Templates and Offers (#528)
KavikaPalletenne Nov 29, 2024
877c388
optional user pronouns and gender
KavikaPalletenne Dec 30, 2024
6ee51b2
move `oauth2_client` to `AppState`
KavikaPalletenne Dec 30, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 39 additions & 15 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Rust

on:
pull_request:
branches: [main, "renovate/*"]
branches: [main, "renovate/*", "CHAOS-224-KHAOS-rewrite"]
push:
branches: ["renovate/*"]

Expand All @@ -12,34 +12,58 @@ env:
jobs:
build:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:16
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: password
POSTGRES_DB: chaos
ports:
- 5432:5432
steps:
- uses: actions/checkout@v4
- name: Mock an env file
- name: Setup env file
run: |
echo "DATABASE_URL=test_url" >> backend/.env
echo "DATABASE_URL=postgres://postgres:password@localhost:5432/chaos" >> backend/.env
echo "JWT_SECRET=test_secret" >> backend/.env
echo "GOOGLE_CLIENT_ID=test" >> backend/.env
echo "GOOGLE_CLIENT_SECRET=test" >> backend/.env
echo "GOOGLE_REDIRECT_URI=http://localhost:3000/auth/callback" >> backend/.env
echo "ROCKET_DATABASES='{}'" >> backend/.env
echo "S3_BUCKET_NAME=chaos-storage" >> backend/.env
echo "S3_ACCESS_KEY=test_access_key" >> backend/.env
echo "S3_SECRET_KEY=test_secret_key" >> backend/.env
echo "S3_ENDPOINT=https://chaos-storage.s3.ap-southeast-1.amazonaws.com" >> backend/.env
echo "S3_REGION_NAME=ap-southeast-1" >> backend/.env
# selecting a toolchain either by action or manual `rustup` calls should happen
# before the plugin, as it uses the current rustc version as its cache key
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
- uses: Swatinem/rust-cache@v2
- name: Setup cargo cache
uses: actions/cache@v3
with:
working-directory: backend/
- name: Build
run: cargo build --manifest-path backend/server/Cargo.toml
- name: Cargo Clippy
run: cargo clippy --manifest-path backend/server/Cargo.toml
- name: RustFmt
run: cargo fmt --manifest-path backend/server/Cargo.toml
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
backend/server/target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-
- name: Migrate DB
working-directory: backend
run: |
which sqlx || cargo install sqlx-cli --no-default-features --features native-tls,postgres
sqlx database create
sqlx migrate run
- name: Build
run: cargo build --manifest-path backend/seed_data/Cargo.toml
working-directory: backend/server
run: cargo build
- name: Cargo Clippy
run: cargo clippy --manifest-path backend/seed_data/Cargo.toml
working-directory: backend/server
run: cargo clippy
- name: RustFmt
run: cargo fmt --manifest-path backend/seed_data/Cargo.toml
working-directory: backend/server
run: cargo fmt
3 changes: 0 additions & 3 deletions backend/.dockerignore

This file was deleted.

5 changes: 4 additions & 1 deletion backend/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
.env
target
images
Cargo.lock
prisma-cli/prisma/migrations
/.idea
.DS_Store
Loading
Loading