PlanerInnen für Deutsche Wohnen & Co Enteignen is an open letter from Berlin architects to support the project Deutsche Wohnen & Co Enteignen project, a city-wide campaign to release Berlin's private housing back into the affordable rental market. (Read the letter here)
This is the open letter's repository, built using Next.js and TypeScript.
The signatures of the open letter are collected on Supabase instance. To replicate this repo, you must first make sure to have your own Supabase instance (the backend) containing a single table with the following columns:
- userId (reference to the auth table, required)
- firstName (text, required)
- lastName (text, required)
- confirmedAt (timestamp, required)
- organisation (text, optional)
Then, clone this repository (the frontend), create a file on the root level named .env
or .env.development.local
and fill in the required values (see .env.example
for a reference). You need to add the following env variables as GitHub secrets for your repository if you wish the github actions to run:
NEXT_PRIVATE_SUPABASE_SERVICE_KEY
NEXT_PUBLIC_SUPABASE_ANON_KEY
NEXT_PUBLIC_SUPABASE_URL
Finally, run npm install
to install all required dependencies and then npm run dev
to start developing locally. All available script can be found further down.
This repo use husky and lint-staged to run some quality management script before each commits. These scripts are:
- Lint all js files
- Type-check changed typescript files
- Run tests concerned by changed files
To enable type checking of only staged files, a script has been added scripts/tsc-lint.sh
. To allow this script to run, you might need to give it the relevant permissions. Run chmod +x scripts/tsc-lint.sh
. The script is needed because there is otherwise no way to run tsc
only on staged files. Typescript only allows for either a list of files or a tsconfig.json
.
The folder structure follows Next.js's recommendations.
Page routing is achieved with Next.js's file-system routing. The views themselves are simply React components that can be found in src/components
. All other components can be found there as well.
This repo uses Storybook to create and test its React components in isolation. It also uses the storyshots addon to create test snapshots.
The library jest is used to unit test the code as well as testing-library to test the react components, user events, and other things.
To run the tests enter:
npm t
Or in watch mode:
nom run test:watch
This project uses Tailwind CSS for styling. The primary style definitions can be found in src/style/theme.ts
. The theme can be referenced in every component. For visual consistency, definitions from the theme should be used whenever possible. Information about using the theme can be found in Theme UI's docs.
New features, fixes, etc. should always be developed on a separate branch:
- In your local repository, checkout the
main
branch. - Run
git checkout -b <name-of-your-branch>
to create a new branch (ideally following Conventional Commits and with a reference ID). - Make your changes
- Push your changes to the remote:
git push -U origin HEAD
- Open a pull request.
You can commit using the npm run cm
command to ensure your commits follow our conventions.
The frontend is currently deployed to Vercel. Pushing to the main
branch will automatically trigger a new deploy. This should be avoided, if possible. Rather use pull requests against main.