Skip to content

Commit 9ad9c88

Browse files
authored
Merge branch 'develop' into seeding
2 parents 88aaf62 + 95727ba commit 9ad9c88

23 files changed

+308
-174
lines changed

.env.sample

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ POSTGRES_DB=
55
POSTGRES_HOST=localhost
66

77
# Root env
8-
DATABASE_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:5432/${POSTGRES_DB}
8+
ROOT_DB_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:5432/${POSTGRES_DB}
99
RUST_ENV=development
1010
ROOT_SECRET=insecuresecret123 # Used to verify origin of attendance mutations
1111
ROOT_PORT=3000

.github/dependabot.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,12 @@ updates:
77
open-pull-requests-limit: 1
88
target-branch: "develop"
99
groups:
10-
all-dependencies:
11-
applies-to: [version-updates, security-updates]
10+
version-updates:
11+
applies-to: "version-updates"
12+
patterns:
13+
- "*"
14+
15+
security-updates:
16+
applies-to: "security-updates"
1217
patterns:
1318
- "*"

.github/workflows/ghcr-deploy.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ name: Create and publish Docker image to GHCR
55
on:
66
workflow_dispatch:
77
push:
8-
branches: ['main']
8+
branches: ['production']
99

1010
jobs:
1111
build-and-push-image:
@@ -38,7 +38,7 @@ jobs:
3838
images: ghcr.io/amfoss/root
3939
tags: |
4040
# set latest tag for master branch
41-
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'main') }},priority=2000
41+
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'production') }},priority=2000
4242
type=schedule,pattern={{date 'YYYYMMDD'}}
4343
type=ref,event=tag
4444
type=ref,event=pr
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Host Documentation
2+
on:
3+
push:
4+
branches:
5+
- production
6+
7+
permissions:
8+
contents: read
9+
pages: write
10+
id-token: write
11+
12+
jobs:
13+
build:
14+
name: Build documentation
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- name: Checkout repository
19+
uses: actions/checkout@v4
20+
with:
21+
fetch-depth: 0
22+
23+
- name: Install Rust toolchain
24+
uses: dtolnay/rust-toolchain@stable
25+
26+
- name: Build Documentation
27+
run: cargo doc -p root --no-deps
28+
29+
- name: Add index.html redirect
30+
run: echo '<meta http-equiv="refresh" content="0; url=root/index.html">' > target/doc/index.html
31+
32+
- name: Upload GitHub Pages artifact
33+
uses: actions/upload-pages-artifact@v3.0.1
34+
with:
35+
path: target/doc
36+
37+
deploy:
38+
name: Deploy to GitHub Pages
39+
needs: build
40+
runs-on: ubuntu-latest
41+
42+
environment:
43+
name: github-pages
44+
url: ${{ steps.deployment.outputs.page_url }}
45+
46+
steps:
47+
- name: Deploy to GitHub Pages
48+
id: deployment
49+
uses: actions/deploy-pages@v4.0.5

.github/workflows/lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Lint
22

33
on:
44
pull_request:
5-
branches: [ "main", "develop" ]
5+
branches: [ "production", "develop" ]
66

77
jobs:
88
clippy:

Cargo.lock

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

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ edition = "2021"
55

66
[dependencies]
77
async-graphql = { version = "7.0.15", features = ["chrono"] }
8-
async-graphql-axum = "7.0.6"
8+
async-graphql-axum = "7.0.17"
99
axum = "0.8.1"
1010
chrono = { version = "0.4.38", features = ["clock"] }
1111
serde = { version = "1.0.188", features = ["derive"] }

README.md

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
1-
<div align="center">
2-
<h1>Root</h1>
3-
<p>A GraphQL backend for managing club member information</p>
4-
</div>
5-
1+
Root
62
---
73

8-
Root is our club's backend, responsible for collecting and distributing data from and to all the other services including [Home](https://www.github.com/amfoss/home), [amD](https://www.github.com/amfoss/amd) and [Presense](https://www.github.com/amfoss/presense). The idea is to have all our data easily available in one place and to let every other end-user applications to be standalone. This ensures there's no single point of failure for all our infrastructure (as was the case with our previous CMS). Though Root going down would definitely cause a few features to stop working on the other apps.
4+
Root is the central backend service for our club’s infrastructure. It acts as a unified data layer, handling communication between services like [Home](https://www.github.com/amfoss/home), [amD](https://www.github.com/amfoss/amd), and [Presense](https://www.github.com/amfoss/presense). Each frontend or end-user application is designed to be self-contained, relying on Root for data access without being tightly coupled to it. This modular approach reduces the risk of a complete infrastructure failure — unlike our previous CMS — though some features may still be affected if Root goes down.
95

106
# Quick Setup
117

@@ -33,7 +29,6 @@ Root is our club's backend, responsible for collecting and distributing data fro
3329

3430
GraphQL playground should be available at `http://localhost:8000/graphiql` as long as it's in development mode.
3531

36-
3732
# Deployment
3833
The deployed instance can be accessed at [root.amfoss.in](https://root.amfoss.in).
3934

docs/member.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ struct Member {
1717
mac_address: String,
1818
discord_id: String,
1919
group_id: i32,
20+
track: String,
2021
}
2122
```
2223

@@ -53,6 +54,7 @@ mutation {
5354
macAddress: "XX:XX:XX:XX:XX:XX"
5455
discordId: "123456789"
5556
groupId: 1
57+
track: "web"
5658
}
5759
) {
5860
memberId
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
CREATE TABLE StatusUpdateHistory (
2+
update_id SERIAL PRIMARY KEY,
3+
member_id INT REFERENCES Member(member_id) ON DELETE CASCADE,
4+
date DATE NOT NULL,
5+
is_updated BOOLEAN NOT NULL DEFAULT FALSE,
6+
UNIQUE (member_id, date)
7+
);

0 commit comments

Comments
 (0)