Skip to content

Teknologforeningen/tf.fi

Repository files navigation

tf.fi

Teknologföreningen's homepage. Built with Next.js and Strapi.

Development

  1. Install Node.js (v18)
  2. Install yarn (tip: run corepack enable)
  3. Install dependencies yarn install
  4. Set environmental variables in .env.local
  5. Run development server yarn dev

Google environment variables

For calendar and file handling we use the google api. These requests are fetched with 2 google service accounts, one private defined by GOOGLE_PRIVATE_CREDS (for private file handling) and one public GOOGLE_CREDS (public file handling and calendar). These are currently managed by Teknologföreningen google workspace admin. New service account can be created like this, the service account environment variables are google service account keys. Google drive and calendar api read permissions need to be given to the service accounts for the features to work properly.

Calendar

The calendar events are directly fetched from a public google calendar by Google calendar api (calendar defined by NEXT_PUBLIC_GOOGLE_CALENDAR_ID in .env file). Implementation in /lib/google/calendar.ts.

File handling

The file handling is separated into public and private (needing auth) files, implementaiton in app/api/drive. These use the google drive api. The files are fetched from a specific google workspace for which SHARED_GOOGLE_DRIVE_ID needs to be defined to search files from the workspace.