Skip to content
Merged
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
5 changes: 3 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ GITHUB_TOKEN=
# GH_TOKEN=

# ─── SNAP market dashboard ────────────────────────────────────────────────────
# Optional override for the Dexscreener pairs API URL used by the /api/snap-market
# route. Defaults to the canonical SNAP/ETH pair on Ethereum mainnet.
# Optional override for the Dexscreener pairs API URL used by the Worker
# /api/snap-market route and the Astro build-time snapshot.
# Defaults to the canonical SNAP/ETH pair on Ethereum mainnet.
# Only change this if the pair migrates or you need to point at a test endpoint.
DEXSCREENER_PAIR_URL=https://api.dexscreener.com/latest/dex/pairs/ethereum/0x72a70a747a8390caf1aad3fb1de3564b55871f137539e498d30f02b1167742ea
10 changes: 7 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
Expand All @@ -13,7 +11,11 @@
# testing
/coverage

# next.js
# astro
.astro/
dist/

# next.js leftover
/.next/
/out/

Expand All @@ -24,6 +26,7 @@
.DS_Store
*.pem
.claude/
.wrangler/

# debug
npm-debug.log*
Expand All @@ -41,3 +44,4 @@ yarn-error.log*
# typescript
*.tsbuildinfo
next-env.d.ts
worker-configuration.d.ts
10 changes: 5 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,17 @@ npm install
npm run dev
```

Open [http://localhost:3000](http://localhost:3000).
Open [http://localhost:4321](http://localhost:4321).

## Scripts

| Script | Purpose |
| --- | --- |
| `npm run dev` | Start the Next.js dev server |
| `npm run build` | Production build |
| `npm run start` | Serve the production build locally |
| `npm run dev` | Start the Astro dev server |
| `npm run build` | Production static build to `./dist` |
| `npm run preview` | Serve the production build locally |
| `npm run lint` | Run ESLint |
| `npm run typecheck` | Run TypeScript without emitting files |
| `npm run typecheck` | Run `astro check` and TypeScript without emitting files |
| `npm run sync:sources` | Refresh the curated Farcasterorg source snapshot |

## Source sync
Expand Down
34 changes: 23 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,16 @@ The public website for Hypersnap, a decentralized fork of Snapchain for Farcaste

Hypersnap.org is built and maintained by [Arca Computer](https://arca.computer), with upstream protocol and documentation sources attributed throughout the site.

This branch is the **Astro + Cloudflare Workers canary**. It is static HTML (plus a small Worker only for `/api/*` live probes). It is not a DNS or production cutover.

## Development

```bash
npm install
npm run dev
```

Open `http://localhost:3000`.
Open `http://localhost:4321`.

## Core Scripts

Expand All @@ -22,6 +24,24 @@ npm run typecheck
npm run build
```

## Cloudflare canary

The Wrangler config (`wrangler.jsonc`) targets the existing Worker name `hypersnap-web-canary`. It does **not** create new KV, R2, or D1 resources.

```bash
npm run build
npx wrangler deploy # Loica / Degu only — this PR does not deploy
```

- Astro `output: "static"` — marketing, docs, install helper, and LLM exports are prerendered into `./dist`
- `@astrojs/cloudflare` is **not** used; there is no OpenNext / Next.js runtime on this path
- A thin `src/worker.ts` handles `/api/network-status` and `/api/snap-market` so browser pages can refresh live data without mixed-content or CORS issues
- `workers_dev` and `preview_urls` are both `false`

### OpenNext bridge (untouched)

`cad/cloudflare-migration` remains a temporary **OpenNext** (`@opennextjs/cloudflare`) bridge. Do not expand it. Preferred end state is this Astro canary. Production `hypersnap.org` stays on Vercel until Loica/Degu cut over.

## Source Sync

`src/data/farcasterorg-sources.json` is generated by `scripts/sync-sources.mjs` from public `farcasterorg` repositories. The script imports curated facts only: repo metadata, README summaries, release data, docs links, public node details, node commands, and architecture notes.
Expand All @@ -30,13 +50,5 @@ The scheduled GitHub Action in `.github/workflows/sync-farcasterorg-sources.yml`

## Deployment

The site is designed for Vercel:

```bash
vercel
vercel --prod
```

The canonical production domain is `https://hypersnap.org`.

Production deploys from `main` in [`arcacomputer/hypersnapweb`](https://github.com/arcacomputer/hypersnapweb).
- **Production today:** Vercel from `main` at [`arcacomputer/hypersnapweb`](https://github.com/arcacomputer/hypersnapweb), canonical domain `https://hypersnap.org`
- **Canary (this tree):** Cloudflare Worker `hypersnap-web-canary`. No DNS change and no Vercel delete in this PR.
18 changes: 18 additions & 0 deletions astro.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { fileURLToPath } from "node:url";
import { defineConfig } from "astro/config";
import react from "@astrojs/react";
import tailwindcss from "@tailwindcss/vite";

export default defineConfig({
site: "https://hypersnap.org",
output: "static",
integrations: [react()],
vite: {
plugins: [tailwindcss()],
resolve: {
alias: {
"@": fileURLToPath(new URL("./src", import.meta.url)),
},
},
},
});
50 changes: 32 additions & 18 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,19 +1,33 @@
import { defineConfig, globalIgnores } from "eslint/config";
import nextVitals from "eslint-config-next/core-web-vitals";
import nextTs from "eslint-config-next/typescript";
import js from "@eslint/js";
import globals from "globals";
import astro from "eslint-plugin-astro";
import tseslint from "typescript-eslint";

const eslintConfig = defineConfig([
...nextVitals,
...nextTs,
// Override default ignores of eslint-config-next.
globalIgnores([
// Default ignores of eslint-config-next:
".next/**",
".claude/**",
"out/**",
"build/**",
"next-env.d.ts",
]),
]);

export default eslintConfig;
export default [
js.configs.recommended,
...tseslint.configs.recommended,
...astro.configs.recommended,
{
languageOptions: {
globals: {
...globals.browser,
...globals.node,
},
},
rules: {
"@typescript-eslint/no-unused-vars": [
"error",
{ argsIgnorePattern: "^_", varsIgnorePattern: "^_" },
],
},
},
{
ignores: [
"dist/**",
".astro/**",
"node_modules/**",
"worker-configuration.d.ts",
"src/env.d.ts",
],
},
];
39 changes: 0 additions & 39 deletions next.config.ts

This file was deleted.

Loading
Loading