Skip to content

d2s/events-api

Repository files navigation

Events API

JSON API for listing events related details.

Commitizen friendly

Development guidelines

Setting up local development environment

git clone https://github.com/d2s/events-api.git
cd events-api
npm install

Running the application locally

npm run dev

Dependencies

  • Micro
    • "Asynchronous HTTP microservices"

Development dependencies

  • micro-dev
    • "CLI provides tools for building microservices a breeze!"
  • xo
    • "Opinionated but configurable ESLint wrapper with lots of goodies included. Enforces strict and readable code."

Running the application with Docker

Building Docker container images

Multi-stage builds allow developers to build smaller app images, saving storage space and resources from the end users. Really good thing from the app security viewpoint, as there are less leftovers from the build process.

Dependencies: You need to have Docker CE installed on your development environment, if you want to build new Docker containers.

To build the Docker container, run the command:

npm run build-docker

Running the container image locally

TODO: Write full instructions on how to run the application with Docker. (Not yet tested.)

docker-compose up

Git commits

.gitignore is based on the Node.gitignore example ignore patterns.

Create new Git commits

Check what files have changed, and look what branch you are now

git status

Add required files to the Git staging area

git add FILENAME

Create a new commit

npm run git-commit

Alternative to that, you could use git commit directly. Commit message will be automatically validated by husky. Please write down the commit message to another text file/buffer before creating the commit message (as husky will stop and tell error if the commit message is not compliant to standards).

Releasing new version

When you want to release a new version of the application, use the pre-configured scripts to automate much of the release process.

standard-version does automatic versioning and CHANGELOG generation, using conventional commit messages.

How it works:

  1. When you land commits on your master branch, select the "Squash and Merge" option.
  2. Add a title and body to the commit message that follows the Conventional Commits Specification.
  3. When you're ready to release:
    1. run: git checkout master; git pull origin master
    2. run: npm run release
    3. run: npm run git-push-tags

npm run release (that is an alias for standard-version) does the following:

  1. Bumps the version in package.json (based on your commit history)
  2. Uses conventional-changelog to update CHANGELOG.md
  3. Commits package.json (et al.) and CHANGELOG.md
  4. Tags a new release

About

☁️ 2018–2020 — Tiny JSON API for listing events. (WIP)

Resources

License

Stars

Watchers

Forks

Packages

No packages published