Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vitorsalgado/camara-deputados-graphql
GraphQL API exposing Brazilian Chamber of Deputies REST API
https://github.com/vitorsalgado/camara-deputados-graphql
architecture brasil brazil dados-abertos design-patterns government governo graphql nodejs open-data typescript
Last synced: 20 days ago
JSON representation
GraphQL API exposing Brazilian Chamber of Deputies REST API
- Host: GitHub
- URL: https://github.com/vitorsalgado/camara-deputados-graphql
- Owner: vitorsalgado
- License: apache-2.0
- Created: 2020-12-11T21:14:18.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2024-10-24T05:58:52.000Z (about 2 months ago)
- Last Synced: 2024-10-25T00:16:05.392Z (about 2 months ago)
- Topics: architecture, brasil, brazil, dados-abertos, design-patterns, government, governo, graphql, nodejs, open-data, typescript
- Language: TypeScript
- Homepage: https://graphql-chamber-deputies-br.herokuapp.com/graphiql
- Size: 3.4 MB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 53
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
GraphQL API · Chamber of Deputies of Brazil
Proxy GraphQL exposing Brazilian Chamber of Deputies Rest API using TypeScript.## Other Languages
- [Português Brasil](README.pt-br.md)
## 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](https://graphql-chamber-deputies-br.herokuapp.com/graphiql)## Chamber of Deputies Open Data
This is the [Swagger](https://dadosabertos.camara.leg.br/swagger/api.html) 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](src/config/env/EnvSchema.ts)**, 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](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](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://github.com/facebook/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](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fvitorsalgado%2Fcamara-deputados-graphql.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2Fvitorsalgado%2Fcamara-deputados-graphql?ref=badge_shield)
This project is [Apache Licensed](LICENSE).