Skip to content

vitorsalgado/camara-deputados-graphql

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GraphQL API · Chamber of Deputies of Brazil

Repository Logo
Proxy GraphQL exposing Brazilian Chamber of Deputies Rest API using TypeScript.

Sample GraphiQL

GitHub Action Status Codecov Maintainability Prettier Conventional Commits

Other Languages

Overview

Application that exposes Brazilian Chamber of Deputies REST API through a GraphQL.
This project is intended to serve as a learning experience for GraphQL and also to explore NodeJS architecture models with TypeScript.
This is a Work in Progress.

Demo

A demo application is available on: https://graphql-chamber-deputies-br.herokuapp.com/graphiql

Chamber of Deputies Open Data

This is the Swagger documentation for the API which this application uses to get all data.

Tech

  • TypeScript
  • Fastify
  • Drizzle-Http
  • Mercuries
  • Pino
  • Redis
  • Jest / Nock / Supertest
  • Docker / Docker Compose
  • ESLint / Prettier / Husky / Lint Staged

Dev

This project uses a mix of tools to enforce code-style and quality.
ESLint is used for lint, Husky, Pretties and Lint Staged when configured, ensures that no files will be committed without following project standards.

Configurations

The application Environment Variables for configurations and the lib DotEnv allows you to change values on local environment. Create a file .env on project root and place there the env vars you want to change.
Check this Joi schema, all application environment variables are there.

Running

Installing Dependencies

NPM is the chosen package manager for this project.
To install dependencies, run:

npm i

Local Development

To start a local development environment with Nodemon, run:

npm run start:dev

Local Development with Docker Compose

To start a local development environment with Docker Compose, run:

make dev-docker

This Docker Compose contains a container that executes the application with Nodemon and a container for Redis.

Build and Run

To build TypeScript and execute the application, run:

npm run build
npm start

Docker

This Dockerfile generates a minimalist docker image for the application.
To execute an environment with a Redis instance and minimalist application container, execute:

make up

Tests

tested with jest

The test framework of this project is Jest.
SuperTest and Nock are used for integration tests, simulating API integrations.
To execute the tests, run:

npm test

License

FOSSA Status

This project is Apache Licensed.