Giter VIP home page Giter VIP logo

partner-gallery-example's Introduction

Supabase Partner Gallery Example

An example Next.js website that shows Postgres Full Text Search, next-image with Supabase Storage, and sending emails based on an insert trigger with Supabase Edge Functions.

Partner Gallery screenshot

Deploy with Vercel

Usage

  1. Click the "Deploy" button above and run through the setup steps. This will automatically set your Supabase env vars and set up the Database schema located in the migrations folder.

  2. Deploy Supabase Edge Function for contact form notifications:

    supabase link --project-ref your-project-ref
    supabase secrets set SMTP_HOSTNAME="your.hostname.com" SMTP_PORT="2587" SMTP_USERNAME="your_username" SMTP_PASSWORD="your_password" SMTP_FROM="[email protected]" SMTP_TO="[email protected]" FUNCTION_SECRET="your-random-secret"
    supabase functions deploy contact-notification
    

    Note: SMTP_PORT must be a port other than 25, 465, and 587 as Deno Deploy does not support outgoing connections to ports. AWS SES (port 2587) is recommended.

  3. Setup a Supabase Function Hook to trigger the function when a new row is inserted into partner_contacts function hook setup 1 function hook setup 2

  4. Within Vercel project settings, ensure Framework Preset is set to Next.js and Root Directory is set to app.

  5. Insert partners into the partners table.

  6. Celebrate together ๐ŸŽ‰

Resources

partner-gallery-example's People

Contributors

alaister avatar dotaadarsh avatar jakefuentes avatar mertasan avatar thorwebdev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

partner-gallery-example's Issues

Build Error Prerendering Page for Partner generated Route

I am getting an error while building my app on vercel and locally. on vercel it says this:

Error occurred prerendering page "/partners/testdd". Read more: https://nextjs.org/docs/messages/prerender-error

08:49:51.869 | TypeError: Cannot read properties of null (reading 'map')
08:49:51.869 | at Partner (/vercel/path1/.next/server/pages/partners/[slug].js:174:62)
08:49:51.870 | at d (/vercel/path1/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:33:498)
08:49:51.870 | at bb (/vercel/path1/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:36:16)
08:49:51.870 | at b.render (/vercel/path1/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:42:43)
08:49:51.870 | at b.read (/vercel/path1/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:41:83)
08:49:51.870 | at exports.renderToString (/vercel/path1/node_modules/react-dom/cjs/react-dom-server.node.production.min.js:52:138)
08:49:51.870 | at Object.renderPage (/vercel/path1/node_modules/next/dist/server/render.js:680:46)
08:49:51.871 | at Object.defaultGetInitialProps (/vercel/path1/node_modules/next/dist/server/render.js:350:67)
08:49:51.871 | at Document.getInitialProps (/vercel/path1/.next/server/pages/_document.js:29:20)
08:49:51.871 | at Object. (/vercel/path1/node_modules/next/dist/shared/lib/utils.js:75:33)

Build error occurred
--
08:49:52.061 | info - Generating static pages (7/7)
08:49:52.064 | Error: Export encountered errors on following paths:
08:49:52.065 | /partners/[slug]: /partners/test
08:49:52.065 | /partners/[slug]: /partners/testdd
08:49:52.065 | at /vercel/path1/node_modules/next/dist/export/index.js:404:19
08:49:52.065 | at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
08:49:52.066 | at async Span.traceAsyncFn (/vercel/path1/node_modules/next/dist/trace/trace.js:79:20)
08:49:52.066 | at async /vercel/path1/node_modules/next/dist/build/index.js:1230:21
08:49:52.066 | at async Span.traceAsyncFn (/vercel/path1/node_modules/next/dist/trace/trace.js:79:20)
08:49:52.066 | at async /vercel/path1/node_modules/next/dist/build/index.js:1092:17
08:49:52.067 | at async Span.traceAsyncFn (/vercel/path1/node_modules/next/dist/trace/trace.js:79:20)
08:49:52.067 | at async Object.build [as default] (/vercel/path1/node_modules/next/dist/build/index.js:65:29)

Locally it says this:
2023-01-20T15:39:03.276Z Failed to compile.
2023-01-20T15:39:03.276Z
2023-01-20T15:39:03.277Z ./pages/partners/integrations/index.tsx:40:3
2023-01-20T15:39:03.277Z Type error: Expression expected.
2023-01-20T15:39:03.277Z
2023-01-20T15:39:03.277Z 38 | const [partners, setPartners] = useState(initialPartners)
2023-01-20T15:39:03.277Z 39 | const [featured, setFeatured] =
2023-01-20T15:39:03.278Z > 40 | const allCategories = Array.from(
2023-01-20T15:39:03.278Z | ^
2023-01-20T15:39:03.278Z 41 | new Set(initialPartners.map((p) => p.category))
2023-01-20T15:39:03.278Z 42 | )
2023-01-20T15:39:03.278Z 43 |
2023-01-20T15:39:03.325Z Error: Command "npm run build" exited with 1
2023-01-20T15:39:03.513Z

I am on a M1 Mac running OS Venture 13.1 I have configured my supabase environment variables locally and on vercel and have added 2 rows to the partner and partner contact supabase. This problem happens once a row is created in the partners table.

Thank you very much for the help I would love to get this app working

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.