Proxy GraphQL exposing Brazilian Chamber of Deputies Rest API using TypeScript.
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.
A demo application is available on: https://graphql-chamber-deputies-br.herokuapp.com/graphiql
This is the Swagger documentation for the API which this application uses to get all data.
- TypeScript
- Fastify
- Drizzle-Http
- Mercuries
- Pino
- Redis
- Jest / Nock / Supertest
- Docker / Docker Compose
- ESLint / Prettier / Husky / Lint Staged
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.
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.
NPM is the chosen package manager for this project.
To install dependencies, run:
npm i
To start a local development environment with Nodemon, run:
npm run start:dev
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.
To build TypeScript and execute the application, run:
npm run build
npm start
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
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
This project is Apache Licensed.