BertrandMarlair / graphAPI

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Welcome to 🔨 B-fine GraphQL API 👋

Twitter: @MarlairB

-> Apollo -> GraphQL -> PostGres -> Redis -> Docker.


About

We have many sources of data inside BFine, for many purposes

For the moment, all data are fake and this project is just a structure

The goal of this project is to have a GraphQL API to query/manipulate all these data in one place, securely, to make future projects easier.

Install

The GraphQL API is developed in node.js.
The code is written with ES2015 standards.
It use PostgreSQL as database.

To run it locally for testing and/or improve the codebase, enter the following commands:

  1. Ask a maintainer (for now, @bertrandmarlair) to give you the local /env/server.env file, which contains the credentials for the API uses by the project
  2. npm install (install project's dependencies)
  3. npm run build (first-time build of code)
  4. using two different terminal instances, launch the following commands:
    1. docker-compose up (launch db and server - the node-inspector is binded to http://localhost:5000)
    2. npm run work (launch babel's watch mode to rebuild the code as it changes)

⚠️ WARNING: if you had a new dependency in the package.json file, you need to re-run the docker-compose build command.

Endpoints

Then, you can access the following endpoints.

GraphQL endpoints

Browsing the database

You can access by using DBeaver The root account (in local development env) is:

  • username: postgres
  • password: postgres
  • post: 5001
  • database: api

Git Workflow

We use the gitflow model for this repository.

GitFlow schema

The master branch is our production branch. Its protected and only production maintainers of the project can push on it.

The release branch is our staging branch. Its also protected and only maintainers of the project can push on it.

The develop branch is our main development branch.
Its not protected (at least until the first production release) but please, try to use feature branches to develop new features.

The feature branches must be named feature/name-of-the-feature.
When ending a feature, avoid merging it directly to develop. Create a pull request instead, so it can be reviewed by the maintainers.

☝️ NOTE: if you want to mess around and tests things without harm, please create a playground branch, named like this: playground/your-name

Author

👤 Bertrand Marlair

Show your support

Give a ⭐️ if this project helped you!


This README was generated with ❤️ by readme-md-generator

About


Languages

Language:JavaScript 98.7%Language:Dockerfile 1.3%