Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
252 commits
Select commit Hold shift + click to select a range
902dfc1
Gallery: First draft of README
Aug 10, 2025
90813f6
Gallery: minimum functional PyScript setup w/ instructions
Aug 10, 2025
41a7ffa
Add basic drawing tool.
HiPeople21 Aug 10, 2025
d9de2d0
Add colour select input
HiPeople21 Aug 10, 2025
a0de0a7
Add line width input.
HiPeople21 Aug 10, 2025
525644e
Add pen and erase toggle. Does not affect canvas yet.
HiPeople21 Aug 10, 2025
e096088
Added eraser feature
PiLogic Aug 10, 2025
7fd73e8
Add layout. Add dark mode. Fix clicking. Add resize window event hand…
HiPeople21 Aug 10, 2025
cb3df18
Fix merge conflicts
HiPeople21 Aug 10, 2025
cfbc4fd
Add loading screen
HiPeople21 Aug 10, 2025
d524e5c
Added reset feature
PiLogic Aug 10, 2025
5b12661
Merge branch 'image-tool' of https://github.com/Matiiss/pydis-cj12-he…
PiLogic Aug 10, 2025
33a958f
Reformat files
HiPeople21 Aug 10, 2025
14c453a
Fix reset clearing line settings. Prevent non-left mouse click from d…
HiPeople21 Aug 10, 2025
16ddf56
Fix reset and resize changing the action back to draw mode even if le…
HiPeople21 Aug 10, 2025
e01a322
Turned colour selector into slot machine style
PiLogic Aug 11, 2025
c53cc67
Fix formatting
HiPeople21 Aug 11, 2025
4019d1f
Reorganise UI layout. Fix formatting.
HiPeople21 Aug 11, 2025
02ead65
Revert "Reorganise UI layout. Fix formatting."
HiPeople21 Aug 11, 2025
f305f23
Fix UI layout
HiPeople21 Aug 11, 2025
4cd84da
Gallery: Refactored and simplified
Aug 11, 2025
6a0d8ad
Gallery: Refactored and simplified
Aug 11, 2025
1827277
Merge branch 'dev' of https://github.com/Matiiss/pydis-cj12-heavenly-…
Aadil-Goyal Aug 11, 2025
e979ed3
Added pixel art feature
PiLogic Aug 11, 2025
8942ff6
GTLF loader added, with debug tools
Aug 11, 2025
55fdc5e
Added image download and upload
HiPeople21 Aug 11, 2025
e440dfa
Fix merge conflicts
HiPeople21 Aug 11, 2025
6497188
added CanvasContext and CanvasSettings classes for better lsp hinting…
Alan-Manning Aug 11, 2025
d6e402c
Merge pull request #9 from Matiiss/image-tool
HiPeople21 Aug 11, 2025
219bf30
added CanvasContext and CanvasSettings classes for better lsp hinting…
Alan-Manning Aug 11, 2025
38a9a2a
Merge commits. Annotations to be fixed
HiPeople21 Aug 11, 2025
e005af0
Fix import error
HiPeople21 Aug 11, 2025
94f3981
trying to fix the relative import.
Alan-Manning Aug 11, 2025
118f1a5
Merge branch 'image-tool' of https://github.com/Matiiss/pydis-cj12-he…
Alan-Manning Aug 11, 2025
65fa2fd
fiexed the change action button to eraser mode (no longer clears canv…
Alan-Manning Aug 11, 2025
b7b18f4
Fix formatting
HiPeople21 Aug 11, 2025
b6269a0
empty icon to shut an error up
Aug 11, 2025
f9b6a06
Environment setup for gallery 3D model
Aug 11, 2025
5a1f672
Added gallery 3D model asset
Aug 11, 2025
18cfd4c
Fix formatting. Allow mouse to continue drawing/erasing after leaving…
HiPeople21 Aug 11, 2025
45346fa
Merge branch 'dev' into 3d-model
diaz-esparza Aug 11, 2025
968a652
Merge pull request #10 from Matiiss/3d-model
diaz-esparza Aug 11, 2025
8573323
Add fix to revert drawing type/mode chane if the user clicks cancel o…
HiPeople21 Aug 11, 2025
bdceec4
Displaying images using three.js and pyscript is definitely possible
Aadil-Goyal Aug 12, 2025
8e406c3
Works better now lesgo
Aadil-Goyal Aug 12, 2025
8235789
Added the smudge effect to the smooth draw mode that uses the linewid…
Alan-Manning Aug 12, 2025
627f053
Merge branch 'image-tool' of https://github.com/Matiiss/pydis-cj12-he…
Alan-Manning Aug 12, 2025
ac9a503
Added the smudge effect to the smooth draw mode that uses the linewid…
Alan-Manning Aug 12, 2025
bdeb46a
Fix formatting. Auto upload image on selection
HiPeople21 Aug 12, 2025
1ae710c
Merge pull request #11 from Matiiss/image-tool
HiPeople21 Aug 12, 2025
c33cf1f
Prevent smudge selection when in pixel mode. Disable certain inputs w…
HiPeople21 Aug 12, 2025
b3843d7
Works pretty well now
Aadil-Goyal Aug 12, 2025
ee12b3b
Allow for users to place image where they want
HiPeople21 Aug 12, 2025
9d50498
Remove image from file upload when uploaded
HiPeople21 Aug 12, 2025
0473dfb
Add buffer canvas so canvas doesn't need to have all contents redrawn…
HiPeople21 Aug 12, 2025
a4e6dd5
Implemented 1st person controls
Aug 12, 2025
1b2d056
Merge pull request #13 from Matiiss/3d-camera
diaz-esparza Aug 12, 2025
6d5b1fc
Add show action preview
HiPeople21 Aug 12, 2025
6a85045
Merge pull request #14 from Matiiss/image-tool
HiPeople21 Aug 12, 2025
fda01b8
Merged 3D gallery and 1st person camera w/ image rendering
Aug 13, 2025
06b0750
Merge pull request #16 from Matiiss/image-rendering
diaz-esparza Aug 13, 2025
1f72756
Gallery: significantly improved mouse lock UX
Aug 13, 2025
23c1e27
Get rid of samples from the template
Matiiss Aug 13, 2025
d0f5cb4
Move src/editor under packages/editor and delete an unnecessary __ini…
Matiiss Aug 13, 2025
c6b471c
Make packages/editor a uv workspace member
Matiiss Aug 13, 2025
96478ac
Move src/gallery under packages/gallery
Matiiss Aug 13, 2025
d62693f
Implemented keyboard shortcuts
Aadil-Goyal Aug 13, 2025
44d67a8
Merge branch 'image-tool' of https://github.com/Matiiss/pydis-cj12-he…
Aadil-Goyal Aug 13, 2025
3856767
Fix formtting
HiPeople21 Aug 13, 2025
24effba
Merge branch 'image-tool' of https://github.com/Matiiss/pydis-cj12-he…
HiPeople21 Aug 13, 2025
2390da9
Fix action icon staying when in pixel mode
HiPeople21 Aug 13, 2025
e1f540f
Updated the image rendering functions
Aadil-Goyal Aug 13, 2025
257d481
Add text feature. Fix formatting for shortcuts
HiPeople21 Aug 14, 2025
7274f4f
Added 3d-model-defined gallery painting slots
Aug 14, 2025
bf1f6b5
Merge pull request #18 from Matiiss/gallery-slots
diaz-esparza Aug 14, 2025
76294c1
Resizing now keeps image to scale.
HiPeople21 Aug 14, 2025
d892b6d
Undo/redo feature
PiLogic Aug 14, 2025
bf05739
Merge branch 'image-tool' of https://github.com/Matiiss/pydis-cj12-he…
PiLogic Aug 14, 2025
0fe960e
Bold, italics, and font family settings for text
HiPeople21 Aug 14, 2025
7d4c5c5
Merge branch 'image-tool' of https://github.com/Matiiss/pydis-cj12-he…
HiPeople21 Aug 14, 2025
863f692
Fix undo/redo after resizing. Add images to history.
HiPeople21 Aug 14, 2025
b25908f
Merge pull request #20 from Matiiss/image-tool
HiPeople21 Aug 14, 2025
da494ab
Fix some typehinting
HiPeople21 Aug 14, 2025
eaee90e
Make packages/gallery a uv workspace member
Matiiss Aug 14, 2025
58bd0f7
Move src/backend under packages/backend
Matiiss Aug 14, 2025
0ced45a
Make packages/backend a uv workspace member
Matiiss Aug 14, 2025
7422206
create a main 'package' to make uv happy
Matiiss Aug 14, 2025
6040cfd
remove unnecessary comments and format pyproject.toml
Matiiss Aug 14, 2025
432e852
add authors to pyproject.toml
Matiiss Aug 14, 2025
814a877
ignore implicit namespace warning since we're using uv workspaces and…
Matiiss Aug 14, 2025
279f97a
ignore supabase volumes
Matiiss Aug 14, 2025
18219ea
update the uv lock file
Matiiss Aug 14, 2025
f2e3d4b
dockerize the backend
Matiiss Aug 14, 2025
433826e
Merge branch 'matiiss-dev' into dev
Matiiss Aug 14, 2025
a29d7a9
prettify the backend .env template
Matiiss Aug 14, 2025
abe9f15
Merge branch 'dev' into image-tool
HiPeople21 Aug 14, 2025
869a7af
Fix merge issues
HiPeople21 Aug 14, 2025
0a7e60b
Delete history when changing modes.
HiPeople21 Aug 15, 2025
9365558
Add dependency to packages/editor/pyproject.toml
HiPeople21 Aug 15, 2025
73792bc
Fixed text movement feature
PiLogic Aug 15, 2025
5acc6db
Fix formatting
HiPeople21 Aug 15, 2025
2c8abc6
Undo + Redo Shortcuts
PiLogic Aug 15, 2025
57692b7
Add clip feature
HiPeople21 Aug 15, 2025
b8263f3
Fix merge conflicts
HiPeople21 Aug 15, 2025
da5d3bc
Merge pull request #27 from Matiiss/image-tool
HiPeople21 Aug 15, 2025
c926c2e
Fix undo/redo button while in erase mode
HiPeople21 Aug 15, 2025
0bc285d
Collision detection pretty much done
Aadil-Goyal Aug 15, 2025
a099a40
Text resizing
HiPeople21 Aug 15, 2025
7774a09
Updated pyproject description and added support for local imports
Aug 15, 2025
4e0c263
Added automatic fetching of images from GitHub
Aug 15, 2025
f7640d4
Merge pull request #28 from Matiiss/github-fetching
diaz-esparza Aug 15, 2025
108a900
Merged collision feature
Aug 15, 2025
deb0817
Merge pull request #29 from Matiiss/gallery-collsion
diaz-esparza Aug 15, 2025
ff18c14
Implement image upload resize
HiPeople21 Aug 15, 2025
fc45f09
Implement clip resize
HiPeople21 Aug 15, 2025
2a31593
Merge pull request #31 from Matiiss/image-tool
HiPeople21 Aug 15, 2025
1a20a51
Fix formatting
HiPeople21 Aug 15, 2025
9dea0d3
Delete image/text/clipped region upon pressing the backspace key
HiPeople21 Aug 15, 2025
e6bb2bb
Implement rotations
HiPeople21 Aug 15, 2025
5e0f82c
Merge pull request #32 from Matiiss/image-tool
HiPeople21 Aug 15, 2025
7579a6e
move github callback uri to an env var
Matiiss Aug 15, 2025
3c026b6
Add the editor bit to docker compose as well and mount files instead …
Matiiss Aug 15, 2025
0dce341
add optional network config for the editor as well for the shared net…
Matiiss Aug 15, 2025
d371ca1
yaml formatting
Matiiss Aug 16, 2025
0d7814f
Added gallery layout design
Aug 16, 2025
d8aa738
Add static github pages deployment workflow
Matiiss Aug 16, 2025
198430d
Wrapped ui in a route
HiPeople21 Aug 16, 2025
7837766
Merge pull request #34 from heavenly-hostas-hosting/image-tool
HiPeople21 Aug 16, 2025
765b245
trigger on push
Matiiss Aug 16, 2025
93c5dfb
add button to get to the editor + minor formatting
Matiiss Aug 16, 2025
eed60f6
Renovated gallery layout, added loading triggers
Aug 16, 2025
b343168
Add help menu
HiPeople21 Aug 16, 2025
be1d7c0
Tried making a 4 room map
Aadil-Goyal Aug 16, 2025
86d8dca
Allow users to continue drawing path upon leaving and reentering canvas
HiPeople21 Aug 16, 2025
1da8d1f
Initial commit on orphan branch
Matiiss Aug 17, 2025
107d038
Implemented improved large gallery with 55 rooms
Aug 17, 2025
88eb578
Merge pull request #41 from heavenly-hostas-hosting/big-gallery
diaz-esparza Aug 17, 2025
dea0aaa
Fixed history with clipping tool
PiLogic Aug 17, 2025
62d400d
added a shortcut for the help menu itself
Aadil-Goyal Aug 17, 2025
e5b8898
add simple submit button
Matiiss Aug 17, 2025
3c64962
Change name of the project and simplify ruff linting rules
Matiiss Aug 17, 2025
fa828e7
.gitignore .pem files
Matiiss Aug 17, 2025
560f430
Add dependencies for multipart form uploads, cryptography, and psycopg
Matiiss Aug 17, 2025
2b58e1e
update uv.lock
Matiiss Aug 17, 2025
d4f98a1
Update backend env template with more env vars
Matiiss Aug 17, 2025
3f5280c
Copy backend contents to image instead of moutning them for now, chan…
Matiiss Aug 17, 2025
557dda2
add function for setting token cookies for responses
Matiiss Aug 17, 2025
e46e8f7
Rename external to public for supabase urls and clients, load github …
Matiiss Aug 17, 2025
2cdd570
Reorder function definitions, add art publishing endpoint
Matiiss Aug 17, 2025
b54d59a
Load more environment variables for various git stuff and whatnot
Matiiss Aug 17, 2025
073dadb
A gh.py file for github utilities
Matiiss Aug 17, 2025
9241c85
Save canvas state to localStorage
HiPeople21 Aug 17, 2025
566a4d8
Merge branch 'image-tool' of https://github.com/Matiiss/pydis-cj12-he…
HiPeople21 Aug 17, 2025
e779e2a
Merge commits
HiPeople21 Aug 17, 2025
228f8a5
Merge branch 'dev' into image-tool
HiPeople21 Aug 17, 2025
6bd410e
Merge pull request #42 from heavenly-hostas-hosting/image-tool
HiPeople21 Aug 17, 2025
68aa26e
Increase max line width. Move publish button to left side
HiPeople21 Aug 17, 2025
c346955
Add login, logout, register buttons
HiPeople21 Aug 17, 2025
04a8431
Add check login status
HiPeople21 Aug 17, 2025
41b47da
Workflow for validating and auto-handling data PRs
Matiiss Aug 17, 2025
bd57f8d
Add endpoints for getting login status, verifying PRs, getting a list…
Matiiss Aug 17, 2025
4621db1
return commit hash from commit_and_create_pull_request
Matiiss Aug 17, 2025
4a015e2
Create postgres utilities
Matiiss Aug 17, 2025
911d51c
Add a function for getting the github identity from a supabase client
Matiiss Aug 17, 2025
35865b3
Improve API communication
Matiiss Aug 17, 2025
b56769d
Added shapes to the picker alongside the pen ereaser etc.. This inclu…
Alan-Manning Aug 17, 2025
98b84fb
Added shapes to the picker alongside the pen ereaser etc.. This inclu…
Alan-Manning Aug 17, 2025
811ee12
Merge branch 'image-tool' of https://github.com/Matiiss/pydis-cj12-he…
Alan-Manning Aug 17, 2025
e12e655
Add a script to fetch the initial supabase volumes
Matiiss Aug 18, 2025
4025544
Redirect page directly if not in an iframe, otherwise use a message s…
Matiiss Aug 18, 2025
0af77a5
Handle redirect from the backend
Matiiss Aug 18, 2025
08d7d19
Properly configure CORS allowed origins through envs
Matiiss Aug 18, 2025
511ffcf
set up a more robust iframe <-> parent request handling w.r.t. CORS
Matiiss Aug 18, 2025
1c89b1c
Add handling for requests from iframe to be fetched from the parent
Matiiss Aug 18, 2025
8031705
allow sending a bodyless request
Matiiss Aug 18, 2025
a1c88dd
handle auth through url fragments if necessary (such as when the edit…
Matiiss Aug 18, 2025
3167223
remove the unnecessary messagePost system
Matiiss Aug 18, 2025
0b9d4d1
Nope, we're moving to a same-origin auth flow
Matiiss Aug 18, 2025
b5f749f
just redirect editor to https://cj12.matiiss.com/editor
Matiiss Aug 18, 2025
ea2a529
fix up the backend .env.template
Matiiss Aug 18, 2025
683bddd
don't fetch latest upstream data branch sha, just use the initial one…
Matiiss Aug 18, 2025
696e240
skip single commit check for now in the auto-merge workflow
Matiiss Aug 18, 2025
9fb6f46
Fix validation endpoint for PRs
Matiiss Aug 18, 2025
5ffa8ea
change event to pull_request_target for elevated perms and get commit…
Matiiss Aug 18, 2025
387fcfa
Use GitHub CLI and specify permissions necessary for the workflow
Matiiss Aug 18, 2025
a1c297b
Add back CORS middleware for cross-origin resources
Matiiss Aug 18, 2025
b5c5fb8
fix up inter-container networking
Matiiss Aug 18, 2025
3571623
/login and /logout routes should use the GET method because they're u…
Matiiss Aug 18, 2025
8987b8c
disable this notification, because it might get spammed a bit otherwise
Matiiss Aug 18, 2025
a0ff1ab
need root path of /editor for deployment
Matiiss Aug 18, 2025
a167e8e
Cleaned the code a bit
Aadil-Goyal Aug 18, 2025
df2b62b
naive image loading based on endpoint result
Matiiss Aug 18, 2025
0a82b74
Merge branch 'test-static-deploy' into dev
Matiiss Aug 18, 2025
6805488
Merge pull request #54 from heavenly-hostas-hosting/dev
Matiiss Aug 18, 2025
9b39574
Disable moving while mouse is not locked
Aadil-Goyal Aug 18, 2025
7a240bf
Added a help menu
Aadil-Goyal Aug 18, 2025
817a963
Fix formatting.
HiPeople21 Aug 18, 2025
e2fec68
Merge branch 'dev' into image-tool
HiPeople21 Aug 18, 2025
4ca8675
Merge pull request #57 from heavenly-hostas-hosting/image-tool
HiPeople21 Aug 18, 2025
b8990ef
tried to add lazy loading, but doesnt work pls dont merge to our main…
Aadil-Goyal Aug 18, 2025
186e490
Added Ctrl keybind for running just like minecraft
Aug 18, 2025
c355682
Fixed lazy loading, both async perf and distance metric
Aug 18, 2025
ed7fe1c
Add publish confirmation dialog
HiPeople21 Aug 18, 2025
ed8e937
resolved merge conflicts to add lazy loading feature
Aug 18, 2025
56cda9d
Implemented lazy loading, added a control tooltip and added Ctrl as a…
diaz-esparza Aug 18, 2025
649f995
Added small convenience features
Aug 18, 2025
743a774
Colour changes with spin
PiLogic Aug 18, 2025
9baf832
Uncomment API calls. Change undo/redo keybinds to ctrl+z and ctrl+shi…
HiPeople21 Aug 18, 2025
d93d2c8
Merge branch 'dev' of https://github.com/Matiiss/pydis-cj12-heavenly-…
HiPeople21 Aug 18, 2025
1f42e81
Add root_path arg back into ui.run
HiPeople21 Aug 18, 2025
7f806cb
Reformat files
HiPeople21 Aug 18, 2025
57589ec
Implemented auto-downloading of images on repo update
Aug 18, 2025
d38d05a
Merge branch 'dev' of github.com:Matiiss/pydis-cj12-heavenly-hostas i…
Aug 18, 2025
40dc883
Merge pull request #60 from heavenly-hostas-hosting/dev
diaz-esparza Aug 18, 2025
abe0b49
Add link back to gallery
HiPeople21 Aug 18, 2025
0898c74
Merge branch 'dev' of https://github.com/Matiiss/pydis-cj12-heavenly-…
HiPeople21 Aug 18, 2025
102aee2
Fixed shape history + flickering
PiLogic Aug 18, 2025
4792e92
Added back root_path
PiLogic Aug 18, 2025
7d33ca9
Merge branch 'main' into image-tool
PiLogic Aug 18, 2025
e0acb7c
Merge pull request #61 from heavenly-hostas-hosting/image-tool
PiLogic Aug 18, 2025
c2de821
Fix formatting. Set default line width to 5
HiPeople21 Aug 18, 2025
5806a02
Fix formatting
HiPeople21 Aug 18, 2025
455c2ee
move packages/tips.txt to packages/gallery/assets
Matiiss Aug 18, 2025
19ecf1a
Fix formatting
HiPeople21 Aug 18, 2025
ed841af
Fix formatting
HiPeople21 Aug 18, 2025
d6d8f16
added loading tips to gallery
Aadil-Goyal Aug 18, 2025
89c6592
Update Python logo drawing
HiPeople21 Aug 18, 2025
5230d6a
Hopefully fix linting error
HiPeople21 Aug 18, 2025
5169a2c
Fix keybinds
HiPeople21 Aug 18, 2025
fda7a4f
Merge branch 'dev'
Matiiss Aug 18, 2025
7f4baac
Merge remote-tracking branch 'refs/remotes/origin/main'
Matiiss Aug 18, 2025
7c6c05c
Added url param compat
Aug 18, 2025
8396d29
Finally added large blender file
Aug 18, 2025
9ec84d4
Changed debug flag. If not compliant please revert past commit
Aug 18, 2025
76a8b65
Fixed mistake with async publish function
Aug 18, 2025
0e3e79f
Update editor README.md
HiPeople21 Aug 21, 2025
4b48694
Update README.md
HiPeople21 Aug 21, 2025
86f4803
Fix README lint issues
HiPeople21 Aug 21, 2025
3d81328
Merge pull request #70 from heavenly-hostas-hosting/HiPeople21-editor…
HiPeople21 Aug 21, 2025
f647a2b
Add a mostly thorough deploy guide for the project
Matiiss Aug 22, 2025
4ff2f8a
Update backend deploy guide
Matiiss Aug 22, 2025
da5f2a1
more updates and clarifications for deployment
Matiiss Aug 22, 2025
d31939f
Gallery: Update README.md
diaz-esparza Aug 22, 2025
c33f2d5
Merge pull request #74 from heavenly-hostas-hosting/dev
Matiiss Aug 22, 2025
e9d38ba
Update README.md
HiPeople21 Aug 22, 2025
5d1a2b1
Update README.md
HiPeople21 Aug 22, 2025
474f00a
Merge pull request #75 from heavenly-hostas-hosting/HiPeople21-patch-1
HiPeople21 Aug 22, 2025
e15e097
Update README.md
diaz-esparza Aug 22, 2025
9680437
Update README.md
HiPeople21 Aug 22, 2025
61944ae
Add 'heavenly-hostas/' from commit '968043754a839ca23abc71f0c6a1a42a1…
janine9vn Sep 13, 2025
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
5 changes: 5 additions & 0 deletions heavenly-hostas/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Blender 3D models
*.blend binary
# Model binaries
*.glb binary
*.hdr binary
98 changes: 98 additions & 0 deletions heavenly-hostas/.github/workflows/data.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
name: Validate and auto-handle PR

on:
pull_request_target:
types: [opened]
branches:
- data

permissions:
pull-requests: write
contents: write

jobs:
validate:
runs-on: ubuntu-latest
steps:
- name: Set up GitHub CLI
run: |
sudo apt-get update
sudo apt-get install -y gh jq
gh --version

- name: Check out PR
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Validate PR
id: validate
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -euo pipefail

PR_NUMBER=${{ github.event.pull_request.number }}

# ensure a single commit
commit_count=$(gh pr view $PR_NUMBER --json commits -q '.commits | length')
if [ "$commit_count" -ne 1 ]; then
echo "::error::PR must have exactly one commit"
echo "valid=false" >> $GITHUB_OUTPUT
exit 0
fi

# ensure a single file
files=$(gh pr diff $PR_NUMBER --name-only)
file_count=$(echo "$files" | wc -l)
if [ "$file_count" -ne 1 ]; then
echo "::error::PR must modify exactly one file"
echo "valid=false" >> $GITHUB_OUTPUT
exit 0
fi


commit_hash=${{ github.event.pull_request.head.sha }}
filename="$files"

echo "Commit: $commit_hash"
echo "File: $filename"

# ensure PR came from the backend
response=$(curl -s \
"https://cj12.matiiss.com/api/verify_pr?filename=$filename&commit_hash=$commit_hash")

echo "Endpoint response: $response"

is_valid=$(echo "$response" | jq -r '.is_valid')

if [ "$is_valid" != "true" ]; then
echo "::error::Validation endpoint returned is_valid=$is_valid"
echo "valid=false" >> $GITHUB_OUTPUT
exit 0
fi

echo "valid=true" >> $GITHUB_OUTPUT
echo "commit_hash=$commit_hash" >> $GITHUB_OUTPUT
echo "filename=$filename" >> $GITHUB_OUTPUT

- name: Close PR if invalid
if: steps.validate.outputs.valid == 'false'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh pr close ${{ github.event.pull_request.number }} \
--repo ${{ github.repository }} \
--comment "Validation failed, closing the PR"

- name: Merge PR if valid
if: steps.validate.outputs.valid == 'true'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh pr merge ${{ github.event.pull_request.number }} \
--repo ${{ github.repository }} \
--merge \
--auto \
--delete-branch \
--body "Validation successful, merging the PR"
35 changes: 35 additions & 0 deletions heavenly-hostas/.github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# GitHub Action workflow enforcing our code style.

name: Lint

# Trigger the workflow on both push (to the main repository, on the main branch)
# and pull requests (against the main repository, but from any repo, from any branch).
on:
push:
branches:
- main
pull_request:

# Brand new concurrency setting! This ensures that not more than one run can be triggered for the same commit.
# It is useful for pull requests coming from the main repository since both triggers will match.
concurrency: lint-${{ github.sha }}

jobs:
lint:
runs-on: ubuntu-latest

env:
# The Python version your project uses. Feel free to change this if required.
PYTHON_VERSION: "3.12"

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}

- name: Run pre-commit hooks
uses: pre-commit/action@v3.0.1
43 changes: 43 additions & 0 deletions heavenly-hostas/.github/workflows/static-deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Simple workflow for deploying static content to GitHub Pages
name: Deploy static content to Pages

on:
# Runs on pushes targeting the default branch
push:
branches: ["main", "test-static-deploy"]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

jobs:
# Single deploy job since we're just deploying
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
# upload only the gallery
path: "./packages/gallery"
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
40 changes: 40 additions & 0 deletions heavenly-hostas/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Files generated by the interpreter
__pycache__/
*.py[cod]

# Environment specific
.venv
venv
.env
env

# Unittest reports
.coverage*

# Logs
*.log

# PyEnv version selector
.python-version

# Built objects
*.so
dist/
build/

# IDEs
# PyCharm
.idea/
# VSCode
.vscode/
# MacOS
.DS_Store

# We're keeping .blend backup files out of the repo
*.blend1

# supabase volumes
volumes/

# secrets
*.pem
18 changes: 18 additions & 0 deletions heavenly-hostas/.pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Pre-commit configuration.
# See https://github.com/python-discord/code-jam-template/tree/main#pre-commit-run-linting-before-committing

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: check-toml
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
args: [--markdown-linebreak-ext=md]

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.12.2
hooks:
- id: ruff-check
- id: ruff-format
21 changes: 21 additions & 0 deletions heavenly-hostas/Dockerfile.backend
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
FROM python:3.12-slim

COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/

WORKDIR /app

RUN --mount=type=cache,target=/root/.cache/uv \
--mount=type=bind,source=uv.lock,target=uv.lock \
--mount=type=bind,source=pyproject.toml,target=pyproject.toml \
uv sync --frozen --no-install-workspace --package=backend

# we'll rely on mounts for now
# ...
# err, nvm
ADD ./packages/backend /app

# RUN --mount=type=cache,target=/root/.cache/uv \
# uv sync --frozen

# Run with uvicorn
CMD ["uv", "run", "uvicorn", "server:app", "--host", "0.0.0.0", "--port", "9000"]
7 changes: 7 additions & 0 deletions heavenly-hostas/LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Copyright 2021 Python Discord

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
10 changes: 10 additions & 0 deletions heavenly-hostas/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Heavenly Hostas' Hosting

This is our submission for the official Python Discord's code jam!

The project is divided into three main components, please check their respective READMEs for details:
- [Image Editor](https://github.com/heavenly-hostas-hosting/HHH/tree/main/packages/editor)
- [Image Gallery](https://github.com/heavenly-hostas-hosting/HHH/tree/main/packages/gallery)
- [Global Image DB](https://github.com/heavenly-hostas-hosting/HHH/tree/main/packages/backend)

You can also access a slides presentation on our project [here](https://docs.google.com/presentation/d/1ngL511CRSySNVy05QM7rpqqBGVEvdEtr4sJroFdb_BI/edit?usp=sharing).
Loading