Teknologföreningen's homepage. Built with Next.js and Strapi.
- Install Node.js (v18)
- Install yarn (tip: run
corepack enable
) - Install dependencies
yarn install
- Set environmental variables in
.env.local
- Run development server
yarn dev
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.
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.
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.