Skip to content

sfbrigade/support-sfusd

Repository files navigation

About Support SFUSD

Hello! Thanks for checking out Support SFUSD. We started this project in summer 2022 to solve a big problem in San Francisco. Schools need help. And people who live or work in SF want to support local schools, but they don’t know how. We are building a website to help solve that.


Tech Stack

Next.js Typescript React Tailwind CSS HTML CSS


Mapbox

You need to sign up for Mapbox to run the project locally.

  1. Goto https://www.mapbox.com and sign up

  2. It will ask you for billing information, but it is pay as you go. You have 500 instances before you are charged.


Prisma

We're using Prisma as our ORM. If you're unsure of what it is or what it does here is a link to the prisma documentation regarding how it works and why its used

Model changes

Prisma documentation on prototyping schema

  • If you want to make changes to any model in prisma, the schema file within the prisma folder is where those changes will take place

  • Once you have made the changes to a model you're going to run this command in your terminal

    • The CLI will ask if you want to continue knowing that you will lose data, because we are seeding data and there is no user changes being made to our data this is completely acceptable
       npx prisma db push
  • This will execute the changes required to make the vercel postgres database schema reflect the state of our prisma schema

Seeding

  • After running npx prisma db push we lose all the data so we need to seed our database with all the school information, run this command in your terminal after making changes to the model

    • it should be noted that if you're making changes to the model the seed script will also need to be updated to account for the new fields that were added
       npx prisma db seed

Environment File

Create an environment file to pass your default public token from Mapbox

  1. Create a new file, .env, in the main directory (with the README.md file)

  2. Add your default public token to your .env

    NEXT_PUBLIC_MAPBOX_ACCESS_TOKEN=your_default_public_token
  3. For the prisma configuration you're going to need the vercel postgres URL, add both of these to your .env file, for security we will be adding these to the notion

    POSTGRES_PRISMA_URL=check_notion_page
    POSTGRES_URL_NON_POOLING=check_notion_page

Get Started

To run this project locally, please perform the following steps:

  1. Clone the repository

    git clone https://github.com/sfbrigade/support-sfusd.git
  2. Install dependencies at the root directory

    npm install
  3. Run the development server

    npm run dev
  4. Open http://localhost:3000 with your browser to see the result


Further Notes to help you out

Visit our Notion for Engineers