Skip to content

Latest commit

 

History

History

frontend

SimpleGrants Frontend 📱

Table of Contents 📒

Requirements 📝

  • NodeJS (v17.5+)
  • yarn
  • Prisma CLI

Installation & Setup 🧪

The frontend utilizes NextAuth for authentication. You should update the authentication providers based on your platform requirements.

# To setup
$ yarn install

# Copy .env over
$ cp .env.example .env.local

# If running for production, use .env.production
$ cp .env.example .env.production

⚠️ Make sure to update the .env.local file with your values!

Running the app 🚀

💡 Before running the frontend, make sure that the backend is already running!

Local Development 👨🏻‍💻

You should not need to run these commands. See this section for more info. If you are running locally for development, there are a few things to take note of:

  1. Make sure that your Prisma schema is always in sync with the backend. To do this, run npm run generate.
  2. Run the command below to get it started
# Development mode
$ yarn dev -p 3001

Production Deployment 🔥

You should not need to run these commands. See this section for more info. If you are deploying this application for production, it is slightly easier to setup, but there are still some things to be aware of:

  1. Make sure you have a .env.production setup as it will be used by the docker-compose.yml file.
  2. Your next.config.js should include the domains & hostnames of where your image files are hosted.
# Production mode
$ yarn build && yarn start

Additional Notes 🧠

Prisma Schema

The frontend utilizes NextAuth, which shares a schema dependency with the backend. To ensure that the Prisma schemas are always in sync (locally), you should run npm run generate in the backend, which will copy the schema here and run Prisma generate. This is only needed for local development. Make sure to commit this to ensure the production setup uses the up to date schema.

Deployment 🚀

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

Check out the Next.js deployment documentation for more details. However, there is a lot more setup that you will need to do to ensure it works with your backend.