React, Remix, Supabase, shadcn/ui (= Tailwind + Radix UI), TypeScript, Vite
- Fork this repo (see the gray
Fork
button on GitHub) - Clone your new repo to your computer (see the green
<> Code
button on GitHub) - Start Docker (used for Supabase)
- Start Supabase:
npx supabase start
(tip: you can run the Supabase web dashboard) - Take note of
anon key
when starting Supabase. Usenpx supabase status
if you didn’t get this already - Copy
.env.example
to.env
and updateSUPABASE_ANON_KEY
from step 4 - Reset/seed the database:
npx supabase db reset
- Install NPM packages:
npm install
Run the app with:
npm run dev
Go to http://localhost:3000/ and log in with:
- Email:
[email protected]
- Password:
henricmalmberg
We normally use Linear for issue tracking and creating branch names, but ignore this for now.
- Create new branch for the new feature/fix:
[username]/[description-of-feature]
(PR title: “Description of feature”). - Write your amazing code.
- Apply code linting/prettifier –
npm run fix
(ornpm run precommit
if you modified the database) – before committing code and correct any issues. - Create a new pull request (PR) on GitHub.
- Tech Lead will review your pull request.
P.S. It’s ok to merge main
branch into your own feature branch to solve conflicts.
Create empty, time-stamped migration file with:
npx supabase migration new [migration-name]
After migration:
- Test migrations and seeding with
npx supabase db reset
- Update the TypeScript types from Supabase/Postgres tables with
npm run gentypes
- Aim for 1) readability, then 2) minimalism/DRY:ness: “Code is read more than it is written”.
- Create functions that take an object as argument instead of multiple arguments where possible. Prefer
function foo({ arg1, arg2 })
overfunction foo(arg1, arg2)
. - Use
React.FC
for components. - Use a TypeScript
interface
called...Props
for complex function arguments, e.g:const CategoryCard: React.FC<CategoryCardProps>
- Event handlers starts with
handle
, props withon
:onPress={handlePressButton}
. - Organise your
import
s in groups: external imports, business logic, components, assets. - Define global TypeScript types including “shortcuts” to Supabase types in
global.d.ts
.
- Make a Supabase/Postgres SQL view with all columns you need, e.g.
view_emission_factors
- Create a file for your page/route (e.g.
app/routes/my-page.tsx
) with this structure:- Load data:
loader
(Remix) - Render:
export default function MyPageName
(React component). You can useDataTable
to render the list view. - Form interactions:
action
(Remix)
- Load data:
Go to http://localhost:3000/bigcorp/overview/2025/esrs/e1/e1-2/members
Currently we have statuses Owner and Contributor (member
in database). We now need a third status: Reviewer.
This will require changes to both database and UI.
Submit your code as a PR. Good luck!