-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove and ignore comic images for testing
- Loading branch information
Kerby Keith Aquino
committed
Aug 5, 2022
1 parent
4254f54
commit afeac2b
Showing
20 changed files
with
261 additions
and
111 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,3 +47,5 @@ redis_config.json | |
|
||
# Ignore __pycache__ stuff | ||
server/__pycache__ | ||
|
||
app/public/0[1-5].jpg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// import type { IconProp } from "@fortawesome/fontawesome-svg-core" | ||
|
||
declare interface ILayoutProps { | ||
children?: React.ReactNode | ||
} | ||
|
||
declare interface IContainerProps extends ILayoutProps { | ||
title?: string | ||
description?: string | ||
wrap?: boolean | undefined | ||
} | ||
|
||
declare interface INavLinkProps { | ||
link?: string | ||
name?: string | ||
icon: IconProp | ||
} | ||
|
||
declare interface IFooterLinkProps extends INavLinkProps {} | ||
|
||
declare interface IFilterItemProps { | ||
name: string | number | ||
yearType?: boolean | undefined | ||
} | ||
|
||
declare interface IComicItemProps { | ||
title: string | ||
img: string | ||
characters?: string[] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
declare interface RedisClient { | ||
comics?: string[] | ||
years: string[] | ||
characters: string[] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
/// <reference path="./app.d.ts" /> | ||
/// <reference path="./backend.d.ts" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,36 @@ | ||
import { RedisClient } from '@/utils/Interfaces'; | ||
import { Client, Entity, Schema, Repository } from "redis-om" | ||
// import { Client, Entity, Schema, Repository } from "redis-om" | ||
|
||
const client = new Client() | ||
// const client = new Client() | ||
|
||
async function connect() { | ||
if (!client.isOpen()) { | ||
await client.open(process.env.REDIS_URL) | ||
} | ||
} | ||
// async function connect() { | ||
// if (!client.isOpen()) { | ||
// await client.open(process.env.REDIS_URL) | ||
// } | ||
// } | ||
|
||
class Comic extends Entity {} | ||
// class Comic extends Entity {} | ||
|
||
let schema = new Schema(Comic, { | ||
title: { type: "string" }, | ||
comic_link: { type: "string" }, | ||
characters: { type: "string[]" }, | ||
image: { type: "string" }, | ||
index: { type: "number", sortable: true } | ||
}) | ||
// let schema = new Schema(Comic, { | ||
// title: { type: "string" }, | ||
// comic_link: { type: "string" }, | ||
// characters: { type: "string[]" }, | ||
// image: { type: "string" }, | ||
// index: { type: "number", sortable: true } | ||
// }) | ||
|
||
export async function searchComics<RedisClient>(years: string[], characters: string[]) { | ||
await connect() | ||
// for every year index given, search that year index that have the characters given | ||
let comics: RedisClient[] = [] | ||
console.log(years) | ||
console.log(characters) | ||
// export async function searchComics<RedisClient>(years: string[], characters: string[]) { | ||
// await connect() | ||
// // for every year index given, search that year index that have the characters given | ||
// let comics: RedisClient[] = [] | ||
// console.log(years) | ||
// console.log(characters) | ||
|
||
years.forEach((year) => { | ||
console.log(year) | ||
// search the index for the year for comics that have the characters given | ||
// once found, add them to the comics array | ||
}) | ||
return { comics: comics } | ||
} | ||
// years.forEach((year) => { | ||
// console.log(year) | ||
// // search the index for the year for comics that have the characters given | ||
// // once found, add them to the comics array | ||
// }) | ||
// return { comics: comics } | ||
// } | ||
|
||
export {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import styles from "@/styles/LoadingCircle.module.scss" | ||
|
||
export default function LoadingCircle({ hidden }: { hidden?: boolean }) { | ||
return ( | ||
<div | ||
className={ | ||
hidden !== true | ||
? styles.wrapper.toString() | ||
: styles["wrapper-hidden"].toString() | ||
} | ||
> | ||
<div className={styles.circle}> | ||
<svg> | ||
<circle | ||
cx="50" | ||
cy="50" | ||
r="35" | ||
stroke="black" | ||
className={styles.circle} | ||
/> | ||
</svg> | ||
</div> | ||
<span id={styles.label}>Loading...</span> | ||
</div> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
import { ILayoutProps } from "@/utils/Interfaces" | ||
import Navbar from "./Navbar" | ||
import Footer from "./Footer" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,16 @@ | ||
import type { NextApiRequest, NextApiResponse } from "next" | ||
import { resolve } from "path" | ||
// import type { NextApiRequest, NextApiResponse } from "next" | ||
// import { resolve } from "path" | ||
|
||
export default function handler( | ||
req: NextApiRequest, | ||
res: NextApiResponse<string> | ||
) { | ||
const reciveCharacters = (async () => { | ||
const response = await fetch("http://localhost:5000/characters") | ||
const json = await response.json() | ||
res.end(JSON.stringify(json)) | ||
resolve() | ||
})() | ||
} | ||
// export default function handler( | ||
// req: NextApiRequest, | ||
// res: NextApiResponse<string> | ||
// ) { | ||
// const reciveCharacters = (async () => { | ||
// const response = await fetch("http://localhost:5000/characters") | ||
// const json = await response.json() | ||
// res.end(JSON.stringify(json)) | ||
// resolve() | ||
// })() | ||
// } | ||
|
||
export {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,16 @@ | ||
import type { NextApiRequest, NextApiResponse } from "next" | ||
import { resolve } from "path" | ||
// import type { NextApiRequest, NextApiResponse } from "next" | ||
// import { resolve } from "path" | ||
|
||
export default function handler( | ||
req: NextApiRequest, | ||
res: NextApiResponse<string> | ||
) { | ||
const receiveData = (async () => { | ||
const response = await fetch("http://localhost:5000/data") | ||
const json = await response.json() | ||
res.end(JSON.stringify(json)) | ||
resolve() | ||
})() | ||
} | ||
// export default function handler( | ||
// req: NextApiRequest, | ||
// res: NextApiResponse<string> | ||
// ) { | ||
// const receiveData = (async () => { | ||
// const response = await fetch("http://localhost:5000/data") | ||
// const json = await response.json() | ||
// res.end(JSON.stringify(json)) | ||
// resolve() | ||
// })() | ||
// } | ||
|
||
export {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,17 @@ | ||
import { searchComics } from '../../../lib/redis' | ||
import type { NextApiRequest, NextApiResponse } from 'next' | ||
import { resolve } from 'path' | ||
// import { searchComics } from '../../../lib/redis' | ||
// import type { NextApiRequest, NextApiResponse } from 'next' | ||
// import { resolve } from 'path' | ||
|
||
export default function handler( | ||
req: NextApiRequest, | ||
res: NextApiResponse<string> | ||
) { | ||
const sendData = (async () => { | ||
let comics = await searchComics(req.body.year, req.body.characters) | ||
console.log(comics) | ||
res.status(200).send(JSON.stringify(comics)) | ||
resolve() | ||
})() | ||
} | ||
// export default function handler( | ||
// req: NextApiRequest, | ||
// res: NextApiResponse<string> | ||
// ) { | ||
// const sendData = (async () => { | ||
// let comics = await searchComics(req.body.year, req.body.characters) | ||
// console.log(comics) | ||
// res.status(200).send(JSON.stringify(comics)) | ||
// resolve() | ||
// })() | ||
// } | ||
|
||
export {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
.wrapper { | ||
@apply px-5 py-3 bg-gray-200 rounded-md flex flex-col; | ||
} | ||
|
||
.heading-container { | ||
@apply flex items-center justify-between; | ||
} | ||
|
||
.heading { | ||
@apply font-bold text-lg; | ||
} | ||
|
||
.bookmark-btn { | ||
@apply text-gray-800 bg-yellow-200 hover:bg-yellow-300 px-3 py-2 rounded-md; | ||
} | ||
|
||
.image-container { | ||
@apply relative h-[600px] w-full; | ||
|
||
img { | ||
@apply select-none; | ||
} | ||
} |
Oops, something went wrong.