Skip to content

Mono-repo for all the user-facing services and applications

Notifications You must be signed in to change notification settings

DataWallet/user-facing

Repository files navigation

User-Facing Mono-Repo

Pre-requisites ✅

To get started with this repo, you'll need a few things:

  • make, it should be available by default on your machine
  • git, you can get it with via brew
  • awscli, you can get it via brew
  • node, we currently code against node 10.x (latest)
  • yarn, you can get it via either npm install -g yarn or via brew install yarn
  • lerna, you can get it via npm install lerna -g
  • docker, you can also get it via brew or download the Docker.app via the official website

Credentials 🔑

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

Installation 🛠

  • cd <your workspace path>
  • git clone git@github.com:DataWallet/user-facing.git
  • cd 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-migrate and then make db-migrate-apply. If you get the error '', run make dev and 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.

Git usage ⚠️

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-feature or git checkout -b fix/the-scope-of-your-bugfix any of the keywoards listed here:
  • 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
    git fetch
    git rebase origin/master
    git push
    
    to make sure that your branch is up-to-date with master and push your changes.
  • 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.

What to do when your branch as conflicts with master?

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!

Code Style 💅

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.

Development of the packages 📦

All the packages live in packages/. All the following commands should be ran from the root of the monorepo.


user-api

  • 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.


user-app-web

  • 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.


browser-extension

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.


@datawallet/redux

@datawallet/legacy-ui

@datawallet/telemetry

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.


Releases

TODO

About

Mono-repo for all the user-facing services and applications

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 7