Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
e5c0677
updated readme
nadialefebvre Feb 17, 2022
4e5ccbf
added first fetch requests
nadialefebvre Feb 17, 2022
b1bf1a5
added a basic graph with projects
nadialefebvre Feb 18, 2022
9ad406d
added vertical tabs for repocard
nadialefebvre Feb 19, 2022
77ca55e
added some sorting options
nadialefebvre Feb 20, 2022
af62a90
added a dropdown for selecting sorting option
nadialefebvre Feb 20, 2022
e32befa
added some styling
nadialefebvre Feb 21, 2022
8b11f88
working on the styling
nadialefebvre Feb 22, 2022
5483f47
still on styling
nadialefebvre Feb 22, 2022
f84fd18
fixed details to check on deployed site
nadialefebvre Feb 22, 2022
da95a47
added gitignore and hope it works fine
nadialefebvre Feb 23, 2022
44344a9
another try for deployment with token
nadialefebvre Feb 23, 2022
1c496cc
tried another way for deploy with token
nadialefebvre Feb 23, 2022
2cbe29d
townhall try
nadialefebvre Feb 23, 2022
a454437
argh
nadialefebvre Feb 23, 2022
d0d2c62
ready for demo
nadialefebvre Feb 23, 2022
16e36bf
changed gitignore
nadialefebvre Feb 23, 2022
b626d56
Update .gitignore
nadialefebvre Feb 23, 2022
f451704
added some comments
nadialefebvre Feb 25, 2022
ec6c4d7
last commit before PR
nadialefebvre Feb 25, 2022
cf514d1
Update README.md
nadialefebvre Feb 25, 2022
7c16d5f
Changed token
nadialefebvre Mar 26, 2022
ae174eb
Update README.md
nadialefebvre Aug 29, 2022
62212ea
Update README.md
nadialefebvre Aug 29, 2022
9ae62ab
Update README.md
nadialefebvre Nov 16, 2022
485e40a
Add files via upload
nadialefebvre Nov 16, 2022
049ed0e
Update README.md
nadialefebvre Jan 19, 2023
653b9bb
Update README.md
nadialefebvre May 10, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .DS_Store
Binary file not shown.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
code/token.js
21 changes: 16 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,24 @@
# GitHub Tracker
# Project GitHub Tracker

Replace this readme with your own information about your project.
Weekly project for Technigo's bootcamp, week 7: build a GitHub tracker (February 2022)

Start by briefly describing the assignment in a sentence or two. Keep it short and to the point.
## Tech stack

- JavaScript
- HTML
- CSS
- API

## The problem

Describe how you approached to problem, and what tools and techniques you used to solve it. How did you plan? What technologies did you use? If you had more time, what would be next?
The project is to build a GitHub tracker to gather my Technigo repositories in order to practice JavaScript and API skills through GitHub API. It contains some data about the repositories like commit messages, lastest push and so on.

At first I felt some stress since there was no starter code to begin with and it felt like a big mountain to climb. But in the end, I found it quite easy and interesting to work with many fetches nested inside one another. My biggest struggles were to style the charts with chart.js since the documentation wasn't always clear and to deal with the layout I chose (card with tab buttons). Even if I always want to reach more advanced goals, I didn't feel the need to add a filter or a search field since the number of repositories is quite low, and it didn't seemed a big challenge anyway.

## View it live

Every project should be deployed somewhere. Be sure to include the link to the deployed project so that the viewer can click around and see what it's all about.
Project deployed here: [Nadia Lefebvre - GitHub Tracker](https://nadialefebvre-github-tracker.netlify.app/)

<div align="center">
<img src="screenshot.jpg" />
</div>
127 changes: 124 additions & 3 deletions code/chart.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,125 @@
//DOM-selector for the canvas 👇
const ctx = document.getElementById('chart').getContext('2d')
const reposChart = document.getElementById('reposChart').getContext('2d')

//"Draw" the chart here 👇
// global options for chart.js
Chart.defaults.font.family = 'Roboto'
Chart.defaults.font.size = 24
Chart.defaults.color = 'white'

const drawReposChart = (amount) => {
new Chart(reposChart, {
type: 'bar',
data: {
labels: ['Done', 'To do'],
datasets: [{
data: [
amount,
19 - amount
],
backgroundColor: [
'#DBE2EF',
'#3F72AF'
]
}]
},
options: {
indexAxis: 'y', // for horizontal bar graph instead of vertical
scales: {
y: {
grid: {
display: false, // removes grid lines for y axis
borderColor: 'white',
}
},
x: {
display: false, // removes x axis
}
},
plugins: {
title: {
display: true,
text: 'Technigo projects',
},
legend: {
display: false,
},
tooltip: {
backgroundColor: '#F9F7F7',
bodyColor: '#112D4E',
titleColor: '#112D4E',
titleAlign: 'center',
bodyAlign: 'center',
titleFont: {
size: 12,
weight: '700'
},
bodyFont: {
size: 12,
weight: '700'
},
cornerRadius: 2,
displayColors: false
}
}
}
})
}

const drawLanguagesChart = (html, css, js, idChart) => {
const languagesChart = document.getElementById(idChart).getContext('2d')
new Chart(languagesChart, {
type: 'polarArea',
data: {
labels: ['HTML', 'CSS', 'JS'],
datasets: [{
data: [
html,
css,
js
],
backgroundColor: [
'#DBE2EF',
'#3F72AF',
'#112D4E'
]
}
]
},
options: {
scales: {
r: {
ticks: {
display: false, // removes vertical numbers
// callback added because there is an issue with ticks, link: https://github.com/chartjs/Chart.js/issues/8092
callback: function (val, index) {
return val
},
},
grid: {
display: false // removes circular lines
}
}
},
plugins: {
title: {
display: false
},
legend: {
display: true,
position: 'top',
labels: {
color: '#112D4E',
usePointStyle: true,
pointStyle: 'rect',
font: {
size: 12
}
},
onClick: null, // removes on click event: not possible to strike through a label by clicking on it
},
tooltip: {
enabled: false,
}
}
}
})
}
Binary file added code/favicon.ico
Binary file not shown.
73 changes: 66 additions & 7 deletions code/index.html
Original file line number Diff line number Diff line change
@@ -1,21 +1,80 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Project GitHub Tracker</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.0-2/css/all.min.css">
<link rel="stylesheet" href="./style.css" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/3.7.1/chart.min.js"></script>
<link rel="icon" type="image/x-icon" href="./favicon.ico">
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice favicon!

<title>Nadia Lefebvre - GitHub Tracker</title>
</head>

<body>
<h1>GitHub Tracker</h1>
<h2>Projects:</h2>
<main id="projects"></main>

<header
class="header-box"
id="headerBox">
<!-- User name and picture are injected here by JavaScript -->
<div
class="user-box"
id="userBox">
</div>
<h1 class="project-title">GitHub Tracker</h1>
<div class="repos-chart">
<!-- Technigo's projects chart is injected here by JavaScript -->
<canvas id="reposChart"></canvas>
</div>
</header>

<!-- This will be used to draw the chart 👇 -->
<canvas id="chart"></canvas>
<main class="main-box">
<select
class="sorting-dropdown"
id="sortingDropdown">
<option value="A to Z">A to Z</option>
<option value="Z to A">Z to A</option>
<option value="Latest">Latest</option>
<option value="Oldest">Oldest</option>
</select>

<script src="./script.js"></script>
<!-- All repo cards are injected here by JavaScript -->
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good comment that explains what is happening here, makes it easier to follow.

<section
class="repos-box"
id="reposBox">
</section>
</main>

<footer class="footer-box">
<span>Created by Nadia Lefebvre</span>
<a
href="https://www.linkedin.com/in/nadiainsweden/"
target="_blank"
title="Linkedin Nadia Lefebvre">
<i class="fab fa-linkedin"></i>
</a>
<a
href="https://github.com/nadialefebvre"
target="_blank"
title="GitHub Nadia Lefebvre">
<i class="fab fa-github"></i>
</a>
<a
href="https://stackoverflow.com/users/17550223/nadia-lefebvre"
target="_blank"
title="Stack Overflow Nadia Lefebvre">
<i class="fab fa-stack-overflow"></i>
</a>
</footer>

<script src="./token.js"></script>
<script src="./chart.js"></script>
<script src="./script.js"></script>

</body>

</html>
Loading