Refactor code structure for improved readability and maintainability
57
README/PUSH.md
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
Push the current workspace to a remote Git repository
|
||||||
|
|
||||||
|
This repository contains helper files to push the current code to a remote git server (example: https://git.algios.dev/francescoalbano/tripweb.git).
|
||||||
|
|
||||||
|
Important: I (the assistant) cannot run git push from here. Run the following commands locally on your machine where you have your SSH keys / credentials configured.
|
||||||
|
|
||||||
|
Quick commands
|
||||||
|
|
||||||
|
1) Verify you are on the correct branch and that working tree is clean:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git status
|
||||||
|
# commit any changes
|
||||||
|
git add -A
|
||||||
|
git commit -m "Prepare repo for remote" # if needed
|
||||||
|
```
|
||||||
|
|
||||||
|
2) Add remote and push (automatic):
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# make script executable
|
||||||
|
chmod +x scripts/push-to-remote.sh
|
||||||
|
# run the script — it defaults to the repo you provided
|
||||||
|
./scripts/push-to-remote.sh https://git.algios.dev/francescoalbano/tripweb.git main
|
||||||
|
```
|
||||||
|
|
||||||
|
If you prefer manual commands:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# add remote (if not present)
|
||||||
|
git remote add origin https://git.algios.dev/francescoalbano/tripweb.git
|
||||||
|
# set branch name (main assumed)
|
||||||
|
git branch -M main
|
||||||
|
# push
|
||||||
|
git push -u origin main
|
||||||
|
```
|
||||||
|
|
||||||
|
If your remote expects SSH, use the SSH URL instead:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# example
|
||||||
|
git remote add origin git@git.algios.dev:francescoalbano/tripweb.git
|
||||||
|
git push -u origin main
|
||||||
|
```
|
||||||
|
|
||||||
|
Troubleshooting
|
||||||
|
|
||||||
|
- Permission denied / authentication: ensure your SSH key or username/password is configured for the remote server. Prefer SSH keys.
|
||||||
|
- Repo doesn't exist: create an empty repo on the remote first (on git.algios.dev web UI) and then push.
|
||||||
|
- Non-fast-forward errors: if the remote already has commits, consider pulling first or force push only if you understand the risks.
|
||||||
|
|
||||||
|
Next steps I can do for you
|
||||||
|
|
||||||
|
- Create a GitHub Actions workflow to build frontend and/or backend and push images/artifacts to the remote registry.
|
||||||
|
- Create `docker-compose.prod.yml` and deployment SSH Actions that deploy to your Proxmox host.
|
||||||
|
|
||||||
|
Tell me which of the above you want me to generate next.
|
||||||
3
backend/.gitignore
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
/.venv/
|
||||||
|
|
||||||
|
**/__pycache__/
|
||||||
BIN
backend/storage/assets/218a7429-90e8-4377-9d25-c03f9cad82e6.jpeg
Normal file
|
After Width: | Height: | Size: 30 KiB |
BIN
backend/storage/assets/32b4ce25-ce31-4471-8054-34c696537aa4.jpeg
Normal file
|
After Width: | Height: | Size: 34 KiB |
BIN
backend/storage/assets/39a2b698-4469-45c5-b39a-bce131a657bc.jpeg
Normal file
|
After Width: | Height: | Size: 57 KiB |
BIN
backend/storage/assets/3d19ab17-0f82-42ac-a4d0-fd18409156a9.jpeg
Normal file
|
After Width: | Height: | Size: 34 KiB |
BIN
backend/storage/assets/55fe4a10-3732-4b4b-9997-1564fd83e8b1.jpeg
Normal file
|
After Width: | Height: | Size: 56 KiB |
BIN
backend/storage/assets/6489e07f-949a-4ede-851c-9118a717b3af.jpeg
Normal file
|
After Width: | Height: | Size: 41 KiB |
BIN
backend/storage/assets/72bf08ab-11bc-47a1-bdf3-406df28e77a9.jpeg
Normal file
|
After Width: | Height: | Size: 54 KiB |
BIN
backend/storage/assets/8031c6a7-1925-490c-9233-864c8b018d1e.jpeg
Normal file
|
After Width: | Height: | Size: 60 KiB |
BIN
backend/storage/assets/8bcaeb4a-d43f-467a-b65b-28eac855d4bf.jpeg
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
backend/storage/assets/b509ba71-cfee-4fdc-81d7-7f7668ee676a.jpeg
Normal file
|
After Width: | Height: | Size: 28 KiB |
BIN
backend/storage/assets/cf5e96b1-a5e0-4ff0-9754-52727a85e2c2.jpeg
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
backend/storage/assets/d0c68319-6e6a-4fca-bce3-5ecf4ffdd349.jpeg
Normal file
|
After Width: | Height: | Size: 36 KiB |
BIN
backend/storage/assets/fc7c0374-6120-4296-84a8-8475ce73c2ea.jpeg
Normal file
|
After Width: | Height: | Size: 36 KiB |
BIN
backend/storage/trip.sqlite
Normal file
66
scripts/push-to-remote.sh
Executable file
@ -0,0 +1,66 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
# push-to-remote.sh
|
||||||
|
# Usage: ./scripts/push-to-remote.sh [remote_url] [branch]
|
||||||
|
# If remote exists it will be used; otherwise added as 'origin'.
|
||||||
|
|
||||||
|
REMOTE_URL=${1:-https://git.algios.dev/francescoalbano/tripweb.git}
|
||||||
|
BRANCH=${2:-main}
|
||||||
|
|
||||||
|
print() { echo "[push-to-remote] $*"; }
|
||||||
|
|
||||||
|
# Ensure git repo
|
||||||
|
if [ ! -d .git ]; then
|
||||||
|
print "No .git found in current directory. Initialize and commit? (y/n)"
|
||||||
|
read -r yn
|
||||||
|
if [ "${yn,,}" != "y" ]; then
|
||||||
|
print "Aborting."; exit 1
|
||||||
|
fi
|
||||||
|
git init
|
||||||
|
git add .
|
||||||
|
git commit -m "Initial commit"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Ensure working tree clean
|
||||||
|
if [ -n "$(git status --porcelain)" ]; then
|
||||||
|
print "Working tree is not clean. Please commit or stash changes first.";
|
||||||
|
git status --porcelain
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Add remote if missing
|
||||||
|
if git remote get-url origin >/dev/null 2>&1; then
|
||||||
|
CURRENT_URL=$(git remote get-url origin)
|
||||||
|
if [ "$CURRENT_URL" != "$REMOTE_URL" ]; then
|
||||||
|
print "Remote 'origin' exists and points to $CURRENT_URL"
|
||||||
|
print "Do you want to set origin to $REMOTE_URL ? (y/n)"
|
||||||
|
read -r yn
|
||||||
|
if [ "${yn,,}" = "y" ]; then
|
||||||
|
git remote remove origin
|
||||||
|
git remote add origin "$REMOTE_URL"
|
||||||
|
else
|
||||||
|
print "Keeping existing origin. Aborting."; exit 1
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
print "Remote 'origin' already set to $REMOTE_URL"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
git remote add origin "$REMOTE_URL"
|
||||||
|
print "Added origin -> $REMOTE_URL"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Ensure branch exists locally
|
||||||
|
if git rev-parse --verify "$BRANCH" >/dev/null 2>&1; then
|
||||||
|
git checkout "$BRANCH"
|
||||||
|
else
|
||||||
|
git checkout -b "$BRANCH"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Push
|
||||||
|
print "Pushing to origin/$BRANCH..."
|
||||||
|
# Use upstream set on first push
|
||||||
|
git push -u origin "$BRANCH"
|
||||||
|
print "Push complete. If this was the first push, create the repo on remote or ensure you have permission and the repo exists."
|
||||||
|
|
||||||
|
# End
|
||||||
8
src/proxy.conf.json
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"/api": {
|
||||||
|
"target": "http://localhost:8000",
|
||||||
|
"secure": false,
|
||||||
|
"changeOrigin": true,
|
||||||
|
"logLevel": "warn"
|
||||||
|
}
|
||||||
|
}
|
||||||
BIN
storage/assets/218a7429-90e8-4377-9d25-c03f9cad82e6.jpeg
Normal file
|
After Width: | Height: | Size: 30 KiB |
BIN
storage/assets/32b4ce25-ce31-4471-8054-34c696537aa4.jpeg
Normal file
|
After Width: | Height: | Size: 34 KiB |
BIN
storage/assets/39a2b698-4469-45c5-b39a-bce131a657bc.jpeg
Normal file
|
After Width: | Height: | Size: 57 KiB |
BIN
storage/assets/3d19ab17-0f82-42ac-a4d0-fd18409156a9.jpeg
Normal file
|
After Width: | Height: | Size: 34 KiB |
BIN
storage/assets/55fe4a10-3732-4b4b-9997-1564fd83e8b1.jpeg
Normal file
|
After Width: | Height: | Size: 56 KiB |
BIN
storage/assets/6489e07f-949a-4ede-851c-9118a717b3af.jpeg
Normal file
|
After Width: | Height: | Size: 41 KiB |
BIN
storage/assets/72bf08ab-11bc-47a1-bdf3-406df28e77a9.jpeg
Normal file
|
After Width: | Height: | Size: 54 KiB |
BIN
storage/assets/8031c6a7-1925-490c-9233-864c8b018d1e.jpeg
Normal file
|
After Width: | Height: | Size: 60 KiB |
BIN
storage/assets/8bcaeb4a-d43f-467a-b65b-28eac855d4bf.jpeg
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
storage/assets/b509ba71-cfee-4fdc-81d7-7f7668ee676a.jpeg
Normal file
|
After Width: | Height: | Size: 28 KiB |
BIN
storage/assets/cf5e96b1-a5e0-4ff0-9754-52727a85e2c2.jpeg
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
storage/assets/d0c68319-6e6a-4fca-bce3-5ecf4ffdd349.jpeg
Normal file
|
After Width: | Height: | Size: 36 KiB |
BIN
storage/assets/fc7c0374-6120-4296-84a8-8475ce73c2ea.jpeg
Normal file
|
After Width: | Height: | Size: 36 KiB |