Partiguiden is a website created with the purpose of making information about the political climate in Sweden as accessible as possible.
- React.js - Javascript framework for developing web apps.
- Next.js - React.js framework for developing server rendered apps.
- Vercel - For deployments
In this section, information on how to set up and contribute to the project will be presented.
- yarn - Package manager
- vercel-cli - (optional) Used for interacting with the vercel project
To easily get started with the bare minimum environment variables to get started, a file .env.example
is provided in this project. This configuration allows you to interact with the beta version of the backend. To copy this config, run:
cp .env.example .env
Alternatively, if have an authenticated vercel-cli and have access to the project, you can get a complete copy of the development environment configuration by running:
vercel env pull
If you have access to the vercel project, you may use the following command to make use of serverless functionality:
yarn start # Runs the command `vercel dev` (https://vercel.com/docs/cli#commands/dev)
If you don't have access to the vercel project, you can run using Next's development mode using:
yarn start-dev # Runs the command `next dev` (https://nextjs.org/docs/api-reference/cli#development)
This project uses ESLint and Prettier for code linting and formatting. The configuration for ESLint can be found in the file .eslintrc and for Prettier in the file .prettierrc. To check linting and formatting of the project, run the command:
yarn lint # Will run the commands `tsc` for type checking and `eslint` for linting and code formatting
This project used Github Actions for continuos integration and a Vercel integration for continuos deployment.
The Github Actions workflows can be found in the directory .github/workflows/. The purpose of these workflows is to run tests and ensure that the files abide by the linting and code formatting configurations.
This project uses Vercel for continuos deployment. Beside from the production and beta environment, deployments are also made for every incoming PR, these will be deployed to a separate automatic generated domain using Vercel's Preview configuration. New features should be tested within the preview environment before added to the beta branch.
Environment | Branch | Domain | Notes |
---|---|---|---|
Production | main |
partiguiden.nu | User facing version of the website |
Beta | develop |
beta.partiguiden.nu | Environment for testing new features / improvements |
Preview | PR branches | - | Environment that is used for incoming PR's, will deploy to an automatic generated url, hosted on Vercel |