Skip to content

knuhol/dkdb-fe

Repository files navigation

DKDB - Database of Czech LGBT Books (Frontend)

build   version   React version   TypeScript version   commitizen: friendly   ESLint   Prettier   Coveralls   Website   license

https://dkdb.cz

Table of Contents§

About

We are LGBT couple Knut and Tereza Holm who have thought that there is no such place on Czech internet where you can find LGBT books in Czech language categorized by its sub genres - so we have created it.

Development

Backend

Backend of this project is written in Java and is located in separate GitHub repo at dkdb-be.

Deployment

Prod version is deployed at Heroku with standard Node.js app buildpack. It runs this sequence of commands:

$ npm install
$ npm run build
$ npm run start:heroku

Environment Variables

To be able to run app successfully on Heroku, you need to provide several environment variables:

# URL to instance of this project
$ heroku config:set PUBLIC_URL=https://dkdb.cz

# URL to instance of dkdb-be project
$ heroku config:set API_URL=https://data.dkdb.cz

# name of the current Heroku app
$ heroku config:set HEROKU_APP_NAME=dkdb-fe

# secret for prerender.io
$ heroku config:set PRERENDER_TOKEN=xxx

# Google Analytcs tracking ID
$ heroku config:set REACT_APP_GA_TRACKING_ID=xxx

Running Locally

Checkout this repo and install dependencies:

$ npm i

To start dev server with api-mock run this command:

$ npm start

Project is served at http://localhost:3000.

You can also start just the dev server alone by this command:

$ npm run dev-server

API

Full API documentation is available in dkdb-be project doc.

API Mock

There is a mock API for development purposes which offers all routes supported by official API.

This mock server is automatically start together with npm start command and is served at localhost:3001, example route is http://localhost:3001/api/books.

You can also start the mock API server alone by this command:

$ npm run mock-api

Releases

Releases are fully automated by GitHub CI. You only need to do this:

  1. Run npm run release (or npm run release:prerelease for pre-release) which will bump a version, generate changelog and create git tags.
  2. Push the release commit to GitHub with --follow-tags flag.

Contribution

Project uses commitizen and commit messages check to keep the log align to standards of Conventional Commits.

Please use this command to make commits:

$ npm run commit

License

MIT