Skip to content

Latest commit

 

History

History
93 lines (62 loc) · 5.18 KB

DEV_QUICKSTART.md

File metadata and controls

93 lines (62 loc) · 5.18 KB

Dev quickstart

You will need these installed on your system:

  • Java 8+
  • Docker
  • nvm (only if working on frontend)

When you run ./gradlew runDev, you will get a server running at localhost:8080 with hot reload for templates. If you then cd into the client directory, you can run:

nvm use   // get correct version of node & npm
npm ci    // get dependencies
npm start // start proxy server

and you will have a browsersync proxy running at localhost:3000 with hot reload for the react components and sass styles.

If you bump into any problems, we have listed common errors and their solutions below.

Entrypoints

There is a file Routes.java which gets transpiled by the build into Routes.ts. You can do symbol navigation from there to see where to start for the server and client. Below are some of the most commonly used parts:

Social embed

client/src/main/scripts/common/social/social.ts defines a set of interface types which are used to define the schemas for all embeds. These objects are encoded via rison, and then placed at the end of the URL (e.g. the long cut:!(20... string above)

If you want to improve the social media embed for any of these types, use the instructions at the top of this file to launch a dev server at localhost:8080, with react hot-reload proxy on top localhost:3000.

Now, if you open a browser localhost:3000/devSocialEmbed, you can add a #blahblah to the URL bar, and it will:

Some example URLs are:

Going deeper

The instructions on this page should be enough to improve and extend the existing features of the application. If you want go deeper, and add completely new functionality, you'll need to look at DEV_DEEPDIVE.md.

Community

For general developer discussion, we have a chatroom on gitter.

If you want to help, these are the things we think are most important. But every open issue is important, and we welcome any contribution!

Common errors and their solutions

Java server startup

Couldn't connect to Docker daemon. You might need to start Docker

Start Docker!

'docker-compose kill' returned exit code 255

The Docker daemon probably isn't running. Start docker!

No container found for postgres_1

./gradlew dockerDown
./gradlew runDev

Unable to obtain connection from database: The connection attempt failed.

Just try ./gradlew runDev again.