- About
- Project Structure
- Github Personal Access Token
- Running locally
- Swagger Documentation
- Tests
- Tecnologies
An API for collecting and presenting data about Github Repositories
├───.github/
│ └───workflows/
│ └───workflow.yml -> Github Actions Workflow
├───src/
│ ├───api/
│ │ └───repository/
│ │ ├───index.ts -> Inits the routes
│ │ ├───repositoryController.ts -> Repository controllers
│ │ ├───repositoryValidator.ts -> Repository schema validators
│ │ └───routes.ts -> Routes related to repository
│ ├───config/
│ ├───constants/
│ ├───db/
│ ├───interfaces/
│ ├───models/
│ ├───services/
│ ├───tests/ -> Automated unit tests
│ │ ├───services/
│ │ ├───utils/
│ │ └───_in-memory-db.ts -> In Memory Mongodb for tests
│ ├───utils/
│ ├───index.ts -> Starts the server, routering, pluggins, etc
│ └───server.ts -> Server configurations
To access the Github API you need a personal Access Token to be sent in the headers. See how to generate one HERE
Example of sending the token on the request:
on Postman:
on Swagger:
You will need NodeJS (V. 14 or +), npm, Docker and docker-compose
Clone this repo and run the following commands:
npm install
docker-compose up
Then you can access the API in http://localhost:3000 or http://0.0.0.0:3000
See the Docs on Swagger for informations about the routes, params and headers
After running the project open the browser in http://localhost:3000/documentation
For the unit tests, the project uses an In Memory Mongodb Server. To execute the unit tests run:
npm test
NodeJs - Server Environment
Hapi - Server Framework
Mongodb - Cloud NoSQL Database
Mongodb in memory - In memory database for testing purpose
Docker - Image deployment
AVA - Test Framework
Joi - Schema description language and data validator