To prevent code with linter errors from reaching the repository, enable a pre-push script that runs linters before pushing:
$ git config --local core.hooksPath .githooks/
If you need to bypass the pre-push hook for a specific push, you can use the --no-verify
option:
$ git push --no-verify
.env
file: Use .env.example
as a template.Set the DATABASE_URL variable: Modify this variable to reflect your database user's details. Here's an example format:
DATABASE_URL="postgresql://johndoe:JohnDoeDoesPostgres@localhost:5432/johnDB?schema=public"
johnDB
in the DATABASE_URL can be named as desired. Prisma will create a new database if it doesn't exist.Run the migrations to set up the database schema:
npx prisma migrate deploy
After this step, your database is ready to go!
Note: To send feedback to Google Sheets, you'll need a Google Account and follow these steps. If you don't require this functionality, remove the following line from /pages/api/feedback/index.ts
:
sendFeedbackToGoogleSheets({
feedbackText: parsedFeedback.feedbackText,
userUUID: userData.uuid,
}).catch((e) => {
console.error(e);
});
Run the development server:
npm run dev
Open http://localhost:3000 in your browser to view the application.
Prerequisites:
Here are some additional resources from Google Cloud to explore, or you can follow the guide below:
Service account ID
is mandatory.Save the downloaded JSON file into your project, for example inside the root directory (the file can be saved anywhere inside the project, just remember to set the path in .env
file). Prepend google_service_account-
to the filename before saving to ignore it from git. For example:
google_service_account-arctic-diode-438812-b5-7338724a2dea.json
Important: You won't be able to retrieve the JSON file again, so keep it secure. If you lose it, you'll need to create a new key for the Service Account.
Go to https://console.cloud.google.com/apis/api/sheets.googleapis.com/ and enable the API. It might take a few minutes for the API to become active.
Palautteet
.Palaute
, cell B1: Palautteen antaja
, cell C1: Päivämäärä
.client_email
) to the sharing list.The last step is to modify two values in the .env
file:
.env.example
) of the JSON file you downloaded earlier (e.g., google_service_account-arctic-diode-438812-b5-7338724a2dea.json
).After making these changes, save the .env
file.
dotenv: not found
Ensure you've installed the dotenv-cli
package. It's usually installed with other dependencies when using npm i
. If not, use:
npm i dotenv-cli
If you still encounter the error, try installing dotenv-cli
globally:
npm install -g dotenv-cli
Note: You might need root access for global installation on Linux.
If you get this following error while running npm run svgr
:
Failed to handle file: public/images/icons/contact-details.svg # NOTE, this is just an example .svg file
/lahjalista/node_modules/@svgr/cli/dist/index.js:435
throw error;
^
Error [ERR_REQUIRE_ESM]: require() of ES Module /lahjalista/node_modules/prettier-plugin-tailwindcss/dist/index.mjs not supported.
Instead change the require of /lahjalista/node_modules/prettier-plugin-tailwindcss/dist/index.mjs to a dynamic import() which is available in all CommonJS modules.
Head to .prettierrc
file and remove the following line:"plugins": ["prettier-plugin-tailwindcss"]
. Save the .prettierrc
and try to runnpm run svgr
again. Now it should work. Remember to add the removed line back.