By: Haniel Baez
This app displays the commit history of a public GitHub repository. You can use the search bar to view commit history for any public GitHub repository.
The project consists of a backend built with Nest.js and a frontend built with Remix Run.
-
Fork the repository.
-
Clone the repository.
$ git clone https://github.com/hanielbaez/git-commit-history
To develop and run this locally, you'll need:
-
Node (version 16.15.1)
-
A good IDE (e.g., VisualStudio Code)
-
Node Version Manager (optional but recommended)
Check your Node version:
$ node -v
16.15.1
Make sure you are in the root directory:
$ pwd
/Users/[YOU_USER]/[PARENT_DIR]/git-commit-history
Install backend dependencies and start:
$ cd backend && npm i && npm run start
In a new terminal tab, without closing the current one:
$ cd ..
$ pwd
/Users/[YOU_USER]/[PARENT_DIR]/git-commit-history
$ cd frontend && npm i && npm run start
Once completed, navigate to:
The app contains a search box pre-filled with the link to the GitHub repository hosting this project. Click the right arrow to load all commits in descending order (latest commits first). Use the app to search for any open GitHub repository.
Unit tests with Jest have been implemented. To execute, go to the backend directory:
$ cd backend
$ npm run test`
Unit tests for the frontend have been implemented. To execute, go to the frontend directory:
$ cd frontend
$ npm run test`
Once the backend is running, Swagger documentation is available at:
Verify that Docker is installed correctly and running, you can run the following command:
$ docker --version
Create a network
$ docker network create git-network --driver bridge
*Note: The commands below must be executed from the project's root directory
Build the Docker image for the backend:
$ docker build -t git-commit-backend -f ./backend/backend.dockerfile ./backend
Run the Docker container, mapping port 3000 on your local machine to port 3000 in the container:
$ docker run -d --name git-commit-backend-container --network git-network -p 3000:3000 git-commit-backend
Build the Docker image for the frontend:
$ docker build -t git-commit-frontend -f ./frontend/frontend.dockerfile ./frontend
Run the Docker container, mapping port 3003 on your local machine to port 3003 in the container:
$ docker run --name git-commit-frontend-container --network git-network -p 3003:3003 -e API=http://git-commit-backend-container:3000 git-commit-frontend
Please be aware that the GitHub API has rate limits for unauthenticated API calls. If you plan to use or test this application extensively, we recommend generating a personal GitHub token.
- Go to your GitHub account settings.
- Navigate to the "Developer settings" section.
- Click on "Personal access tokens" and then "Generate new token."
- Give the token a name, select the required permissions (generally 'repo' and 'read:user' should suffice for this app), and generate the token.
- Copy the generated token.
Save the generated token in a .env
file under the backend
subfolder with the following format:
GITHUB_TOKEN=your_generated_token_here
This will allow the application to make authenticated GitHub API calls.