Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Searchpets release v2 #29

Closed
wants to merge 119 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
119 commits
Select commit Hold shift + click to select a range
38ebb89
Updating the redis support branch (#28)
thatITfox Jul 5, 2022
2d4b8a9
Added redis-om
thatITfox Jul 9, 2022
ceb9fe6
Merge branch 'main' into redis-support
kuroji-fusky Jul 9, 2022
78a684c
Added redis to the requirements
thatITfox Jul 9, 2022
21044e1
Made the databased be saved in redis
thatITfox Jul 9, 2022
28fd871
Fixed font issue
Jul 9, 2022
dc6b47f
Updated react types
Jul 9, 2022
27f48ab
Adding octokit to provide releases
Jul 12, 2022
556da8d
Added redis-om
thatITfox Jul 9, 2022
e1a6e52
Added redis to the requirements
thatITfox Jul 9, 2022
16ece88
Made the databased be saved in redis
thatITfox Jul 9, 2022
f68df14
Fixed font issue
Jul 9, 2022
7f4e506
Updated react types
Jul 9, 2022
b771daa
Adding octokit to provide releases
Jul 12, 2022
9900b26
Update month
kuroji-fusky Jul 13, 2022
093a690
Merge branch 'redis-support' of https://github.com/OpenFurs/searchpet…
Jul 14, 2022
ed85664
Added Cypress 10
Jul 17, 2022
05a374e
Added basic redis search feature
thatITfox Jul 17, 2022
7811282
Updated packages
Jul 17, 2022
c6be54c
Add a basic WIP updater
thatITfox Jul 17, 2022
5c7b9a1
Added shields.io and minor changes
kuroji-fusky Jul 21, 2022
0d000eb
API access point for next to access
thatITfox Jul 29, 2022
d18e6ed
Some basic template for redis search
thatITfox Jul 29, 2022
7d3a673
Fix caching issues
thatITfox Jul 29, 2022
efb3d30
Infer the `GetServerSideProps` type
Jul 29, 2022
c33c8a7
Rename update.py to update_old.py
kuroji-fusky Jul 30, 2022
359cc32
Remove redis-om for node-redis
thatITfox Jul 31, 2022
326712e
Added redis config json file for python
thatITfox Jul 31, 2022
2fe9224
Add dependabot for updating npm packages
Jul 31, 2022
05068d7
Added a python script to generate keys for redis
thatITfox Jul 31, 2022
c610dc2
Updated scripts to use redis_config.json
thatITfox Jul 31, 2022
cd06f2e
Commited the wrong file before
thatITfox Jul 31, 2022
b4d07d7
Merge branch 'redis-support' of https://github.com/openfurs/searchpet…
thatITfox Jul 31, 2022
1821d19
Adding interfaces to redis.ts
Jul 31, 2022
cfd0c21
pep8 linting and correction
Aug 1, 2022
ba0448e
Fix error for broken server binding
thatITfox Aug 5, 2022
f954bef
Succesfull database request, broken return value
thatITfox Aug 5, 2022
69b2e30
Fixed level now at 50%
thatITfox Aug 5, 2022
4d0e927
Rewrite Next.js UI - barely (#32)
kuroji-fusky Aug 12, 2022
04e1151
Searches worked but limited to 10 results per year
thatITfox Aug 12, 2022
5b96777
Merge branch 'redis-support' of https://github.com/openfurs/searchpet…
thatITfox Aug 12, 2022
33407ce
Added code to grab from localstorage
thatITfox Aug 12, 2022
72f5035
Made the scraper super fast with threading
Aug 12, 2022
fff8e36
Configure script workers to offload UI logic
Aug 12, 2022
8304820
Ignore lock files and add custom useFetch hook
Aug 14, 2022
b5bfdc4
Got MDX to work
Aug 14, 2022
0813937
Add ignore for future Vercel deployments
Aug 14, 2022
f4635bb
Major layout changes and organization
Aug 14, 2022
3804d27
More filters and organizing
Aug 14, 2022
a105c41
Made filter component fully responsive
Aug 15, 2022
6024380
More stuff
Aug 15, 2022
e86f89d
Add settings dropdown
Aug 15, 2022
7b0c365
Toggle and navbar responsive
Aug 15, 2022
6e29e2b
Added Exception as e for future error logging
thatITfox Aug 17, 2022
95b8bec
Won't cause errors on next config
Aug 17, 2022
fd75746
Set dark mode by default
Aug 19, 2022
2dfbe0d
Stuff
Aug 19, 2022
e953c2e
Shows comics in the useState current value
thatITfox Aug 21, 2022
bdd2a58
Removed 10 result limit
thatITfox Aug 21, 2022
2d36ac9
Header UI changes
Aug 21, 2022
cef015c
A big commit
Aug 24, 2022
8c20106
Restyle Searchpets release v2 (#33)
restyled-io[bot] Aug 24, 2022
157a5f4
Remove next/babel from eslint config
Aug 24, 2022
d3c6692
Reviving search.tsx api
thatITfox Aug 26, 2022
a8ea37c
Commented and removed some un used localstprage code
thatITfox Aug 26, 2022
a3acc6a
Fix bug year_db being empty
thatITfox Aug 26, 2022
cafad58
More PWA stuff
Aug 26, 2022
6832d48
Added functions for different api's
thatITfox Aug 27, 2022
dc346b6
Now connected with redis
thatITfox Aug 27, 2022
24e7f2a
Some clean up of un used code
thatITfox Aug 27, 2022
13ef17e
Fixed some minor bugs with character list and checkers
thatITfox Aug 27, 2022
a9540dd
Big UI change; organizing code and styles
Aug 27, 2022
aba6288
Forgot to add a delete statement to update the char list
thatITfox Aug 28, 2022
c60600c
PWA support; remove partytown
Aug 30, 2022
8c8d6b8
Update docs
kuroji-fusky Sep 1, 2022
867ead9
docs again
kuroji-fusky Sep 1, 2022
2ba94d5
Added some error handling
thatITfox Sep 3, 2022
6cc7ef3
Added API handlers
thatITfox Sep 3, 2022
2d8dbeb
Attempting to refactor scraper code
Sep 4, 2022
ca390c1
Fixed return bugs
thatITfox Sep 4, 2022
7d0980e
Examples on how to use ApiHandlers
thatITfox Sep 4, 2022
0cb48fa
Merge branch 'redis-support' of https://github.com/openfurs/searchpet…
thatITfox Sep 4, 2022
21c6939
just a dumb commit lol
Sep 4, 2022
887d30c
Navbar overhaul
Sep 4, 2022
a4d9177
Add funding.yml
Sep 4, 2022
10ef9cb
Merge branch 'redis-support' into sf-navbar-ui
kuroji-fusky Sep 4, 2022
37ccefd
Refactored scraping code
thatITfox Sep 4, 2022
09b2397
Merge branch 'redis-support' of https://github.com/openfurs/searchpet…
thatITfox Sep 4, 2022
3cf8a12
Navbar overhaul
Sep 4, 2022
c87d997
Merge branch 'sf-navbar-ui' of https://github.com/OpenFurs/searchpets…
Sep 4, 2022
e12c986
Sidebar finished, update readme
Sep 4, 2022
8e831d4
Update wording
kuroji-fusky Sep 6, 2022
f0d3da2
Add husky integration
Sep 6, 2022
308b518
Add discalimer
Sep 6, 2022
a8215ff
Organize files, options menu close outside
Sep 7, 2022
67acfb2
Additional comic stuff and others
Sep 7, 2022
bae26c1
Merge pull request #37 from openfurs/sf-navbar-ui
kuroji-fusky Sep 7, 2022
31a5bcc
Fix `react/no-unknown-property` eslint rule
Sep 7, 2022
8f03c0c
TypeScript torture
Sep 11, 2022
55d5580
Some backend refactoring
Sep 16, 2022
1d8a4bd
Fixed api types
thatITfox Sep 17, 2022
1bf9efa
Add guest param
Sep 17, 2022
4952bb0
Added guest comics to the database
thatITfox Sep 17, 2022
da23be9
Merge branch 'redis-support' of https://github.com/openfurs/searchpet…
thatITfox Sep 17, 2022
fbe5d9c
Return `Promise` type from handlers
Sep 17, 2022
7ab2384
linting and refactoring
Sep 17, 2022
59e0225
merging searchbox to navbar
Sep 17, 2022
f8a8cde
Suffering with types
Sep 18, 2022
984d760
Added basic layout code
thatITfox Sep 18, 2022
5d1442a
Fixed import error
thatITfox Sep 18, 2022
cb93bf9
Lazy loading character contents
Sep 18, 2022
0d84012
more UI stuff
Sep 18, 2022
2900af5
Added logic for .env file
thatITfox Sep 18, 2022
2a70e1b
Working modal and res types
Sep 18, 2022
aa6072f
Add debug info on ComicItems
Sep 18, 2022
8b4bf64
Fixed character array parsing issue
Sep 18, 2022
f6a5c7f
Organize styles and add `:target` styles
Sep 19, 2022
bda28cd
Searchbar UI change and mobile responsive
Sep 19, 2022
83786de
Searchbar responsive & comic size now dynamic
Sep 19, 2022
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
17 changes: 0 additions & 17 deletions .editorconfig

This file was deleted.

1 change: 0 additions & 1 deletion .gitattributes

This file was deleted.

1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ko_fi: openfurs
28 changes: 28 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
version: 2

updates:
- package-ecosystem: "npm"
directory: '/'
schedule:
interval: weekly
time: '00:00'
open-pull-requests-limit: 2
assignees:
- skepfusky
commit-message:
prefix: fix
prefix-development: chore
include: scope

- package-ecosystem: "npm"
directory: '/app'
schedule:
interval: weekly
time: '00:00'
open-pull-requests-limit: 10
assignees:
- skepfusky
commit-message:
prefix: fix
prefix-development: chore
include: scope
68 changes: 0 additions & 68 deletions .github/workflows/codeql-analysis.yml

This file was deleted.

29 changes: 29 additions & 0 deletions .github/workflows/typescript-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: TS Type Checking

on:
push:
paths:
- "**.ts"
- "**.tsx"

jobs:
typescript-check:
name: TypeScript Type Checks
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v2

- name: Use yarn cache keyed by hashed yarn.lock
uses: actions/cache@v2
with:
path: ~/.yarn
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-

- name: Install dependencies
run: yarn install --frozen-lockfile

- name: Checking types
run: yarn tsc:lint
24 changes: 17 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
node_modules
/.pnp
Expand Down Expand Up @@ -37,12 +35,24 @@ node_modules
# python and database
venv

# ssl certs
*.key
*.crt

# Ignore local Housepets json file
housepets_db.json
redis_config.json

# Ignore __pycache__ stuff
server/__pycache__
**/__pycache__

# Ignore lock files
package-lock.json
yarn.lock
pnpm-lock.yaml

# PWA service workers
**/sw.js
**/sw.js.map
**/workbox-*.js
**/workbox-*.js.map
**/worker-*.js
**/worker-*.js.map
**/fallback-development.js
**/fallback-*.js
8 changes: 8 additions & 0 deletions .husky/common.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
command_exists () {
command -v "$1" >/dev/null 2>&1
}

# Workaround for Windows 10, Git Bash and Yarn
if command_exists winpty && test -t 1; then
exec < /dev/tty
fi
6 changes: 6 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"
. "$(dirname -- "$0")/common.sh"

git fetch
git pull
9 changes: 9 additions & 0 deletions .vscode/searchpets.code-snippets
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"Import styles": {
"scope": "typescriptreact",
"prefix": "importstyles",
"body": [
"import styles from \"@/styles/$0.module.scss\""
],
}
}
44 changes: 22 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,21 @@
<h1 align="center">
<img width="128" alt="searchpets-peanut-transparent" src="https://user-images.githubusercontent.com/94678583/170873665-9d07cb32-abb9-45b6-8aea-8e361da84bd7.png">
<br>
Searchpets
<em>Searchpets!</em>
</h1>
<p align="center">
<img src="https://img.shields.io/github/license/OpenFurs/searchpets?style=flat" alt="GPL 2.0 License"/>
<img src="https://img.shields.io/github/license/OpenFurs/searchpets?style=flat" alt="GPL 2.0 License" />
<img src="https://img.shields.io/github/issues/OpenFurs/searchpets?style=flat" alt="Searchpets' open issues" />
<img src="https://img.shields.io/github/last-commit/OpenFurs/searchpets" />
<img src="https://img.shields.io/website?label=searchpets.xyz&up_message=up%20and%20running%21&url=https%3A%2F%2Fsearchpets.xyz%2F" />
<img src="https://img.shields.io/github/contributors/OpenFurs/searchpets" />
</p>
<p align="center">
Searchpets is an open source search engine to find characters and texts from comics (coming soon) from <i>Housepets!</i> written in Next.js and FastAPI.
<em>Searchpets!</em> is comic search engine for searching characters, texts from comics, and chapter arcs from the entire <em>Housepets!</em> catalog! Written in Python and TypeScript - it was taken inspiration from this <a href="https://www.housepetscomic.com/forums/viewtopic.php?f=13&t=5434&p=938783&hilit=search+engine#p938783">forum post</a>.
</p>
<p align="center">
This project was taken inspiration from this <a href="https://www.housepetscomic.com/forums/viewtopic.php?f=13&t=5434&p=938783&hilit=search+engine#p938783">forum post</a>.
<img src="https://user-images.githubusercontent.com/94678583/188504378-07189cc8-78f1-4020-9878-cae6e4435708.png" alt="Searchpets Dev Demo">
</p>
<p align="center">
<img src="https://user-images.githubusercontent.com/94678583/163629497-9f5c4921-5a39-4dfe-8729-e56705efb2f7.gif" alt="Searchpets Dev Demo">
</p>

## Tech stack

![Searchpets Stack](https://skillicons.dev/icons?i=react,nextjs,ts,js,sass,tailwind,py,flask,cloudflare)

The front-end is written in a React framework, Next.js + TypeScript;
with Tailwind CSS and Sass as CSS painkillers. For the back-end, it's powered
with Python with the lightweight web framework, Flask.

The website is currently being hosted from a custom Linode server and
delivered through the interwebs with CloudFlare.

## Project structure

Expand All @@ -36,6 +25,16 @@ delivered through the interwebs with CloudFlare.
- `scripts` - Automated Bash scripts to bulk install Python and Node packages and
for deployment from the server

## Infrastructure

The front-end is written in Next.js + TypeScript + Lit Web Components;
with Tailwind CSS. While the back-end is written
in Python with a lightweight and fast web framework, FastAPI - the
database is powered by Redis.

The infrastructure is being hosted from Linode and Netlify then
delivered through the interwebs with Cloudflare.

## Running the app locally

### Prerequisites
Expand All @@ -53,7 +52,7 @@ To install all the required Node and Python libraries, execute the `setup.sh`
file.

```console
sh scripts/setup.sh
sh scripts/init.sh
```

Once all the libraries have been installed, it will execute `gen.py` to
Expand All @@ -64,9 +63,10 @@ concurrently start both Node and Python servers.

## Disclaimer

The use of third-party content is heavily transformative, and therefore, subject
of Fair Use. _Housepets!_ and its story and characters is a trademark of Rick Griffin.
_Searchpets!_ is an open source fan project. SP does not own any of the
contents used on this website and has no direct affiliation with the entire
_Housepets!_ web comic or all of Rick Griffin's intellectual property.

## License

GPT-2.0
GPL-2.0
1 change: 1 addition & 0 deletions app/.env.local.example
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
REDIS_URL=
GA=
2 changes: 1 addition & 1 deletion app/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "next/core-web-vitals",
"extends": ["next/core-web-vitals"],
"rules": {
"@next/next/no-img-element": "off",
"react/no-unescaped-entities": "off"
Expand Down
7 changes: 3 additions & 4 deletions app/.prettierignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
next
out
build
coverage
app/.next
app/out
app/build
7 changes: 7 additions & 0 deletions app/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"trailingComma": "none",
"useTabs": false,
"tabWidth": 2,
"semi": false,
"printWidth": 80
}
6 changes: 0 additions & 6 deletions app/.prettierrc.js

This file was deleted.

61 changes: 61 additions & 0 deletions app/@types/app.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
declare type ThemeOverrides = "light" | "dark" | "unset"

declare type OptionsCtxTypes = {
theme: ThemeOverrides
highContrast: boolean
expandComics?: boolean
animations: boolean | undefined
setTheme: (theme: ThemeOverrides) => void
setExpandComics?: (expandComics: boolean) => void
setHighContrast: (highContrast: boolean) => void
setAnimations: (animations: boolean) => void
}

declare type SidebarCtxTypes = {
expanded: boolean
marginSize: string
setExpanded: (expanded: boolean) => void
setMarginSize: (marginSize: string) => void
}

declare type ModalCtxTypes = {
modalOpen: boolean
setModalOpen: (modalOpen: boolean) => void
}

declare interface LayoutProps {
children?: React.ReactNode
}

declare interface ContainerProps extends LayoutProps {
title?: string
description?: string
wrap?: boolean | undefined
}

declare interface NavLinkProps {
link?: string
name?: string
icon: IconProp
}

declare interface ComicItemProps {
title?: string
img: string
link: string
characters?: string[]
guestItem?: boolean
favoriteItem?: boolean
}

declare interface NavbarRootProps extends LayoutProps {}

declare interface SidebarItemProps {
link?: string
name?: string
icon?: any
disabled?: boolean
header?: string
kofi?: boolean
hideOnCollapse?: boolean
}
Loading