Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
110 commits
Select commit Hold shift + click to select a range
e895a2d
feat: setup database
ForestoAY Sep 2, 2024
a20e405
feat: add migrations
ForestoAY Sep 2, 2024
2a7af9d
feat: add models
ForestoAY Sep 2, 2024
a3f61c9
refactor: add cascade on delete for cardSet and cardPrice
ForestoAY Sep 2, 2024
66e6483
feat: configuring app.js
ForestoAY Sep 2, 2024
574f5ae
feat: configuring bin/www
ForestoAY Sep 2, 2024
8aff222
feat: add helpers and middleware
ForestoAY Sep 2, 2024
44315eb
refactor: add npm run dev
ForestoAY Sep 2, 2024
2354c1e
refactor: remove cardPrice and CardSet from database, add CardControl…
ForestoAY Sep 2, 2024
32faeb6
feat: add route getCardById
ForestoAY Sep 2, 2024
bb63ab8
refactor: add archetype in card model
ForestoAY Sep 3, 2024
bdb3ad0
refactor: add stock in favorite model
ForestoAY Sep 3, 2024
bcb0a79
feat: add favorite card route, add favorite, update favorite, delete …
ForestoAY Sep 3, 2024
94ab940
fix: change req params of delete and update
ForestoAY Sep 3, 2024
e7bd4cf
fix: change route path arragement
ForestoAY Sep 3, 2024
d03fb8f
fix: change json to data in getFavorites
ForestoAY Sep 3, 2024
1930b54
feat: add testing for user
ForestoAY Sep 3, 2024
cd84b14
feat: add axios error handler for bad request
ForestoAY Sep 3, 2024
02249bf
feat: add testing for card
ForestoAY Sep 3, 2024
1bdf560
feat: add testing coverage
ForestoAY Sep 3, 2024
2ea23e4
feat: vite project setup with tailwindcss
ForestoAY Sep 4, 2024
8c86148
feat: add tailwind css
ForestoAY Sep 4, 2024
43c7236
feat: add navbar in components
ForestoAY Sep 4, 2024
dc3b44a
add dark mode toggle in components
ForestoAY Sep 4, 2024
012925a
refactor: remove cors from package
ForestoAY Sep 4, 2024
134202a
add cors on server
ForestoAY Sep 4, 2024
a188d35
chore: update .gitignore
ForestoAY Sep 4, 2024
dfaca02
feat: add register page
ForestoAY Sep 4, 2024
bda8a7b
feat: add login page
ForestoAY Sep 4, 2024
cd8b791
feat: add root layout
ForestoAY Sep 4, 2024
b525cae
feat: add sidebar
ForestoAY Sep 4, 2024
268bd30
style: add style to navbar and rootlayout for more scalable
ForestoAY Sep 4, 2024
ffc11cd
feat: add logo in public images
ForestoAY Sep 4, 2024
bfff8b0
style: change background color
ForestoAY Sep 4, 2024
534e583
add loader to guard url
ForestoAY Sep 4, 2024
c5e62a7
refactor: remove console log
ForestoAY Sep 4, 2024
c017d17
style: add style on div rootlayout
ForestoAY Sep 4, 2024
699bf46
style: change icon sidebar
ForestoAY Sep 4, 2024
06b1397
feat: add react icon package
ForestoAY Sep 4, 2024
f830662
feat: add new route for favorites
ForestoAY Sep 4, 2024
9a6ba5f
fix: fix pagination, sort
ForestoAY Sep 4, 2024
d68fca2
style: make logout button dark red
ForestoAY Sep 4, 2024
e45ae52
refactor: add favoriteId in Get favorite
ForestoAY Sep 4, 2024
1df68a4
refactor: add stock in GET favorite
ForestoAY Sep 4, 2024
3dda3a0
fix: fix redirect when already have access_token to /cards
ForestoAY Sep 4, 2024
3a18cbe
feat: add new route for edit favorite
ForestoAY Sep 4, 2024
4bef731
feat: add card detail page
ForestoAY Sep 4, 2024
119c49b
feat: add favorite page
ForestoAY Sep 4, 2024
a576451
feat: add edit favorite page by stock
ForestoAY Sep 4, 2024
061e8ad
chore: update sweetalert message
ForestoAY Sep 4, 2024
0caeb66
feat: add minigames route
ForestoAY Sep 4, 2024
093f301
refactor: add link to minigames, remove combo
ForestoAY Sep 4, 2024
74d9eca
feat: add new route for random card, and random card in controller
ForestoAY Sep 4, 2024
286ebea
test: add randomcard testing
ForestoAY Sep 4, 2024
4e4c767
feat: add validation can't add another same favorite card
ForestoAY Sep 4, 2024
66275d9
test: add test for post same card favorite
ForestoAY Sep 4, 2024
fd24255
refactor: add link in image logo
ForestoAY Sep 4, 2024
16daf73
feat: add sweetalert when success add card to favorite
ForestoAY Sep 4, 2024
4209d9e
docs: add api docs
ForestoAY Sep 4, 2024
e462717
feat: add minigames route and integration with openAI
ForestoAY Sep 5, 2024
7f33a36
chore: add .env.example
ForestoAY Sep 5, 2024
73af3d0
chore: update prompt in openai
ForestoAY Sep 5, 2024
44c31b6
refactor: add cardName in response minigames
ForestoAY Sep 5, 2024
a927a63
refactor: change method minigames from POST to GET
ForestoAY Sep 5, 2024
0c77a6a
test: add testing for minigames
ForestoAY Sep 5, 2024
548879b
docs: add endpoint for minigames
ForestoAY Sep 5, 2024
a55766a
refactor: remove comment
ForestoAY Sep 5, 2024
7b54574
feat: add oauth google
ForestoAY Sep 5, 2024
4c56d3e
docs: add endpoint for login google
ForestoAY Sep 5, 2024
f8fa8c9
feat: add login with google
ForestoAY Sep 5, 2024
696a39d
refactor: add script for oauth google
ForestoAY Sep 5, 2024
95265ec
refactor: add .env to gitignore
ForestoAY Sep 5, 2024
3c6cde4
style: fix style login and register not center
ForestoAY Sep 5, 2024
c9aa01d
feat: add minigames page
ForestoAY Sep 5, 2024
956396c
fix: fix fetching data twice
ForestoAY Sep 5, 2024
c2e1ca3
refactor: change toast description when login with google
ForestoAY Sep 5, 2024
14e8436
style: change text to white
ForestoAY Sep 5, 2024
4e77e48
refactor: change comment description
ForestoAY Sep 5, 2024
50ba299
feat: implementation of redux on cardpage, use redux on state card an…
ForestoAY Sep 5, 2024
c795763
feat: implement redux to favorites and quiz
ForestoAY Sep 5, 2024
37ec38b
refactor: change name to plural
ForestoAY Sep 5, 2024
c9b979b
feat: add redux to one card detail
ForestoAY Sep 5, 2024
e6ff78e
refactor: change initialState card to null
ForestoAY Sep 5, 2024
c86638c
refactor: add validation stock cant be negative
ForestoAY Sep 5, 2024
7751c41
refactor: add default value stock in models
ForestoAY Sep 5, 2024
a9c916b
test: add testing for negative stock
ForestoAY Sep 5, 2024
52d4217
feat: add redux on stock update
ForestoAY Sep 5, 2024
4527430
feat: add redux on login and register, add slice for username, email,…
ForestoAY Sep 5, 2024
4df889b
refactor: change to useState for form on login & register
ForestoAY Sep 5, 2024
e035dbc
refactor: change to useState for stock on editFavorite
ForestoAY Sep 5, 2024
1d7edfe
feat: add redux on minigamesPage
ForestoAY Sep 5, 2024
a09a08f
feat: add new route to get one favorite card
ForestoAY Sep 5, 2024
a2396b7
docs: add new endpoint GET /cards/favorite/:id
ForestoAY Sep 5, 2024
a042dea
test: add testing for one favorite card
ForestoAY Sep 5, 2024
dddbdbb
refactor: add populate stock when load page edit
ForestoAY Sep 5, 2024
f848cdb
feat: add edit form components
ForestoAY Sep 5, 2024
f459712
feat: add filter components and apply it to cardpage
ForestoAY Sep 5, 2024
9b51075
style: make the search, sort, filter become responsive
ForestoAY Sep 5, 2024
b9b5c04
feat: add loader
ForestoAY Sep 5, 2024
a10b14d
style: off autocomplete
ForestoAY Sep 5, 2024
4112fd1
deployment: deploy to firebase v.10
ForestoAY Sep 5, 2024
7c7bd27
style: change with to 1/3
ForestoAY Sep 6, 2024
41bd708
style: filter not include in loader
ForestoAY Sep 6, 2024
3de6e56
style: update and delete button flex row
ForestoAY Sep 6, 2024
8e89672
style: add loader on card detail
ForestoAY Sep 6, 2024
a3fcd4d
fix: add userId when find favorite in createFavorite
ForestoAY Sep 6, 2024
e3753ee
style: add loader when fetch the quiz
ForestoAY Sep 6, 2024
d627a23
deployment: v1.1
ForestoAY Sep 6, 2024
1eb4186
style: remove login button
ForestoAY Sep 6, 2024
47bba99
deployment: v1.2
ForestoAY Sep 6, 2024
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
719 changes: 718 additions & 1 deletion README.md

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions client/.firebase/hosting.ZGlzdA.cache
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
vite.svg,1724731019137,699a02e0e68a579f687d364bbbe7633161244f35af068220aee37b1b33dfb3c7
images/Yu-Gi-Oh_logo.png,1725413597687,5610f12db4246ed27152d084ad15efb6ac220de93824f95a03e6f84bd208d73b
assets/index-CJwjH9ZF.css,1725588947206,8813df82d633cb5f24b0f17ef1d4739e7d61098fc9fcf6c2f468dcf353a22a41
index.html,1725588947206,6305c1fdb1cdbf44512d22fbb525b01da65e59083c538ca8d1a6227982274551
assets/index-B278pknw.js,1725588947206,b0951cbcfa5082e788edcfbba10b7ebd75af77271be7f2cb417221539341ffe9
5 changes: 5 additions & 0 deletions client/.firebaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"projects": {
"default": "yugioh-card-e23a2"
}
}
25 changes: 25 additions & 0 deletions client/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local
.env

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
8 changes: 8 additions & 0 deletions client/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# React + Vite

This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.

Currently, two official plugins are available:

- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
38 changes: 38 additions & 0 deletions client/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import js from '@eslint/js'
import globals from 'globals'
import react from 'eslint-plugin-react'
import reactHooks from 'eslint-plugin-react-hooks'
import reactRefresh from 'eslint-plugin-react-refresh'

export default [
{ ignores: ['dist'] },
{
files: ['**/*.{js,jsx}'],
languageOptions: {
ecmaVersion: 2020,
globals: globals.browser,
parserOptions: {
ecmaVersion: 'latest',
ecmaFeatures: { jsx: true },
sourceType: 'module',
},
},
settings: { react: { version: '18.3' } },
plugins: {
react,
'react-hooks': reactHooks,
'react-refresh': reactRefresh,
},
rules: {
...js.configs.recommended.rules,
...react.configs.recommended.rules,
...react.configs['jsx-runtime'].rules,
...reactHooks.configs.recommended.rules,
'react/jsx-no-target-blank': 'off',
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true },
],
},
},
]
16 changes: 16 additions & 0 deletions client/firebase.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"hosting": {
"public": "dist",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
]
}
}
17 changes: 17 additions & 0 deletions client/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!doctype html>
<html lang="en">

<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Yugioh Card List</title>
<script src="https://accounts.google.com/gsi/client" async></script>
</head>

<body>
<div id="root"></div>
<script type="module" src="/src/main.jsx"></script>
</body>

</html>
Loading