Branch | Environment | URL | Build status |
---|---|---|---|
next |
staging | https://staging.apps.dhis2.org/ | |
master |
production | https://apps.dhis2.org/ |
See docs in dhis2/docker-compose/app-hub.
- Install dependencies with
yarn install
- Copy
server/.env.template
toserver/.env
(cp server/.env.template server/.env
) and editserver/.env
. For development, your config will probably look something like:NODE_ENV=development RDS_USERNAME=postgres RDS_PASSWORD=postgres NO_AUTH_MAPPED_USER_ID=true
- Create database tables with
yarn db:migrate
. - Seed the database with
yarn db:seed
yarn start
yarn db:reset
The backend config file server/.env
contains credentials for the database, AWS S3 bucket and Auth0.
Available options are documented in .env.template
.
See server/knexfile.js
to specify which database connections/credentials or server to use depending on the value of process.env.NODE_ENV
.
The frontend needs to know some basic information about the server to configure routes and API endpoints.
This is located in client/default.config.js
.
You can rename or copy this file to override the settings.
Config files are loaded in the following order:
default.config.js
config.js
Environment specific configurations are also supported, and are loaded if process.env.NODE_ENV
is set to either development
or production
.
development.config.js
production.config.js
Note that the exported objects from each config file are merged with the previous, so any options not changed are kept from the previous config.
Note: If you make any changes, you will need to rebuild or restart webpack-dev-server for the changes to take effect.
// development.config.js
module.exports = {
api: {
baseURL: 'http://localhost:3000/api/',
redirectURL: 'http://localhost:3000/user',
},
routes: {
baseAppName: '',
},
}
This is the basename of where the app is located, used by routes. If it's hosted at http://localhost:3000/someUrl
this should be someUrl
otherwise leave empty.
routes.baseAppName: ''
The endpoint of the backend API to be used.
api.baseURL: 'http://localhost:3000/api/',
The URL to be used when auth0 has successfully logged in a user, and is redirected back to the page. Note that this URL needs to be whitelisted on the auth0 side aswell.
api.redirectURL: 'http://localhost:3000/user/'
yarn start
will start both the frontend and backend.
Frontend available at localhost:8080
.
Web API available at localhost:3000/api/v1
.
Swagger UI available at localhost:3000/documentation
Swagger specs available at localhost:3000/swagger.json
yarn start
and then in another terminal:
yarn run clone
This application is automatically released when merging into controlled branches.
- The
next
branch is deployed to staging. - The
master
branch is deployed to production.
So: all work should be merged to next
, and then next
is merged to
master
when we decide to cut a release.
The issue tracker can be found in DHIS2 JIRA under the HUB project.
Deep links: