Playground project utilizing Github public API. Built with Node.js.
The API currently serves a single route, /stats
, which accumulates the number of open issues count per language (e.g Java, JavaScript) for a specific number of projects.
Define an .env file at the root directory of the project containing all the environment variables needed. You can find the keys needed for the env vars key-value pairs in the configuration file.
You will need to download and install Node.js and npm in order to use this method. Navigate to project root folder and run the following commands to start the server:
npm install
npm start
Navigate to project root folder and run:
npm test
The app is designed to use a layered architecture. The architecture is heavily influenced by the Clean Architecture. It aims to separate concerns and make the app easier to test and maintain. This also makes it easier to replace a routing framework or a data store, as the core business rules are independent of these layers implementation. Specifically, the following simple division is applied in the app structure:
-
domain folder contains modules defining the core entities (models) and business rules (services) of the app. They are the least likely to change when something external (e.g database, routing) changes and thus do not depend on external components. In our use case, this layer will not change if Github data are fetched through the Github GraphQL API. This increases extensibility and maintainability.
-
router folder contains modules concerned with HTTP routing (routes, HTTP specifics like requests, responses, headers, params validation etc). Routing is implemented using Express.js but we can easily swap it with another framework.
-
data folder contains modules (repositories) concerned with data fetching and posting tasks. Current implementation is uitilizing Github Rest API v3.
Express web framework is used to handle routing.