This website allows users to find and listen to dozens of recordings from a radio talk show.
- React
- Dependencies:
Requirements:
- Node
- Package Manager (such as Yarn or npm)
Follow these steps:
-
Fork and clone repo
-
In the terminal,
cd
into 'tuhoradivina' -
Run
yarn
ornpm install
to install the necessary node_modules on the frontend. -
Run
yarn start
ornpm start
on the client folder to run the frontend onlocalhost:3000
There's quite a bit of data, but it is "normalized" for constant time lookups (Not including network latency).
example - data.js
const data = {
// ********* 2016 *************************************************
sixteen: {
yearTitle: '2016',
year: 'sixteen',
allMonths: ['enero', 'febrero', 'marzo', 'abril', 'mayo', 'junio', 'julio', 'agosto', 'septiembre', 'octubre', 'noviembre', 'diciembre' ],
monthsData: {
// ************** Enero 2016
enero: {
monthTitle: 'Enero 2016',
audioData: [{
audioTitle: "02-01-2016",
audioFile: sixteenEnero1
}, {
audioTitle: "09-01-2016",
audioFile: sixteenEnero2
}, {
audioTitle: "16-01-2016",
audioFile: sixteenEnero3,
}, {
audioTitle: "23-01-2016",
audioFile: sixteenEnero4
}],
},
// ************** Febrero 2016
febrero: { .....
handleMonth - App.js
const handleMonth = (month) => {
const monthData = data[year].monthsData[month];
const { monthTitle, audioData } = monthData;
setMonthTitle(monthTitle);
setAudioData(audioData);
}
handleYear - App.js
const handleYear = (yearSelected) => {
const { yearTitle, year, allMonths, monthsData } = data[yearSelected];
// 2016 and 2016 both begin in Janurary, while 2015 begins in July.
// (according to the data available, obviously not on an actual calendar lol)
const { monthTitle, audioData } =
yearSelected === 'fifteen' ? monthsData.julio : monthsData.enero;
setAllMonths(allMonths);
setYearTitle(yearTitle);
setYear(year);
setMonthTitle(monthTitle);
setAudioData(audioData);
}