Skip to content

Mobile Setup

Jacob Jaffe edited this page Dec 28, 2018 · 1 revision

Mobile Setup:

For testing, you can ommit a lot of the development steps. In particular, you don't need to worry about flow configs, which means completely avoiding yarn!

Note: These steps are for Mac setup. If on a Linux machine, these steps should be pretty similar, but dig through the various scripts referenced, as there are small differences. No instructions for Windows setup ATM.

  1. Figure out where you want this to live. Personally, I have all my projects in a Projects folder, so all absolute paths will be ~/Users/jacobjaffe/Projects/... Make sure to change those paths accordingly! All paths, unless otherwise noted, will be based on the project root (./ refers to ProjectGEM/).

  2. Clone this repo locally: git clone https://github.com/mgreenw/ProjectGEM.git

  3. Run ./src/server/scripts/setup-mac. This does the following:

    • Installs nvm, which ensures we're using the correct node version.
    • Installs version 8.12.0 of node.js, and uses it.
    • Installs Homebrew
    • Installs & starts postgresql
    • Sets up the databases
  4. From the server: cd ./src/server/, run: npm run dev Follow instructions for any errors, e.g. npm run migrate up. Congrats! Your server is now running locally!

  5. Now, go to the mobile directory: cd ../mobile and install dependencies: npm install

  6. Install the expo command line tools: npm install -g expo-cli (Globally! These are for you development purposes, not for the code here)

  7. ** On your phone ** download the 'expo' app. (Looks like: https://expo.io/)

  8. Run: expo start (still from the mobile directory).

  9. Scan the QR code that appears with your phone.

Congrats! Everything is now running!

Dev Setup

TODO: Make better steps.

Basically, follow the above, but also install flow. Make sure you are in an IDE that can handle flow, like VSCode or Atom. Also, install Prettier so that our code is formatted the same.

Troubleshooting

Often, things don't just work out of the box. That's okay! Let's try and fix those issues.


The data directory was initialized by PostgreSQL version 10, which is not compatible with this version 11.1.

Uh oh, looks like stuff was setup in the wrong version. If you don't really care about your Postgres data, do this:

rm -rf /usr/local/var/postgres && initdb /usr/local/var/postgres -E utf8

And then restart:

brew services restart postgres

(This actually keeps the wrong version, but we should be compatible with 11.x (? @Max))


psql: FATAL: database "jacobjaffe" does not exist (Or really, database $USER).

Run: createdb jacobjaffe (substitute with your $USER)


Clone this wiki locally