Skip to content

Commit 20206c3

Browse files
committed
Initial commit: Fragrance Collect — full-stack fragrance discovery platform
Frontend: vanilla JS product catalog with real-time search, dynamic currency conversion, filtering, pagination, favorites system, and responsive luxury UI. Backend: Cloudflare Workers handling multi-source product aggregation via CJ Affiliate (GraphQL) and TikTok Shop APIs with revenue-optimized ranking. Auth: Google OAuth 2.0 + email signup with JWT verification, session management, and user preferences stored in Cloudflare D1. Includes CI/CD pipeline via GitHub Actions and custom domain configuration.
0 parents  commit 20206c3

58 files changed

Lines changed: 31137 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/deploy.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Deploy to GitHub Pages
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
7+
permissions:
8+
contents: read
9+
pages: write
10+
id-token: write
11+
12+
jobs:
13+
deploy:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0
20+
21+
- name: Deploy to GitHub Pages
22+
uses: peaceiris/actions-gh-pages@v3
23+
with:
24+
github_token: ${{ secrets.GITHUB_TOKEN }}
25+
publish_dir: Fragrance-Collect
26+
publish_branch: gh-pages
27+
force_orphan: true
28+
user_name: 'github-actions[bot]'
29+
user_email: 'github-actions[bot]@users.noreply.github.com'

.gitignore

Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
# Dependencies
2+
node_modules/
3+
npm-debug.log*
4+
yarn-debug.log*
5+
yarn-error.log*
6+
7+
# Environment variables and secrets
8+
.env
9+
.env.local
10+
.env.development.local
11+
.env.test.local
12+
.env.production.local
13+
config.js
14+
secrets.json
15+
*.key
16+
*.pem
17+
18+
# API credentials
19+
api/.env
20+
api/config.js
21+
api/secrets/
22+
23+
# Logs
24+
logs/
25+
*.log
26+
npm-debug.log*
27+
yarn-debug.log*
28+
yarn-error.log*
29+
lerna-debug.log*
30+
31+
# Runtime data
32+
pids/
33+
*.pid
34+
*.seed
35+
*.pid.lock
36+
37+
# Coverage directory used by tools like istanbul
38+
coverage/
39+
*.lcov
40+
41+
# nyc test coverage
42+
.nyc_output
43+
44+
# Dependency directories
45+
node_modules/
46+
jspm_packages/
47+
48+
# Optional npm cache directory
49+
.npm
50+
51+
# Optional eslint cache
52+
.eslintcache
53+
54+
# Microbundle cache
55+
.rpt2_cache/
56+
.rts2_cache_cjs/
57+
.rts2_cache_es/
58+
.rts2_cache_umd/
59+
60+
# Optional REPL history
61+
.node_repl_history
62+
63+
# Output of 'npm pack'
64+
*.tgz
65+
66+
# Yarn Integrity file
67+
.yarn-integrity
68+
69+
# dotenv environment variables file
70+
.env
71+
.env.test
72+
73+
# parcel-bundler cache (https://parceljs.org/)
74+
.cache
75+
.parcel-cache
76+
77+
# Next.js build output
78+
.next
79+
80+
# Nuxt.js build / generate output
81+
.nuxt
82+
dist
83+
84+
# Gatsby files
85+
.cache/
86+
public
87+
88+
# Storybook build outputs
89+
.out
90+
.storybook-out
91+
92+
# Temporary folders
93+
tmp/
94+
temp/
95+
96+
# Editor directories and files
97+
.vscode/
98+
.idea/
99+
*.swp
100+
*.swo
101+
*~
102+
103+
# OS generated files
104+
.DS_Store
105+
.DS_Store?
106+
._*
107+
.Spotlight-V100
108+
.Trashes
109+
ehthumbs.db
110+
Thumbs.db
111+
112+
# Build outputs
113+
build/
114+
dist/
115+
out/
116+
117+
# Wrangler local state
118+
.wrangler/
119+
120+
# Docker
121+
.dockerignore
122+
docker-compose.override.yml

CNAME

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
fragrancecollect.com

Chanel_IMG.jpg

3.2 MB
Loading

Creed_ING.jpg

1.84 MB
Loading

Dior_IMG.jpg

3.99 MB
Loading

README.md

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
# Fragrance Collect
2+
3+
**Live site:** [fragrancecollect.com](https://fragrancecollect.com)
4+
5+
A full-stack fragrance discovery platform that aggregates products from multiple affiliate networks, featuring real-time search, personalized recommendations, and a responsive luxury UI.
6+
7+
## Architecture
8+
9+
**Frontend** — Vanilla JavaScript, HTML5, CSS3 (no framework dependencies)
10+
- Real-time product search with debounced input and pagination
11+
- Dynamic currency conversion across 30+ currencies with live exchange rates
12+
- Client-side filtering by price, brand, shipping, and sort order
13+
- Offline-capable with sync queuing for favorites
14+
- Responsive design optimized for mobile and desktop
15+
16+
**Backend** — Cloudflare Workers (serverless, edge-deployed)
17+
- Multi-source product aggregation via CJ Affiliate (GraphQL) and TikTok Shop APIs
18+
- Revenue-optimized ranking algorithm weighting commission rates, price range, and relevance
19+
- Smart deduplication across data sources
20+
- Rate limiting, input sanitization, and CORS policy enforcement
21+
22+
**Authentication** — Google OAuth 2.0 + email signup
23+
- JWT verification using Google's public keys
24+
- Session management with Cloudflare D1 (SQLite at the edge)
25+
- User preferences and favorites persistence
26+
27+
**Database** — Cloudflare D1
28+
- Users, sessions, preferences, and favorites tables
29+
- Parameterized queries for SQL injection prevention
30+
- Indexed for performance
31+
32+
## Key Features
33+
34+
- **Multi-source search** — Queries CJ Affiliate and TikTok Shop simultaneously, deduplicates results, and ranks by revenue potential
35+
- **Revenue optimization** — Products scored by commission rate, price positioning, brand category, and search relevance
36+
- **Currency conversion** — Real-time rates from Open Exchange Rates API with 24-hour caching and hardcoded fallbacks
37+
- **Personalized recommendations** — Logged-in users get scent preference-based suggestions
38+
- **Favorites system** — Save fragrances with offline support and cross-device sync
39+
- **Security** — XSS prevention, input validation, HTTPS enforcement, rate limiting
40+
41+
## Tech Stack
42+
43+
| Layer | Technology |
44+
|-------|-----------|
45+
| Frontend | JavaScript (ES6+), HTML5, CSS3 |
46+
| Backend | Cloudflare Workers |
47+
| Database | Cloudflare D1 (SQLite) |
48+
| APIs | CJ Affiliate (GraphQL), TikTok Shop, Google OAuth, Open Exchange Rates |
49+
| Hosting | GitHub Pages (static), Cloudflare (serverless) |
50+
| Email | Resend |
51+
| CI/CD | GitHub Actions |
52+
53+
## Project Structure
54+
55+
```
56+
├── main.html # Main product catalog page
57+
├── index.html # Entry point / redirect
58+
├── script.js # Core application logic (search, filters, favorites, currency)
59+
├── styles.css # Main stylesheet
60+
├── shared-auth.js # Cross-page authentication module
61+
├── universal-header-script.js # Shared navigation and header logic
62+
├── auth.html / auth-script.js # Authentication page
63+
├── account.html / account.js # User account management
64+
├── contact.html # Contact form
65+
├── customer-service.html # Customer service page
66+
├── faq.html # FAQ page
67+
├── size-guide.html # Size guide reference
68+
├── privacy-policy.html # Privacy policy
69+
├── terms-of-service.html # Terms of service
70+
├── weathered-mud-6ed5/ # Cloudflare Worker (product search + auth API)
71+
│ └── src/integrated-worker.js # Main worker handling all API endpoints
72+
└── auth-worker/ # Auth worker schemas and config
73+
├── schema.sql # D1 database schema
74+
└── src/worker.js # Auth-specific worker
75+
```
76+
77+
## Local Development
78+
79+
```bash
80+
# Serve the frontend locally
81+
npx serve .
82+
83+
# Run the Cloudflare Worker locally
84+
cd weathered-mud-6ed5
85+
npx wrangler dev
86+
```
87+
88+
## Author
89+
90+
Joshua Blaszczyk

Tom Ford_IMG.jpg

2.61 MB
Loading

0 commit comments

Comments
 (0)