Skip to content

duncanjbain/bugtracker

Repository files navigation

Bug Tracker

CircleCI Netlify Codecov GitHub Website GitHub commit activity

Table of Contents

Introduction

Bug Tracker is a bug and issue tracker created with React, Node.JS, GraphQL and MongoDB.

A hosted demo is available at https://bugtracker.duncanbain.dev.

Note: As the backend is hosted on a free tier Heroku node, it may require a 5-10 second spin up time before loading for the first time

It has the following functionality:

  • Can register
  • Can login
  • View and update their profile and login information
  • Create a Project
  • Add a bug to a Project
  • Assign users to a Bug
  • View created and assigned bugs using a dashboard
  • Edit Projects or Bugs

Stack

The frontend uses the following:

The backend uses:

Authentication is implemented using a JSON Web Token (JWT) saved in local storage. Upon a successful login attempt made to the GraphQL endpoint, the response is a JWT containing the name and user ID of the user. This token is then added to every API request that requires authorisation.

Testing is carried out with Jest handling the GraphQL and MongoDB integration testing, with Cypress used for end-to-end testing.

CircleCI is used for continuous  integration and performs both the integration and end-to-end testing upon a pull request made to the repository. CodeCov is used to provide code coverage information.

Following a successful testing and build process, once the pull request is merged CircleCI conducts a deployment of the frontend to Netlify and the backend is deployed to Heroku.

Installation

Clone the repository

git clone https://github.com/duncanjbain/bugtracker.git

Then install dependencies

cd bugtracker
yarn install

Create a .env file in the directory packages/backend containing the following two variables:

#JWT_SECRET is used in the JWT generation for signing
JWT_SECRET=EXAMPLE

#MONGODB_URI is the MongoDB to use
MONGODB_URI=mongodb+srv://[...]

If you do not wish to use a hosted MongoDB instance you can leave MONGODB_URI blank, we will cover launching a development instance using MongoDB Memory Server next.

Run development environment with hosted MongoDB

If you wish to run the development environment using a hosted MongoDB instance, then run the following command from the monorepo root:

yarn start:dev

You can then access it at https://localhost:3000. The GraphQL API is available at https://localhost:4000.

Run development environment with MongoDB Memory Server

If you do not have a hosted MongoDB instance available, you can run the development environment using a MongoDB instance hosted in memory. However, the database is not stored anywhere following the shutting down of the development environment.

yarn start:mongodb-memory

You can then access it at https://localhost:3000. The GraphQL API is available at https://localhost:4000.