Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 3 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": ["next/core-web-vitals"]
}
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node_modules
.next
out
.env*
.DS_Store
16 changes: 0 additions & 16 deletions Idea.tsx

This file was deleted.

93 changes: 46 additions & 47 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,64 +1,63 @@
# 🎅 AI Gift Generator (Next.js + Serverless)
# ☀️ Codex Solar Platform

Deterministic £1 machine → scalable affiliate engine.
Launch high-performance solar projects with Codex Solar — a boutique engineering team that blends digital modelling with boots-on-roof delivery.

## ✨ What it does
- One-page app where users describe the gift recipient.
- Serverless API asks **AI Santa** for 3–5 witty, specific gift ideas.
- Each idea links to **Amazon UK** search with your **affiliate tag**.
- Footer invites visitors to **clone the site** → virality + compounding.
## 🌍 What we deliver
- Feasibility and irradiance modelling tailored to your estate.
- Turnkey EPC delivery for rooftop, carport and ground-mount arrays.
- 24/7 monitoring, maintenance, and optimisation with transparent reporting dashboards.

## 🧱 Stack
- Next.js (App Router) + TailwindCSS
- Vercel Serverless (API)
- OpenAI (your key)
- Optional: Vercel KV for analytics (not required)
## 🚀 Getting started

## 🚀 Deploy (Vercel, 5 minutes)
1. Create a new GitHub repo and upload this folder.
2. Go to **Vercel → New Project → Import** your repo.
3. Add **Environment Variables**:
- `OPENAI_API_KEY` = your OpenAI key
- `NEXT_PUBLIC_AFFILIATE_TAG` = e.g. `yourtag-21`
4. Deploy. Then **Domains → Add** `aigiftgen.co.uk` (or use the free `.vercel.app` domain).
Install dependencies and launch the Next.js dev server:

> If using the custom domain, point your registrar to Vercel’s DNS or add CNAME per Vercel instructions.

## 🧪 Local dev
```bash
npm i
npm install
npm run dev
# open http://localhost:3000
# visit http://localhost:3000
```

## 🪄 Customise
- Adjust the default input text in `app/page.tsx`.
- Tweak prompt / model in `app/api/gifts/route.ts`.
- Change styling in `app/globals.css`.
To inspect the static export exactly as Netlify will serve it, run a production preview:

## 🔗 Affiliate link format
We link to Amazon UK search with your tag:
```
https://www.amazon.co.uk/s?k={QUERY}&tag=YOUR_TAG
```bash
npm run build
npm run preview
# visit http://localhost:4173
```

## 🧬 Clone Network (optional)
Keep the `/clone` page live so others can fork and deploy.
When they do, your site gains distribution via social shares.
Set environment variables in `.env.local` if you plan to integrate APIs (none are required for the static marketing experience).

## 🌐 Deploying to Netlify

This project is configured for static export so Netlify can serve it from the global edge network:

## 🛡️ Safety / Compliance
- Mark links as affiliate where appropriate.
- Respect Amazon Associates Program Policies.
- Add a simple privacy notice if you enable analytics.
1. Push the repo to GitHub/GitLab/Bitbucket and connect it to Netlify.
2. Leave the **Base directory** blank. Netlify will detect `package.json` in the repository root (double-check with `ls` if you run into ENOENT errors).
3. Use the default build command (`npm run build`) and publish directory (`out`). These values match the bundled `netlify.toml`.
4. Trigger a deploy. Netlify installs dependencies, runs the static export, and uploads the generated site from `out/`.

---
### Troubleshooting Netlify builds

### Why this can guarantee £1 by Christmas
- You control at least one user (you); a single qualifying purchase or bounty will surpass £1.
- Minimal cost-to-deploy → near-zero risk.
- Tiny push (share once) → high chance of 10+ outbound clicks.
- **`ENOENT: no such file or directory, open '.../package.json'`** – make sure you deployed the repository root rather than a subdirectory. The `package.json` included in this project lives at the root level.
- **`out` directory missing in preview** – run `npm run build` before `npm run preview`; the preview server simply serves the generated static files.

**Build fast. Iterate. Then seasonal clones = £££.**
If you change the output directory in the future, mirror that value in `netlify.toml` and the Netlify UI.

## 🧰 Tech stack
- Next.js 14 App Router
- React 18
- Tailwind CSS 3
- TypeScript

## 🗺️ Project layout
```
app/
layout.tsx # Global metadata and shell
page.tsx # Marketing site homepage
globals.css # Tailwind layers + design tokens
components/
QuoteCalculator.tsx # Interactive solar feasibility calculator
```

## 📜 Legal
- See `/legal` for affiliate disclosure and privacy notice.
## 📄 Licensing
All assets and content in this repository are provided under the MIT License unless stated otherwise.
12 changes: 0 additions & 12 deletions ShareButtons.tsx

This file was deleted.

64 changes: 0 additions & 64 deletions aigiftgen_v101 2/README.md

This file was deleted.

87 changes: 0 additions & 87 deletions aigiftgen_v101 2/app/api/gifts/route.ts

This file was deleted.

16 changes: 0 additions & 16 deletions aigiftgen_v101 2/app/clone/page.tsx

This file was deleted.

42 changes: 0 additions & 42 deletions aigiftgen_v101 2/app/globals.css

This file was deleted.

30 changes: 0 additions & 30 deletions aigiftgen_v101 2/app/layout.tsx

This file was deleted.

Loading