To get started with this repo, you'll need a few things:
make, it should be available by default on your machinegit, you can get it with viabrewawscli, you can get it viabrewnode, we currently code against node 10.x (latest)yarn, you can get it via eithernpm install -g yarnor viabrew install yarnlerna, you can get it vianpm install lerna -gdocker, you can also get it viabrewor download the Docker.app via the official website
You will need to ask the infrastructure team for a AWS-Staging user and access keys.
You might also need a postgresql dump from either staging or a colleague's dev environment.
Once you have those credentials, you may run aws configure
> Your access key? <paste your access key>
> Your secret access key? <paste your secret access key>
> Default region? eu-central-1
cd <your workspace path>git clone git@github.com:DataWallet/user-facing.gitcd user-facing- If you have a pg dump,
mkdir dumps && cp <your dump> dumps/db_dump.sql && make db-import make dev- If you already have a database and it is not synced, run
make db-migrateand thenmake db-migrate-apply. If you get the error '', runmake devand try again. - If you want to create a user with your GIT email and the password 'password', run
make create-user.- ️️
⚠️ Don't forget to confirm your email! (by either manually editing the users database or checking your emails) ⚠️ You need to have the user-api running to run this command!
- ️️
- If you can't login to the contest with due to your email's domain, log into the database and run
UPDATE "public"."user_api_settings" SET "value"='opened' WHERE "key"='contest-registration-status'; - That should be it!
PS: We are working on removing having a mandatory .env file. Meanwhile ask a colleague for one.
There is only one main branch to this repository: master, whenever you push to it, travis will try to deploy this commit to staging. The standard workflow goes like this:
- Choose new feature to develop, bug to fix, or any improvement to code
git checkout -b feat/your-featureorgit checkout -b fix/the-scope-of-your-bugfixany of the keywoards listed here:chore,docs,feat,fix,refactor,style, ortest(See this explanations for each keyword, chore includes build+ci types)
- Try your best to have atomic commits with one and only one featurethat can exist on its own, no "fix a bunch of stuff"
- this means that commits must result in buildable and runnable applications state. There can be imperfect functionality as is normal with development (partial non-conflicting implementations).
- when you commit, your commit will be automatically prepended with
[scope-of-your-changes]eg:[user-api+browser-extension],[redux], etc. You can op-out this behavior (not recommended) by writing the scope yourselve via[some scope]prepended to your commit message.
- It is good practice to reference issues and pull-request in your commit. This guide explains how to do it
- When your work is ready, do
to make sure that your branch is up-to-date with master and push your changes.
git fetch git rebase origin/master git push - If you're happy with your code and the results, make a pull-request from your branch into master, and assign a colleague able to review your work as a reviewer.
- Travis will then try to build this branch and run exisiting tests
- Wait for review feedback or not
Always be up to date with origin/master before repo operations. 🤔
Your usual commit should look like this:
feat: add awesome button
^--^ ^----------------^
| |
| +-> Summary in present tense.
|
+-------> Type: chore, docs, feat, fix, refactor, style, or test.
Rebase it carefully. You are responsible for your branch, if you delete the work of your colleague by rebasing, your branch will not be merged!
We follow the Airbnb JavaScript style guide. This will be enforced by a pre-commit hook. If you have questions regarding a specific rule please refer to the guide, it has great explanations.
Don't worry about formatting, all code will be automatically formatted on commit.
All the packages live in packages/. All the following commands should be ran from the root of the monorepo.
make dev user-api- That's it!
- Your local api should run on port 5000 by default.
Note: this starts the build in watch mode and will reload the api on file change.
make dev- That's it!
- Your local api should run on port 5000 by default as well as the front-end at http://localhost:8000.
Note: this starts the build in watch mode and will reload the page on file change.
This will guide you to develop and run the extension in Chrome.
make dev-chrome-extension, will start the watcher- Head to chrome://extensions/ in your browser
- Make sure you're in developer mode
- Load Unpacked
- Select the directory
<workspace>/user-facing/packages/browser-extension/generated/
Note: To modify anything, you may need to have the api running. By default it will try to use http://localhost:5000 as its user-api.
Those 3 packages do not currently run on their own. They provide ui components, redux logic and loggly/bugsnag helpers for the other packages and should already be listed as dependencies.
TODO