Skip to content

Oak-Construction-Productivity/swwpp-nextjs-subscription

Repository files navigation

SWPPP Automation

Features

  • Automate swppp reporting with daily, weekly, and monthly reporting.
  • Aggregate projects, and weather data for easy swppp daily/weekly reporting
  • Swppp project plan builder and document aggregator
  • Swppp learing resources for Swppp managers
  • Compliance and automation tools to make swppp easy

Demo

Contribution Instructions

Never work on main, only pull request to main from respective branch

Work on respective branch and pull request in

Before Commits -> Run yarn run build or npm run build -> Ensure a clean build is pushed to your branch before commiting

Upon clean build commit and open pull requests.

It is the contributor/branch users responsibility to pull main changes in periodically or when changes are made on main. Use this to help -> Do not rebase, merge instead like so

Develop locally

If you haven't already done so, clone your Github repository to your local machine. If not adding stripe products or vercel developments skip stripe and vercel CLIs below and start with NPM. You will need the .env.local to get the site running.

Next, use the Vercel CLI to link your project:

vercel login
vercel link

Setting up the env vars locally

Use the Vercel CLI to download the development env vars:

vercel env pull .env.local

Running this command will create a new .env.local file in your project folder. For security purposes, you will need to set the SUPABASE_SERVICE_ROLE_KEY manually from your Supabase dashboard (Settings > API).

Use the Stripe CLI to test webhooks

Install the Stripe CLI and link your Stripe account.

Next, start local webhook forwarding:

stripe listen --forward-to=localhost:3000/api/webhooks

Running this Stripe command will print a webhook secret (such as, whsec_***) to the console. Set STRIPE_WEBHOOK_SECRET to this value in your .env.local file.

Install dependencies and run the Next.js client

In a separate terminal, run the following commands to install dependencies and start the development server:

npm install
npm run dev
# or
yarn
yarn dev

Note that webhook forwarding and the development server must be running concurrently in two separate terminals for the application to work correctly.

Finally, navigate to http://localhost:3000 in your browser to see the application rendered.

This repository is a clone of the following repo for any troubleshooting:

https://github.com/vercel/nextjs-subscription-payments

Going live

Archive testing products

Archive all test mode Stripe products before going live. Before creating your live mode products, make sure to follow the steps below to set up your live mode env vars and webhooks.

Configure production environment variables

To run the project in live mode and process payments with Stripe, switch Stripe from "test mode" to "production mode." Your Stripe API keys will be different in production mode, and you will have to create a separate production mode webhook. Copy these values and paste them into Vercel, replacing the test mode values.

Redeploy

Afterward, you will need to rebuild your production deployment for the changes to take effect. Within your project Dashboard, navigate to the "Deployments" tab, select the most recent deployment, click the overflow menu button (next to the "Visit" button) and select "Redeploy" (do NOT enable the "Use existing Build Cache" option).

Todo List

Front End

  • Design Overhall Schema -- Form Design -- Header -- Forms -- Button -- Front Page -- Chat window -- Notification popups

Back End and Features

  • Project Summary Home Page

  • Subpages -> -- Swpppy Ai Assistant -- Reporting - change old slug page to dashboard, delete old slugging first make sure other slugging works -- Binder Builder

  • Other To Do -- submission form - form handeling route upon successful submission - location -- settings page, add delete project page -- edit projects page and form to edit projects, add delete here with pop up -- project page change from for to overview, new page to route to report submission -- project page - map tile, link to swppp plan builder -- project - 3 options -> Plan builder, Swppp AI Consultant, Report Automation -- Paginate weather data

Releases

No releases published

Packages

No packages published