Skip to content

Commit

Permalink
Dev to main (#49)
Browse files Browse the repository at this point in the history
  • Loading branch information
bhtibrewal authored Mar 4, 2024
1 parent 78ff731 commit 14b91d0
Show file tree
Hide file tree
Showing 79 changed files with 7,921 additions and 2 deletions.
8 changes: 8 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
NEXT_PUBLIC_BACKEND_BASE_URL = 'https://staging-skilltree-api.realdevsquad.com/v1'
NEXT_PUBLIC_RDS_BACKEND_URL='https://staging-api.realdevsquad.com'
NEXT_PUBLIC_SKILL_TREE_SITE='https://staging-skilltree.realdevsquad.com'
NEXT_PUBLIC_STATUS_SITE='https://staging-status.realdevsquad.com'
NEXT_PUBLIC_MEMBERS_SITE='https://staging-members.realdevsquad.com'
NEXT_PUBLIC_WELCOME_SITE='https://welcome.realdevsquad.com'
NEXT_PUBLIC_WWW_SITE='https://staging-www.realdevsquad.com'
NEXT_PUBLIC_MY_SITE='https://staging-my.realdevsquad.com'
8 changes: 8 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.next
next-env.d.ts
node_modules
yarn.lock
package-lock.json
public
README.md
coverage
14 changes: 14 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"plugins": ["react", "react-hooks", "prettier", "@typescript-eslint"],
"extends": ["eslint:recommended", "next", "next/core-web-vitals", "prettier"],
"env": {
"jest": true
},
"rules": {
"indent": ["error", 4],
"quotes": ["error", "double"],
"semi": ["error", "always"],
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": "error"
}
}
41 changes: 41 additions & 0 deletions .github/workflows/pre-commit-checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Pre-commit checks

on:
pull_request:
branches: ["*"]

jobs:
pre-commit-checks:
runs-on: ubuntu-latest

steps:
- name: Check out code
uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 18

- name: Cache Node.js dependencies
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install dependencies
run: yarn

- name: Type check
run: yarn check-types

- name: Lint check
run: yarn check-lint

- name: Prettier check
run: yarn check-format

- name: Run tests
run: yarn test
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ lib-cov
coverage
*.lcov

#VS code
.vscode/

# nyc test coverage
.nyc_output

Expand Down Expand Up @@ -73,7 +76,7 @@ web_modules/
.yarn-integrity

# dotenv environment variable files
.env
# .env
.env.development.local
.env.test.local
.env.production.local
Expand Down Expand Up @@ -128,3 +131,4 @@ dist
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*
.yarnrc.yml
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

yarn run test-all
8 changes: 8 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.next
next-env.d.ts
node_modules
yarn.lock
package-lock.json
public
README.md
coverage
7 changes: 7 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"trailingComma": "es5",
"tabWidth": 4,
"semi": true,
"singleQuote": false,
"printWidth": 120
}
31 changes: 30 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,30 @@
# skill-tree-frontend
# Frontend for Skill-tree

Display the skills a user has and the endorsements created for adding new skills to users profile.

## Staging Deployed Link
https://stag-skill-tree.vercel.app/

## Tech Stack:

- [NextJs v13.4.4 (Reactjs)](https://nextjs.org/)
- [react-query](https://tanstack.com/query/v3/)
- [Jest](https://jestjs.io/)
- [Msw](https://mswjs.io/)

## Setup and running locally

### Prerequisites
- [Node.js](https://nodejs.org/en/download)
- Yarn

### Setup
- Install local dependencies
```
yarn
```
- Run development command
```
yarn dev
```

52 changes: 52 additions & 0 deletions __mocks__/db/endorsementDetails.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
[
{
"id": "abc1",
"title": "Oppenheimer ✨",
"date": "12 Jan 2023",
"skills": "Pinning in Rust",
"endorsers": ["Vaibhav", "Yash", "Tejas"],
"status": "Atomic",
"endorsements": [
{
"id": 1,
"name": "Vaibhav",
"description": "Lorem ipsum dolor sit amet consectetur. Lacus consequat non porttitor faucibus. Mattis nec felis sagittis justo id volutpat."
},
{
"id": 2,
"name": "Yash",
"description": "Lorem ipsum dolor sit amet consectetur. Lacus consequat non porttitor faucibus. Mattis nec felis sagittis justo id volutpat. Et ut non semper quam a consectetur Et ut non semper quam a consectetur."
},
{
"id": 3,
"name": "Tejas",
"description": "Lorem ipsum dolor sit amet consectetur. Lacus consequat non porttitor faucibus. Mattis nec felis sagittis justo id volutpat. Et ut non semper quam a consectetur Et ut non semper quam a consectetur."
}
]
},
{
"id": "abc2",
"title": "Oppenheimer ✨",
"date": "12 Jan 2023",
"skills": "Pinning in Rust",
"endorsers": ["Vaibhav", "Yash", "Tejas"],
"status": "Atomic",
"endorsements": [
{
"id": 1,
"name": "Vaibhav",
"description": "Lorem ipsum dolor sit amet consectetur. Lacus consequat non porttitor faucibus. Mattis nec felis sagittis justo id volutpat. Et ut non semper quam a consectetur Et ut non semper quam a consectetur."
},
{
"id": 2,
"name": "Yash",
"description": "Lorem ipsum dolor sit amet consectetur. Lacus consequat non porttitor faucibus. Mattis nec felis sagittis justo id volutpat."
},
{
"id": 3,
"name": "Tejas",
"description": "Cat milk copy park pee walk owner escape bored tired cage droppings sick vet vomit cough hairball, eat toilet paper. Pounce on unsuspecting person i is not fat, i is fluffy. Whenever a door is opened, rush in before the human."
}
]
}
]
35 changes: 35 additions & 0 deletions __mocks__/endorsements.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
export const endorsementsListsMock = [
{
id: 1,
endorserName: "Prakash",
skill: "usestate",
color: "green",
},
{
id: 2,
endorserName: "vaibhav",
skill: "pinning",
color: "blue",
},
{
id: 3,
endorserName: "Yash Raj",
skill: "useEffect",
color: "yellow",
},
];

export const skillMockData = [
{
id: 1,
skill: "React",
},
{
id: 2,
skill: "Go",
},
{
id: 3,
skill: "Vanilla JS",
},
];
4 changes: 4 additions & 0 deletions __mocks__/handler.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import { endorsementsHandler } from "./handlers/endorsements.handler";

const handlers = [...endorsementsHandler];
export default handlers;
9 changes: 9 additions & 0 deletions __mocks__/handlers/endorsements.handler.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { rest } from "msw";
import { BASE_URL } from "@/constants/urls";
import endorsementDetails from "../db/endorsementDetails.json";

export const endorsementsHandler = [
rest.get(`${BASE_URL.dev}/endorsements`, (req, res, ctx) => {
return res(ctx.status(200), ctx.json(endorsementDetails));
}),
];
Loading

0 comments on commit 14b91d0

Please sign in to comment.