This monorepo project is a GitHub Commit Viewer, showcasing the commit history and repository information for the current project using the GitHub API.
- Introduction
- Package Manager and Workspaces
- Tech Stack
- Folder Structure
- Installation
- Usage
- Testing
- License
This project aims to provide a user-friendly interface for exploring GitHub commit history and repository details. The frontend, built with Next.js, interacts with the backend, powered by NestJS, to fetch data from the GitHub API.
This project uses pnpm as the package manager and utilizes pnpm workspaces for managing the monorepo structure. Feel free to refer to the pnpm documentation for more information.
-
Frontend:
- Next.js 14
- React
- TypeScript
- TailwindCSS
- tRPC
- Jest (for testing)
- Cypress (for end-to-end testing)
-
Backend:
- NestJS
- TypeScript
- tRPC
- Jest (for testing)
-
Other Libraries:
- Zod (for schema validation)
- MomentJS (for date formatting)
apps/
backend/
: Contains the NestJS backend.frontend/
: Houses the Next.js frontend.
Make sure you have Node.js installed. This project requires Node.js version 20.9.0. If you don't have it installed, you can download it from the official Node.js website.
This project uses pnpm as its package manager. If you don't have pnpm installed, you can install it by following the instructions in the pnpm documentation.
-
Clone the repository:
git clone https://github.com/danpvlz/take-home-test.git cd take-home-test
-
Create .env files in the backend and frontend directories with the following content:
GITHUB_TOKEN=[token-send-via-mail] PORT=5000
NEXT_PUBLIC_NESTJS_BACKEND=http://localhost:5000
-
Install dependencies for both backend and frontend, run this command at the root of the project:
pnpm install
- Start the project, run this command at the root of the project:
pnpm dev
- Open project at local http://localhost:3000/
Run the following command in the root directory:
pnpm run test
Run the following command in the root directory:
cd apps/backend
pnpm run test
Run the following command in the root directory:
cd apps/frontend
pnpm run test
Must have project running Run the following command in the root directory:
cd apps/frontend
pnpm run cypress:run