Skip to content

Repository files navigation

This is a Next.js project bootstrapped with create-next-app.

I followed the tutorial here with some minor changes.

  • npx create-next-app with name: calculation-brainstorm
  • push repo to github
  • deploy repo on Vercel by adding a new Project which imports the github repo
  • create a Postgres database and connect it to the Project
  • npm i -g vercel@latest
  • npm i @vercel/postgres
  • vercel link This step was omitted from the tutorial
  • vercel env pull .env.development.local
  • make sure .env.development.local exists locally and that the variables in that file match the ones in the Vercel project
  • npm run dev
  • create file at path: src/app/api/test/route.ts
  • visit http://localhost:3000/api/test which creates a table in the db which can be seen in the Vercel dashboard
  • create file at path: src/app/api/addPet/route.ts
  • visit http://localhost:3000/api/addPet?petName=Johnny&ownerName=Mark which adds a row to the table that was just created

Switch from src/app to src/pages

nostr

npm install @nostr-dev-kit/ndk
npm install @noble/hashes
npm install nostr-tools
npm install nostr-hooks

Thought I needed to do these but I uninstalled them and still seems to work.

npm install ws
npm install websocket-polyfill 
# then on any nostr page:
import 'websocket-polyfill

CORS

To fix CORS problems, add vercel.json:

{
    "headers": [
        {
            "source": "/api/(.*)",
            "headers": [
                { "key": "Access-Control-Allow-Credentials", "value": "true" },
                { "key": "Access-Control-Allow-Origin", "value": "*" },
                { "key": "Access-Control-Allow-Methods", "value": "GET,OPTIONS,PATCH,DELETE,POST,PUT" },
                { "key": "Access-Control-Allow-Headers", "value": "X-CSRF-Token, X-Requested-With, Accept, Accept-Version, Content-Length, Content-MD5, Content-Type, Date, X-Api-Version" }
            ]
        }
    ]
}

WORKFLOW

How data is scraped from generic nostr relays

customer-specific actions

In customers table, or maybe make another table, need:

  • column fo ScoreCards in ultra-compact format (userID and f, m format)

db-wide actions

Getting Started

First, run the development server:

vercel dev
# or
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev

Open http://localhost:3000 with your browser to see the result.

You can start editing the page by modifying app/page.tsx. The page auto-updates as you edit the file.

This project uses next/font to automatically optimize and load Geist, a new font family for Vercel.

Learn More

To learn more about Next.js, take a look at the following resources:

You can check out the Next.js GitHub repository - your feedback and contributions are welcome!

Deploy on Vercel

The easiest way to deploy your Next.js app is to use the Vercel Platform from the creators of Next.js.

Check out our Next.js deployment documentation for more details.

Releases

Packages

Contributors

Languages