Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
aaanh committed Jan 4, 2024
2 parents be04901 + 3855aff commit 285744c
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 5 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Deploy API server with database

on:
workflow_dispatch:

jobs:
deploy:
runs-on: ubuntu-latest
name: Deploy API server with database
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: '1.21.x'

- name: Install other dependencies
run: sudo apt install -y curl jq build-essential

- name: Download servant faces from Github release
run: curl -LO $(curl -s "https://api.github.com/repos/aaanh/reroll.ing/releases" | jq -r '.[0].assets[0].browser_download_url')

- name: Generate .env for API server
run:
23 changes: 19 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,21 @@
So... I built this full-stack FGO gacha simulator in, what is to me, a record time of 5 days (to be verified with commit history 🤡).

## Notice
## N.B.

I do not own the characters, names, and attributes that might appear during the usage of this software. Those are the intellectual properties of their respective copyright holders.

I, however, hold copyright for the source code and my trade names.

I'm not affiliated with any entities mentioned or whose resource I use in this project, e.g. FGO and its owner, Atlas Academy, and others, but myself. Nor do I claim to be partnered with, sponsored or funded by the aforementioned.

## Features and TODOs

- [ ] DevOps: Reset/Improve versioning
- [ ] Follow semver
- [ ] Automate tag generation
- [ ] Automate version increment
- [ ] Separate versioning for each component
- [x] Func: Single roll
- [x] Func: Multi roll
- [x] FE: Servants card face
Expand All @@ -20,14 +27,16 @@ I, however, hold copyright for the source code and my trade names.
- [ ] Symbol
- [x] FE: Servants rarity indicators
- [x] Text only
- [ ] Symbol
- [x] Symbol
- [ ] FE: Staggered render
- [x] FE: Servant information page (dynamic routing)
- [ ] DB: Scheduled data update task
- [x] DB: Servant images
- [x] Image retrieval
- [x] Store to image database
- [ ] Caching
- [ ] SV: API rate limiting
- [ ] DevOps: Automated deployment

## Frontend/UI

Expand Down Expand Up @@ -81,10 +90,16 @@ def fetch_new_data():
return data

def update_db(json_data):
"""
Update the SQLite database with the data from the json file
"""

current_path = os.getcwd()
for i in range(len(json_data)):
try:
cur.execute("INSERT INTO servants (collectionNo, sv_name, rarity, class_name, face) VALUES (?, ?, ?, ?, ?)",
(json_data[i]['collectionNo'], json_data[i]['name'], json_data[i]['rarity'], json_data[i]['className'], json_data[i]['face']))
face_path = f"https://api.reroll.ing/assets/{json_data[i]['collectionNo']}.png"
cur.execute("INSERT INTO servants (collectionNo, sv_original_name, sv_name, rarity, class_name, atk_max, hp_max, attribute, face_url, face_path) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)",
(json_data[i]['collectionNo'], json_data[i]['originalName'], json_data[i]['name'], json_data[i]['rarity'], json_data[i]['className'], json_data[i]['atkMax'], json_data[i]['hpMax'], json_data[i]['attribute'], json_data[i]['face'], face_path))
except sqlite3.IntegrityError:
print(
f"Servant already exists in database, skipping: {json_data[i]['collectionNo']} - \"{json_data[i]['name']}\"")
Expand Down
Empty file.
2 changes: 1 addition & 1 deletion frontend/src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export default function Home() {
<main className={`min-h-screen w-full bg-gradient-to-b from-slate-950 to-pink-950/20 justify-between items-center text-slate-200 flex ${inter.className} flex-col`}>
<Header></Header>

<div className="flex flex-wrap items-center justify-center h-[50vh] sm:border-none border-y border-blue-500 sm:shadow-none shadow-[inset_0_-5px_20px_rgba(0,0,0,0.3)] sm:overflow-hidden overflow-scroll no-scrollbar">
<div className="flex flex-wrap items-center justify-center h-[50vh] sm:h-[55vh] sm:border-none border-y border-blue-500 sm:shadow-none shadow-[inset_0_-5px_20px_rgba(0,0,0,0.3)] sm:overflow-hidden overflow-scroll no-scrollbar">
{rolls.map((roll: Roll, idx: number) => <RollSlot key={idx} roll={roll}></RollSlot>)}
</div>

Expand Down

0 comments on commit 285744c

Please sign in to comment.