Skip to content

NicolasOmar/my-pets-api

Repository files navigation

My Pets API

A standalone GraphQL server built with Node.js provides the backend API for the MyPets web client, which is developed using React.

Table of contents

Purpose

In 2020, after welcoming our first pet, my wife and I searched for a tool to help us manage events and changes related to our pets—both current and future. After exploring several options, we realized none fully met our needs, so we decided to create our own solution. That’s how MyPets was born.

Over nearly six years, the project has gone through multiple technology changes and periods of slow progress due to shifting priorities and other commitments. In 2026, the goal is to release a stable, user-friendly version that any family with pets can use—not just us.

Status

Project version Code Coverage Quality Gate Status Maintainability Rating Security Rating Technical Debt Known Vulnerabilities GitHub Repo stars GitHub commit activity GitHub last commit

Project Stack

express dependency typescript dependency graphql dependency apollo-server dependency nodemon dependency hbs dependency mongoose dependency bcryptjs dependency crypto-js dependency babel-node dependency jest dependency ts-jest dependency eslint dependency prettier dependency lint-staged dependency husky dependency

What do I need?

Before cloning this repo, I recommend installing the following software:

  • Node >=12.16.1 to install packages
  • MongoDB >=4.2.3 to have a local database
  • Robo 3T to visualize data on your Mongo Database

Setup

After cloning the repo, go to the created folder and install the node packages.

git clone https://github.com/NicolasOmar/my-pets-api.git
cd my-pets-api
npm install

How to run it

To run it correctly (as a non-stopping server using local environment variables), I modified the start command by adding nodemon and env-cmd. So just run the following line:

npm start

After start the server, you can access the GraphQL Plauground through the local link.

Folder structure

Once you have cloned the repo, it will show you the following folders:

  • .github: Github Actions files used to run post-merge.
  • env: Environment variables.
  • public: Contains only a css folder for specific home page styling.
  • scripts: Location of the update-version.js file, responsible of update package's version on each push.
  • src
    • constants: JSON files used for static values.
    • db: Connection to the Mongo database trough Mongoose as well as its Model declarations.
    • functions: Helper methods related to encryption and data parsing.
    • graphql: Server configuration based on Apollo GraphQl connection with its Schemas and Resolver declarations.
  • templates: Structure dedicated to show a start page based in Moustache.js. Shows links of other useful sites related to the project.
  • tests: Specific Jest configurations to test using a custom Mongoose connection.

Find out more

Project Status React Repo
Project board for project status tracking React front-end repository

License

MIT