Modularized platform for Bitrock internal use.
- GitHub Repository
- Board
- Wiki
- Supabase Dashboard
- env variables on Notion (ask Davide Ghiotto for access)
git clone git@github.com:bitrockteam/bitrock-center.gitInside the project there's an init.sh file, runnable in MacOs / Linux systems.
To proceed execute the following commands and follow the instructions
chmod +x init.sh
./init.sh- See env variables on dedicated notion page (ask Davide Ghiotto for access)
- Copy
.env.exampleto.envfile and update the values accordingly.
Beware that you will need to run the local instance of Supabase to obtain these two:
NEXT_PUBLIC_SUPABASE_ANON_KEYandSUPABASE_PROJECT_KEY. Keep reading to understand how to get them.
- install the supabase cli (optional): if not installed a prefix
npxis required to run the supabase via command line - run
supabase loginto access the hosted supabase instance - run
supabase linkto link the local instance to the remote one (for database diff, migrations and other stuff)- Get the
DATABASE_PASSWORDfrom Notion page and paste it when prompted
- Get the
- run
supabase startwill start a docker container for your local supabase instance
If everything run correctly you should see something like this on your terminal:
Started supabase local development setup.
API URL: http://localhost:54321
DB URL: postgresql://postgres:postgres@localhost:54322/postgres
Studio URL: http://localhost:54323
Inbucket URL: http://localhost:54324
anon key: eyJh......
service_role key: eyJh......
# Or
Publishable key: sb_publishable_A.....
Secret key: sb_secret_N.....In the console you will see the "anon" and "service_role" keys displaying two tokens. These are respectively the values of
.env > NEXT_PUBLIC_SUPABASE_ANON_KEYand.env > SUPABASE_PROJECT_KEY. Or in different versions could be "Publishable key" equivalent to "anon" and "Secret key" equivalent to "service_role".
Access the studio at http://localhost:54323.
To stop the container just run supabase stop.
supabase db pullto download locally the remote configuration along with the schemasupabase db dump -f supabase/seed.sql --data-onlyto download only the data available in the remote instanceWarning: do not commit
supabase/seed.sqlfile since it contains data from the authentication of the users. First we need to exclude this data from the local dumpsupabase migration upto apply the new migrationssupabase db resetto reset the local instance and restarting it applying the new schema and seed data from the remote updates
This procedure will automatically apply the migrations.
- create a migration with
supabase db diff -f <your-migration-name> - locally test that running
supabase db resetwill manage correctly the migration - when all checks are done (and maybe after releasing in develop/main branch) run the
supabase db pushcommand to push your local changes to the remote instance
The push command will not reset the data on the remote instance.
nvm install(ornvm useif you have already installed the version written in.nvmrcfile)corepack enablebunbun run buildbun run dev:- frontend on
localhost:3000
- frontend on
We are going to use github flow as branching
strategy.
- feature branch:
feat/<issue-number>-branch-summary-here-> e.g. (5-users-management) - bug branch:
bug/<issue-number>-branch-summary-here
Issue states:
- to do
- in progress
- pull requested
- dev released
- done
- Conventional Commit: check commit message format with standard format
- Pre-commit checks with husky: check linting & commit message format
We cannot merge directly in main and we will require the pipelines to pass.