Skip to content

Commit 9d2d051

Browse files
authored
Merge branch 'main' into copilot/fix-test-environment-setup
Signed-off-by: Asper Beauty Shop <252395498+asperpharma@users.noreply.github.com>
2 parents 51991a7 + 00f5c07 commit 9d2d051

40 files changed

Lines changed: 3855 additions & 1735 deletions

.claude/settings.local.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"permissions": {
3+
"allow": [
4+
"Bash(git add:*)",
5+
"Bash(gh pr list:*)",
6+
"Bash(gh auth:*)",
7+
"Bash(gh pr create:*)",
8+
"Bash(gh pr view:*)"
9+
]
10+
}
11+
}

.github/SECRETS.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Repository secrets (GitHub Actions)
2+
3+
Required **Actions** secrets so CI workflows run as intended.
4+
5+
## LOVABLE_WEBHOOK_URL (required for “Notify Lovable”)
6+
7+
The **Build and Push to Lovable** workflow (`build-and-push-to-lovable.yml`) runs a **Notify Lovable** step after each push to `main`. That step only runs when this secret is set; otherwise the deploy job is skipped.
8+
9+
**How to set it**
10+
11+
1. Open the repo on GitHub: **Settings → Secrets and variables → Actions**.
12+
2. Click **New repository secret**.
13+
3. Name: `LOVABLE_WEBHOOK_URL`.
14+
4. Value: the webhook URL from Lovable (file sync / deploy). Get it from your [Lovable project settings](https://lovable.dev/projects/657fb572-13a5-4a3e-bac9-184d39fdf7e6/settings) (or the Integrations / Webhooks section Lovable provides).
15+
5. Add the secret and save.
16+
17+
After this is set, the “Notify Lovable (push file changes for deploy)” step will run on each push to `main`.
18+
19+
---
20+
21+
Other workflows that use the same secret (and also skip when it’s empty):
22+
23+
- `sync-file-changes-to-lovable.yml`
24+
- `sync-issues-prs-to-lovable.yml`
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
Example fix (double-check the actual variable names and logic in your workflow):
2+
3+
YAML
4+
- name: Send file changes to Lovable
5+
run: |
6+
if [ -z "${{ secrets.LOVABLE_API_URL }}" ]; then
7+
echo "LOVABLE_API_URL is not set"; exit 1
8+
fi
9+
curl -X POST "${{ secrets.LOVABLE_API_URL }}/api/sync" -d @file_changes.json
10+
Ensure LOVABLE_API_URL (or any other URL variable) is defined in your repository secrets/settings.
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
# Build and Push to Lovable (Asper Beauty Shop)
2+
# Repo: asperpharma/understand-project
3+
# Live: https://asperbeautyshop-com.lovable.app
4+
#
5+
# On push to main (or manual run): build + test, then notify Lovable via webhook.
6+
# The "Notify Lovable" deploy job runs only when LOVABLE_WEBHOOK_URL is set.
7+
# Setup: see .github/SECRETS.md — add LOVABLE_WEBHOOK_URL in repo Actions secrets.
8+
9+
name: Build and Push to Lovable
10+
11+
on:
12+
push:
13+
branches: [main]
14+
workflow_dispatch:
15+
16+
env:
17+
AZURE_WEBAPP_PACKAGE_PATH: "."
18+
NODE_VERSION: "20.x"
19+
20+
permissions:
21+
contents: read
22+
23+
jobs:
24+
build:
25+
runs-on: ubuntu-latest
26+
steps:
27+
- name: Checkout
28+
uses: actions/checkout@v4
29+
30+
- name: Set up Node.js
31+
uses: actions/setup-node@v4
32+
with:
33+
node-version: ${{ env.NODE_VERSION }}
34+
cache: "npm"
35+
36+
- name: npm install, build, and test
37+
run: |
38+
npm ci
39+
npm run build --if-present
40+
npm run test --if-present
41+
42+
- name: Upload artifact for deployment job
43+
uses: actions/upload-artifact@v4
44+
with:
45+
name: node-app
46+
path: .
47+
48+
deploy:
49+
permissions:
50+
contents: none
51+
runs-on: ubuntu-latest
52+
needs: build
53+
if: secrets.LOVABLE_WEBHOOK_URL != ''
54+
environment:
55+
name: Development
56+
url: https://asperbeautyshop-com.lovable.app
57+
steps:
58+
- name: Download artifact from build job
59+
uses: actions/download-artifact@v4
60+
with:
61+
name: node-app
62+
63+
- name: Notify Lovable (push file changes for deploy)
64+
continue-on-error: true
65+
env:
66+
LOVABLE_WEBHOOK_URL: ${{ secrets.LOVABLE_WEBHOOK_URL }}
67+
run: |
68+
if [ "${{ github.event_name }}" = "push" ] && [ -f "$GITHUB_EVENT_PATH" ]; then
69+
ADDED=$(jq -r '.commits[].added[]?' "$GITHUB_EVENT_PATH" | sort | uniq | jq -R . | jq -s .)
70+
MODIFIED=$(jq -r '.commits[].modified[]?' "$GITHUB_EVENT_PATH" | sort | uniq | jq -R . | jq -s .)
71+
REMOVED=$(jq -r '.commits[].removed[]?' "$GITHUB_EVENT_PATH" | sort | uniq | jq -R . | jq -s .)
72+
else
73+
ADDED="[]"
74+
MODIFIED="[]"
75+
REMOVED="[]"
76+
fi
77+
COMPARE_URL="${{ github.event.compare }}"
78+
[ -z "$COMPARE_URL" ] && COMPARE_URL="https://github.com/${{ github.repository }}/commit/${{ github.sha }}"
79+
PAYLOAD=$(jq -n \
80+
--arg repo "${{ github.repository }}" \
81+
--arg commit "${{ github.sha }}" \
82+
--arg sender "${{ github.actor }}" \
83+
--arg url "$COMPARE_URL" \
84+
--argjson added "$ADDED" \
85+
--argjson modified "$MODIFIED" \
86+
--argjson removed "$REMOVED" \
87+
'{repo: $repo, commit: $commit, sender: $sender, compare_url: $url, added: $added, modified: $modified, removed: $removed}')
88+
echo "Sending to Lovable..."
89+
curl -s -f -X POST "$LOVABLE_WEBHOOK_URL" \
90+
-H "Content-Type: application/json" \
91+
-d "$PAYLOAD" || echo "Webhook call failed (non-fatal)."
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Sync File Changes to Lovable (main project)
2+
# Repo: asperpharma/understand-project
3+
# Lovable: https://lovable.dev/projects/657fb572-13a5-4a3e-bac9-184d39fdf7e6
4+
#
5+
# On every push, sends lists of added/modified/removed files to Lovable via webhook.
6+
# SETUP: In GitHub repo → Settings → Secrets and variables → Actions, add:
7+
# LOVABLE_WEBHOOK_URL = (webhook URL from Lovable for file sync)
8+
#
9+
name: Sync File Changes to Lovable
10+
11+
on:
12+
push:
13+
branches:
14+
- '**' # triggers on all branches
15+
16+
jobs:
17+
sync_files_to_lovable:
18+
runs-on: ubuntu-latest
19+
if: secrets.LOVABLE_WEBHOOK_URL != ''
20+
steps:
21+
- name: Filter commit file changes and send to Lovable
22+
continue-on-error: true
23+
env:
24+
LOVABLE_WEBHOOK_URL: ${{ secrets.LOVABLE_WEBHOOK_URL }}
25+
run: |
26+
echo "Gathering lists of changed files..."
27+
ADDED=$(jq -r '.commits[].added[]?' "$GITHUB_EVENT_PATH" | sort | uniq | jq -R . | jq -s .)
28+
MODIFIED=$(jq -r '.commits[].modified[]?' "$GITHUB_EVENT_PATH" | sort | uniq | jq -R . | jq -s .)
29+
REMOVED=$(jq -r '.commits[].removed[]?' "$GITHUB_EVENT_PATH" | sort | uniq | jq -R . | jq -s .)
30+
PAYLOAD=$(jq -n \
31+
--arg repo "${{ github.repository }}" \
32+
--arg commit "${{ github.sha }}" \
33+
--arg sender "${{ github.actor }}" \
34+
--arg url "${{ github.event.compare }}" \
35+
--argjson added "$ADDED" \
36+
--argjson modified "$MODIFIED" \
37+
--argjson removed "$REMOVED" \
38+
'{repo: $repo, commit: $commit, sender: $sender, compare_url: $url, added: $added, modified: $modified, removed: $removed}')
39+
echo "Sending file changes to Lovable..."
40+
curl -s -f -X POST "$LOVABLE_WEBHOOK_URL" \
41+
-H "Content-Type: application/json" \
42+
-d "$PAYLOAD" || echo "Webhook call failed (non-fatal)."
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Sync GitHub Issues and PRs to Lovable (main project)
2+
# Repo: asperpharma/understand-project
3+
# Lovable: https://lovable.dev/projects/657fb572-13a5-4a3e-bac9-184d39fdf7e6
4+
#
5+
# Sends issue/PR open, edit, reopen, close events to Lovable via webhook.
6+
# SETUP: In GitHub repo → Settings → Secrets and variables → Actions, add:
7+
# LOVABLE_WEBHOOK_URL = (webhook URL from Lovable, if provided)
8+
#
9+
name: Sync Issues and PRs to Lovable
10+
11+
on:
12+
issues:
13+
types: [opened, edited, closed, reopened]
14+
pull_request:
15+
types: [opened, edited, reopened, closed]
16+
17+
jobs:
18+
sync_to_lovable:
19+
runs-on: ubuntu-latest
20+
if: secrets.LOVABLE_WEBHOOK_URL != ''
21+
steps:
22+
- name: Send event data to Lovable
23+
continue-on-error: true
24+
env:
25+
LOVABLE_WEBHOOK_URL: ${{ secrets.LOVABLE_WEBHOOK_URL }}
26+
run: |
27+
echo "Sending event to Lovable..."
28+
PAYLOAD=$(jq -n \
29+
--arg event_name "${{ github.event_name }}" \
30+
--arg action "${{ github.event.action }}" \
31+
--arg repo "${{ github.repository }}" \
32+
--arg sender "${{ github.actor }}" \
33+
--arg url "${{ github.event.issue.html_url || github.event.pull_request.html_url }}" \
34+
--arg title "${{ github.event.issue.title || github.event.pull_request.title }}" \
35+
--arg body "${{ github.event.issue.body || github.event.pull_request.body }}" \
36+
'{event_name: $event_name, action: $action, repo: $repo, sender: $sender, url: $url, title: $title, body: $body}'
37+
)
38+
curl -s -f -X POST "$LOVABLE_WEBHOOK_URL" \
39+
-H "Content-Type: application/json" \
40+
-d "$PAYLOAD" || echo "Webhook call failed (non-fatal)."
41+
echo "Done."

.gitignore

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,28 +11,35 @@ out/
1111

1212
# Local env files
1313
.env
14-
.env.local
15-
.env.development.local
16-
.env.test.local
17-
.env.production.local
14+
dist
15+
dist-ssr
16+
*.local
1817

19-
# Logs
20-
npm-debug.log*
21-
yarn-debug.log*
22-
yarn-error.log*
23-
pnpm-debug.log*
24-
25-
# Playwright artifacts
26-
playwright-report/
27-
test-results/
18+
.understand
19+
.cursor
20+
.claudefesii
21+
Orgnized Products
22+
Supabase_files
23+
*.csv
24+
*.sql
25+
*.ipynb
26+
*.xlsx
27+
*.tsv
28+
*.crt
29+
*.docx
2830

2931
# Editor directories and files
32+
.vscode/*
33+
!.vscode/extensions.json
34+
.idea
3035
.DS_Store
31-
*.pem
32-
.idea/
33-
.vscode/
3436
*.suo
3537
*.ntvs*
3638
*.njsproj
3739
*.sln
3840
*.sw?
41+
42+
# AI / tooling (do not track)
43+
.claude/
44+
.claudefesii/
45+
.snapshots/

0 commit comments

Comments
 (0)