Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
603 commits
Select commit Hold shift + click to select a range
2ef91ea
Merge branch 'dev' into chanatpakorn/joh-58-sprint-4-download-and-share
ChanatpakornS Jan 24, 2024
bbddbbf
Merge pull request #44 from isd-sgcu/tee/joh-62-sprint-4-qna
TeeGoood Jan 24, 2024
af18018
feat: download horo (no decoration)
ChanatpakornS Jan 24, 2024
9cc5787
feat: skip stories
ThanaphomH Jan 24, 2024
fa0a041
chore: lint:fix
ThanaphomH Jan 24, 2024
ce29c46
refactor: add z value to footer
ThanaphomH Jan 24, 2024
0cd398a
chore(deps-dev): bump vite from 5.0.10 to 5.0.12 (#43)
dependabot[bot] Jan 25, 2024
425ee57
refactor: for preview (#46)
boomchanotai Jan 25, 2024
ac41ee1
feat: d & s horo
ChanatpakornS Jan 25, 2024
bfcd1a2
Merge branch 'dev' into chanatpakorn/joh-58-sprint-4-download-and-share
ChanatpakornS Jan 25, 2024
fc973aa
Merge pull request #45 from isd-sgcu/thanaphomh/joh-79-sprint-5-skip-…
ThanaphomH Jan 25, 2024
895c113
feat: add auth api function
punchanabu Jan 25, 2024
5f2db3b
feat: create auth store
punchanabu Jan 26, 2024
f9d1498
feat: useAuth and update api function
punchanabu Jan 26, 2024
3e3b2a9
refactor: store and auth hooks
punchanabu Jan 26, 2024
5c6c322
feat: add sign out and sign in hook
punchanabu Jan 26, 2024
e40995c
feat: add forget/reset password in useAuth
punchanabu Jan 26, 2024
d07df06
refactor: lint
punchanabu Jan 26, 2024
e652b77
Merge branch 'dev' into punpun/joh-74-sprint-5-api-admin-auth-login-r…
punchanabu Jan 27, 2024
b01a69d
fix: lint and built failed
punchanabu Jan 27, 2024
0f95178
fix my lock file
punchanabu Jan 27, 2024
cdc932a
feat: d&s
ChanatpakornS Jan 29, 2024
46d6b1b
fixed: deployment checked
ChanatpakornS Jan 29, 2024
a8eec98
fixed: deployment checked
ChanatpakornS Jan 29, 2024
0c8fec4
refactor: later
ChanatpakornS Jan 29, 2024
0e9d97b
refactor: jpg to jpeg
ChanatpakornS Jan 30, 2024
e02ba32
deleted: test page
ChanatpakornS Jan 30, 2024
0b3c2dd
Merge branch 'dev' into chanatpakorn/joh-58-sprint-4-download-and-share
ChanatpakornS Jan 30, 2024
d62f976
chore: add react-select
ThanaphomH Jan 30, 2024
30401ed
feat: create pet api
ThanaphomH Jan 30, 2024
bccbaca
refactor: remove unused ref
ThanaphomH Jan 30, 2024
f00236f
feat: dropdown info and options
ThanaphomH Jan 30, 2024
88434db
refactor: change info type
ThanaphomH Jan 30, 2024
1dd9e87
feat: disable submit when not provide minimun info
ThanaphomH Jan 30, 2024
793a4dd
refactor: simplify my code
punchanabu Jan 31, 2024
0ff3e0d
feat: implement on sign in component
punchanabu Jan 31, 2024
5411c48
feat: redirect to /admin/pet after login finsh
punchanabu Jan 31, 2024
83b68cd
refactor: lint
punchanabu Jan 31, 2024
123fd5a
fix: deleting signUp because no need
punchanabu Feb 1, 2024
eb4e7d2
fix: refrest token gone : use persist
punchanabu Feb 1, 2024
30e586d
feat: if forget-pasword but login go to home
punchanabu Feb 1, 2024
08a790a
feat: declare type for store
punchanabu Feb 1, 2024
96489ad
feat: add expriedAt state
punchanabu Feb 1, 2024
dc34ab9
feat: post /images
ThanaphomH Feb 2, 2024
95734a4
feat: remove "-" when empty info
ThanaphomH Feb 2, 2024
c182a01
feat: collect all pet data
ThanaphomH Feb 2, 2024
db3f02d
refactor: post pets api using useMutation
ThanaphomH Feb 2, 2024
c21e7b6
refactor: mutation hook usage
ThanaphomH Feb 2, 2024
1a4e698
chore: lint:fix
ThanaphomH Feb 2, 2024
ceeffc4
refactor: change POST /images request file from base64 to File
ThanaphomH Feb 3, 2024
0dcf8c9
refactor: change pets gender label
ThanaphomH Feb 3, 2024
4d21b0f
chore: lint:fix
ThanaphomH Feb 3, 2024
6592412
refactor: remove SingleValue usage
ThanaphomH Feb 3, 2024
d33dd72
feat: add token validation
punchanabu Feb 3, 2024
17ddb7e
feat: implement forget/reset password
punchanabu Feb 3, 2024
857047d
fix: lint
punchanabu Feb 3, 2024
05163db
feat: auth token to header
ThanaphomH Feb 3, 2024
d3f8dff
fix: wrong url api path
punchanabu Feb 3, 2024
fe43769
refactor: delete /login
punchanabu Feb 3, 2024
48e96c7
refactor: use-form-hook for login
punchanabu Feb 3, 2024
b5e7e90
refactor: api path
ThanaphomH Feb 3, 2024
c992ded
feat: date picker for age field
ThanaphomH Feb 4, 2024
5146733
chore: lint:fix
ThanaphomH Feb 4, 2024
6b55c3b
refactor: font semibold
ThanaphomH Feb 4, 2024
cd747a2
Feat: add favorite
MichaelScodaeng Feb 6, 2024
2c729a0
Refactor:code
MichaelScodaeng Feb 6, 2024
84e7df6
Update index.tsx
MichaelScodaeng Feb 6, 2024
0cacfb3
fix: home page error (#51)
boomchanotai Feb 13, 2024
75a4a6a
fix: routing flow
punchanabu Feb 13, 2024
32e7a9f
merge dev
punchanabu Feb 13, 2024
1bc33a7
fix: password implementation
punchanabu Feb 14, 2024
46c322e
refactor: run lint
punchanabu Feb 14, 2024
4bb9084
refactor: remove unused console.log
ThanaphomH Feb 15, 2024
cbec484
feat: flip save button on ipad
ThanaphomH Feb 15, 2024
1e60491
refactor: change hooks name
ThanaphomH Feb 15, 2024
eeb1d34
feat: working api now
ThanaphomH Feb 15, 2024
ca9a1d3
feat: download & share
ChanatpakornS Feb 16, 2024
5c63877
feat: share utils
ChanatpakornS Feb 16, 2024
7d8737f
merge: dev
ChanatpakornS Feb 16, 2024
690ff43
Merge branch 'dev' into thanaphomh/joh-72-sprint-5-api-admin-add-pets…
ThanaphomH Feb 16, 2024
3c0ad8e
refactor: change pet badge text
ThanaphomH Feb 16, 2024
31ce564
Merge pull request #48 from isd-sgcu/punpun/joh-74-sprint-5-api-admin…
punchanabu Feb 16, 2024
c65b895
chore: lint:fix
ThanaphomH Feb 16, 2024
557e244
Merge branch 'dev' into thanaphomh/joh-72-sprint-5-api-admin-add-pets…
ThanaphomH Feb 16, 2024
0ce9604
chore: update pnpm-lock
ThanaphomH Feb 16, 2024
441a33e
Merge pull request #49 from isd-sgcu/thanaphomh/joh-72-sprint-5-api-a…
ThanaphomH Feb 16, 2024
aa2fbdf
refactor: filename
ChanatpakornS Feb 16, 2024
8755abf
refactor: lint fix
ChanatpakornS Feb 16, 2024
1b770d0
refactor: usePathStyle in this branch
ChanatpakornS Feb 16, 2024
b8ba6b1
fix: edit from johnjud's request (#52)
boomchanotai Feb 16, 2024
0d69df8
Merge branch 'dev' into chanatpakorn/joh-58-sprint-4-download-and-share
ChanatpakornS Feb 16, 2024
9b5490b
Merge pull request #47 from isd-sgcu/chanatpakorn/joh-58-sprint-4-dow…
ChanatpakornS Feb 16, 2024
bec97b9
refactor: rename page component
ThanaphomH Feb 16, 2024
391afcd
refactor: remove blank side image
ThanaphomH Feb 16, 2024
06e8fbf
feat: implemented post pet
ThanaphomH Feb 16, 2024
0f25d10
refactor: centered item in info
ThanaphomH Feb 16, 2024
27c6876
fix: button shrink when there is a long nature text at /pets
ThanaphomH Feb 16, 2024
063613d
button shrink when there is a long nature text at /admin/pets
ThanaphomH Feb 16, 2024
75bfe79
fix: too large picture in small pet card
ThanaphomH Feb 16, 2024
8e271ba
fix: changed to matched with other icon
ThanaphomH Feb 16, 2024
fc85aee
chore: lint:fix
ThanaphomH Feb 16, 2024
7748390
Merge pull request #53 from isd-sgcu/thanaphomh/joh-85-implement-add-…
ThanaphomH Feb 18, 2024
78caf6d
feat: created pet status modal & logout button (#54)
boomchanotai Feb 19, 2024
613b65c
feat: initialize visibility function
NhongSun Feb 19, 2024
f105cad
Merge branch 'dev' into chanatipzaza/joh-75-sprint-5-api-edit-pets-ca…
NhongSun Feb 19, 2024
bd6e353
feat: QUery
ChanatpakornS Feb 19, 2024
ef60d96
feat: initialize query function
NhongSun Feb 19, 2024
09b76dc
fix: lint
NhongSun Feb 19, 2024
be9e7e4
fixed: casting type
ChanatpakornS Feb 19, 2024
90f77fc
feat: using updateVisibility with petcard
NhongSun Feb 19, 2024
6595ca3
fix: using lint:fix
NhongSun Feb 19, 2024
7dc8070
feat: adjust for filter search
punchanabu Feb 19, 2024
bb52b27
fix: remove redundant useSate
NhongSun Feb 19, 2024
d7a195f
fix: delete comment
NhongSun Feb 19, 2024
820b1d5
Merge pull request #56 from isd-sgcu/chanatipzaza/joh-75-sprint-5-api…
NhongSun Feb 19, 2024
7759072
feat: merge dev
ChanatpakornS Feb 19, 2024
fc810e7
feat: delete pet & delete uploaded image (#59)
boomchanotai Feb 19, 2024
1385c1a
feat: protected route (#60)
boomchanotai Feb 19, 2024
89b3782
feat: add fallback (#61)
boomchanotai Feb 19, 2024
4246536
feat: improve a lots of things (#62)
boomchanotai Feb 20, 2024
84b3804
fix: just kidding
NhongSun Feb 20, 2024
7816ab0
fix: admin login color
NhongSun Feb 20, 2024
49fd64d
refactor: add aspect image
boomchanotai Feb 20, 2024
0da883d
feat: dynamic age
boomchanotai Feb 20, 2024
dd33281
feat: add max date
boomchanotai Feb 20, 2024
b736686
feat: faster after create pet navigate
boomchanotai Feb 20, 2024
4e0a916
Merge pull request #65 from isd-sgcu/boom/feat/improve-birthdate-input
boomchanotai Feb 20, 2024
84fd107
refactor: use webp
boomchanotai Feb 20, 2024
4bda553
refactor: remove unused icon
boomchanotai Feb 20, 2024
121ff4e
refactor: remove unused icon
boomchanotai Feb 20, 2024
421648d
refactor: remove unused image
boomchanotai Feb 20, 2024
0eaa99a
refactor: use webp
boomchanotai Feb 20, 2024
7d42aae
refactor: use webp
boomchanotai Feb 20, 2024
05c6b38
refactor: use webp
boomchanotai Feb 20, 2024
ae7f381
feat: query picture and text
ChanatpakornS Feb 20, 2024
400f84b
fix: reset password and forget password page
NhongSun Feb 20, 2024
0daae03
refactor: use webp
boomchanotai Feb 20, 2024
45cd14d
refactor: merge & conflict
ChanatpakornS Feb 20, 2024
773ae66
Merge pull request #63 from isd-sgcu/refactor/admin-login-page
NhongSun Feb 20, 2024
0c75242
refactor: use webp
boomchanotai Feb 20, 2024
2b4f335
Merge pull request #66 from isd-sgcu/boom/feat/improve-images
boomchanotai Feb 20, 2024
2e4b15a
fix: padding footer
boomchanotai Feb 20, 2024
f5eb76d
fix: logo
boomchanotai Feb 20, 2024
0e30f5e
Merge pull request #67 from isd-sgcu/boom/fix/logo
boomchanotai Feb 20, 2024
902695b
feat: toggleInput
punchanabu Feb 20, 2024
5a851e7
feat: add state for filter
punchanabu Feb 20, 2024
7907f57
feat: change to tick
punchanabu Feb 20, 2024
4ec1203
feat: move state to the app/pets/ page
punchanabu Feb 20, 2024
023b127
feat: seo
boomchanotai Feb 20, 2024
6b3232e
feat: handle query picture
ChanatpakornS Feb 20, 2024
3f8e491
fix: remove meta
boomchanotai Feb 20, 2024
1d744d9
build: add react helmet
boomchanotai Feb 20, 2024
ca58a78
feat: add helmet seo
boomchanotai Feb 20, 2024
2d7734f
fix: thumbnail
boomchanotai Feb 20, 2024
601ba76
fix: seo
boomchanotai Feb 20, 2024
f446aef
Merge pull request #68 from isd-sgcu/boom/feat/seo
boomchanotai Feb 20, 2024
c351068
feat: connect api
punchanabu Feb 20, 2024
d623aed
feat: add filter for /admin/pets
punchanabu Feb 20, 2024
88f0a7b
fix: lint
punchanabu Feb 20, 2024
5b4bf82
Merge branch 'dev' into pun/feat/implement-filter
punchanabu Feb 20, 2024
a886da8
merge dev
punchanabu Feb 20, 2024
e1dc41d
fix: seo
boomchanotai Feb 20, 2024
2c16ae5
feat: add theme
boomchanotai Feb 20, 2024
40453a4
feat: set theme
boomchanotai Feb 20, 2024
62193d8
feat: static theme color
boomchanotai Feb 20, 2024
a104760
feat: try dynamic theme
boomchanotai Feb 20, 2024
9c98b50
fix: no theme color anymore
boomchanotai Feb 20, 2024
6b574b3
Merge pull request #69 from isd-sgcu/boom/fix/seo
boomchanotai Feb 20, 2024
1a396d6
Merge branch 'dev' into chanatpakorn/joh-77-sprint-5-api-pets-info-pe…
ChanatpakornS Feb 20, 2024
f7dd7fb
feat: fallback
ChanatpakornS Feb 20, 2024
92da270
fix: add z-index to filter bar
punchanabu Feb 20, 2024
f506ed1
Merge pull request #58 from isd-sgcu/pun/feat/implement-filter
punchanabu Feb 20, 2024
bd0c337
fix: input date
boomchanotai Feb 20, 2024
b3a8ea4
Merge pull request #70 from isd-sgcu/boom/fix/input-date
boomchanotai Feb 20, 2024
b831a5a
refactor: fallback
ChanatpakornS Feb 20, 2024
aba0f61
Merge branch 'dev' into chanatpakorn/joh-77-sprint-5-api-pets-info-pe…
ChanatpakornS Feb 20, 2024
840d0d0
merge dev
ChanatpakornS Feb 20, 2024
183feb5
fix: admin/filter not working
punchanabu Feb 20, 2024
faf62a9
fix: linter
punchanabu Feb 20, 2024
97b219e
fix
MichaelScodaeng Feb 20, 2024
70f1e5f
Merge branch 'dev' into pee/joh-76-sprint-5-favorite-petcard
MichaelScodaeng Feb 20, 2024
dad9227
Fix: makes it works properly
MichaelScodaeng Feb 20, 2024
aa0a69e
fix:pnpm remove react-query
MichaelScodaeng Feb 20, 2024
19acd41
fix: lint:fix
MichaelScodaeng Feb 20, 2024
3d3e000
Merge pull request #50 from isd-sgcu/pee/joh-76-sprint-5-favorite-pet…
MichaelScodaeng Feb 20, 2024
abc4d09
refactor: date & minor fallback
ChanatpakornS Feb 20, 2024
634524c
refactor: change option value to english
ThanaphomH Feb 20, 2024
05ec14b
Merge pull request #72 from isd-sgcu/pun/feat/implement-filter
punchanabu Feb 20, 2024
e2c6c82
Merge pull request #57 from isd-sgcu/chanatpakorn/joh-77-sprint-5-api…
ChanatpakornS Feb 20, 2024
37808da
fix: home responsive
boomchanotai Feb 20, 2024
fd70d2a
fix: responsive
boomchanotai Feb 20, 2024
c2e70a3
fix: home flicker
boomchanotai Feb 20, 2024
49dbb29
Merge pull request #74 from isd-sgcu/boom/fix/home-responsive
boomchanotai Feb 20, 2024
4290e27
feat: implement fav system to card (#76)
boomchanotai Feb 20, 2024
038015d
Merge pull request #73 from isd-sgcu/thanaphomh/joh-94-เปลี่ยน-filter…
ThanaphomH Feb 21, 2024
bc2f12d
test: initialize test & authorization system frontend test (#77)
boomchanotai Feb 21, 2024
9a08592
feat: handle null image
ChanatpakornS Feb 21, 2024
eb88b25
Merge pull request #78 from isd-sgcu/chanapakorn/adopt-page-fixed
ChanatpakornS Feb 21, 2024
9e838e5
test: add ui test & fix sementic (#79)
boomchanotai Feb 21, 2024
e43b07d
feat: getPetsAdmin API
bookpanda Feb 22, 2024
c931a9b
feat: usePetAdminQuery
bookpanda Feb 22, 2024
e3659bc
feat: usePetsAdminQuery in admin pages
bookpanda Feb 22, 2024
2048dbf
feat: filter on home page
punchanabu Feb 22, 2024
b07718e
fix: linter
punchanabu Feb 22, 2024
519a76a
feat: add search function
punchanabu Feb 23, 2024
7d8611d
fix: linter
punchanabu Feb 23, 2024
2a50243
refactor: remove debug console.log
punchanabu Feb 23, 2024
1ede36c
Merge pull request #81 from isd-sgcu/pun/feat/implement-filter
punchanabu Feb 25, 2024
45d474d
Merge pull request #80 from isd-sgcu/feat--add-usePetsAdminQuery
bookpanda Feb 25, 2024
8577328
feat: /pets/:id fav
ChanatpakornS Feb 25, 2024
f96dbce
refactor: shorten code
ChanatpakornS Feb 25, 2024
29f08fb
Merge pull request #82 from isd-sgcu/chanatpakorn/implenting-details-…
ChanatpakornS Feb 25, 2024
5d6f095
Tee/sprint 5/admin edit api2 (#83)
TeeGoood Feb 25, 2024
4e11d7b
Tee/sprint 5/refactor dateformat defualtdropdown value (#84)
TeeGoood Feb 26, 2024
d0a5b33
feat: add message for not found filter result
punchanabu Feb 27, 2024
f42e7b5
refactor: remove unnecessary stuffs
punchanabu Feb 27, 2024
80468b5
refactor: lint
punchanabu Feb 27, 2024
0a57daa
Merge pull request #85 from isd-sgcu/pun/feat/filter-not-found
punchanabu Feb 28, 2024
4d6490c
feat: add name (#86)
boomchanotai Mar 15, 2024
87fecc6
feat: age range (#87)
boomchanotai Mar 15, 2024
187fdbb
fix: title cards (#88)
boomchanotai Mar 23, 2024
57106c1
feat: reset-password (#89)
boomchanotai Mar 24, 2024
f387eb6
fix: fav
boomchanotai Apr 3, 2024
d5d512e
build: add docker
boomchanotai Apr 11, 2024
c65c1aa
build: remove .env
boomchanotai Apr 11, 2024
30f0e73
build: no static
boomchanotai Apr 11, 2024
2999551
build: change port
boomchanotai Apr 11, 2024
48cb4c0
build: add compose env
boomchanotai Apr 11, 2024
62c81b6
feat: ci
plohan Apr 12, 2024
5ed2327
Merge pull request #90 from isd-sgcu/feat/ci
plohan Apr 12, 2024
5060b3f
build: pass env as build time
boomchanotai Apr 12, 2024
402970c
feat: add build-time args
plohan Apr 13, 2024
50c20ae
Merge pull request #91 from isd-sgcu/feat/ci
plohan Apr 13, 2024
77cb642
fix: mismatch card and name
punchanabu Apr 22, 2024
483bee3
fix: unmatched-result-game
ChanatpakornS Apr 22, 2024
abd9987
Merge pull request #93 from isd-sgcu/chanatpakorn/fix/unmatched-result
ChanatpakornS Apr 23, 2024
c6b7402
Merge pull request #92 from isd-sgcu/pun/fix/unmatched-card
punchanabu Apr 23, 2024
d2d9642
fix(ci): pnpm strict mode
plohan Apr 25, 2024
6271db8
Merge pull request #94 from isd-sgcu/fix/pnpm-strict
plohan Apr 25, 2024
ecf83c7
fix: change build time to runtime
plohan Apr 25, 2024
1ca0a18
Merge pull request #95 from isd-sgcu/fix/ci
plohan Apr 25, 2024
5fb8da5
feat: add more color (#96)
punchanabu May 9, 2024
79ad187
fix: default value bug (#97)
boomchanotai May 9, 2024
6b57ba2
Boom/fix/minor bug 1 (#98)
boomchanotai May 10, 2024
291fa3e
Tee/add contact (#99)
TeeGoood May 17, 2024
6b4c428
refactor: auth refreshtoken (#100)
boomchanotai May 17, 2024
30c92ce
add toast loading (#101)
TeeGoood Jul 24, 2024
934aa80
Merge branch 'main' into dev (#103)
TeeGoood Jul 24, 2024
b6c83f7
remove BigPetCard component (#104)
TeeGoood Jul 24, 2024
0b39df0
fix: wrong image order and wrong origin badge when add pets
punchanabu Jan 15, 2025
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
8 changes: 8 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.git
node_modules
Dockerfile
.gitignore
README.md
.prettierrc
docker-compose.yml
.env
6 changes: 5 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,11 @@
"import/resolver": {
"node": {
"extensions": [".js", ".jsx", ".ts", ".tsx"],
"moduleDirectory": ["node_modules", "src/"]
"moduleDirectory": ["node_modules", "src/", "@/"]
},
"alias": {
"map": [["@", "./src/"]],
"extensions": [".js", ".jsx", ".ts", ".tsx"]
}
}
}
Expand Down
42 changes: 42 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: CI

on:
push:
branches:
- dev
- main
tags:
- v*

env:
IMAGE_NAME: ghcr.io/${{ github.repository }}

permissions:
contents: read
packages: write

jobs:
build-and-push:
name: Build and push docker image
runs-on: ubuntu-latest

steps:
- name: Login to registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}

- name: Setup buildx
uses: docker/setup-buildx-action@v2

- name: Build and push
uses: docker/build-push-action@v3
with:
push: true
tags: ${{ env.IMAGE_NAME }}:${{ github.ref_type == 'tag' && github.ref_name || github.sha }}
cache-from: type=gha,ref=${{ env.IMAGE_NAME }}:buildcache
cache-to: type=gha,ref=${{ env.IMAGE_NAME }}:buildcache,mode=max
build-args: |
API_URL=https://api.johnjud.com/v1
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,5 @@ dist-ssr
*.njsproj
*.sln
*.sw?

.env
21 changes: 21 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
FROM node:21-alpine3.18 AS base

ARG API_URL

ENV VITE_API_URL=${API_URL}
ENV COREPACK_ENABLE_STRICT=0

RUN npm i -g pnpm

WORKDIR /app

COPY package.json pnpm-lock.yaml ./
RUN pnpm install

COPY . .

RUN pnpm build

EXPOSE 4173

CMD ["pnpm", "preview"]
27 changes: 25 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ pnpm install
pnpm dev
```

5. Go to [http://localhost:3000](http://localhost:3000) in your fav browser.
5. Go to [http://localhost:5173](http://localhost:5173) in your fav browser.

## Contributing

Expand Down Expand Up @@ -110,4 +110,27 @@ The commit message should start with one of the following types:
- refactor: A code change that neither fixes a bug nor adds a feature
- style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)

For more information, please read the [conventional commit format](https://www.conventionalcommits.org/en/v1.0.0/) documentation.
For more information, please read the [conventional commit format](https://www.conventionalcommits.org/en/v1.0.0/) documentation.


## Implement API

This project use `@tanstack/react-query` with `axios` for fetching data and We will use custom queries hooks for query.

Please see in Discord for `.env` file

Structure

- `src/api` : Store api fetching function using `axios`
- `src/types` : Store type of fetched data
- `src/hook/queries` : Store query function from `@tanstack/react-query`
- `src/hook/mutation` : Store mutation function

Instruction Step :

1. Create type from data in `src/types` if have pagination use `Meta` from `src/types/common.ts`
2. Create fetching function in `src/api` and passing type to axios function
3. Create query function in `src/hook/quries` or mutation function in `src/hook/mutation`
4. Implement Query or Mutation function in **Page** and pass data to components

** **Do not query data in any Component !!**
8 changes: 8 additions & 0 deletions cypress.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { defineConfig } from "cypress";

export default defineConfig({
e2e: {
baseUrl: "http://localhost:5173",
testIsolation: false,
},
});
58 changes: 58 additions & 0 deletions cypress/e2e/authentication.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
describe("authentication", () => {
it("can visit the site", () => {
cy.visit("/");
cy.wait(2000);
localStorage.clear();
});

it("can open sidebar", () => {
cy.get("#open-sidebar").click();
});

it("can navigate to login page", () => {
cy.get("a").contains("Admin Login").click();

cy.wait(1000);
cy.url().should("include", "/admin");
cy.get("h1").contains("เข้าสู่ระบบ");
});

it("can login", () => {
cy.wait(2000);
cy.get(`input[name="email"]`).type("[email protected]");
cy.get(`input[name="password"]`).type("12345678");
cy.get("button").contains("เข้าสู่ระบบ").click();

cy.wait(2000);
cy.url().should("include", "/admin/pets");
cy.get("#open-sidebar").click();
cy.get("button").contains("Logout").should("exist");
});

it("can logout", () => {
cy.get("button").contains("Logout").click();

cy.wait(1000);
cy.url().should("include", "/admin");
});

it("can navigate to forget password page", () => {
cy.get("a").contains("ลืมรหัสผ่าน?").click();

cy.wait(1000);
cy.url().should("include", "/admin/forget-password");
cy.get("h1").contains("ลืมรหัสผ่าน?");
});

it("can request forget password", () => {
cy.get(`input[name="email"]`).type("[email protected]");
cy.get("button").contains("รีเซตรหัสผ่าน").click();

cy.wait(1000);
cy.get("h2").contains("อีเมลรีเซ็ตถูกส่งแล้ว").should("exist");
cy.get("button").contains("กลับไปหน้าเข้าสู่ระบบ").click();

cy.wait(1000);
cy.url().should("include", "/admin");
});
});
163 changes: 163 additions & 0 deletions cypress/e2e/ui.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
describe("first page", () => {
it("can visit the site", () => {
cy.visit("/");
cy.wait(2000);
localStorage.clear();
});

it("can show items correctly in sidebar", () => {
cy.get("#open-sidebar").click();

cy.get("a").contains("หน้าหลัก").should("exist");
cy.get("a").contains("สัตว์เลี้ยง").should("exist");
cy.get("a").contains("เล่นเกม").should("exist");
cy.get("a").contains("ดูดวง").should("exist");
cy.get("a").contains("คำถามที่พบบ่อย").should("exist");
cy.get("a").contains("เกี่ยวกับเรา").should("exist");
cy.get("a").contains("รายการที่ชอบ").should("exist");
cy.get("a").contains("Admin Login").should("exist");
cy.get("button").contains("Logout").should("not.exist");

cy.get("#close-sidebar").click();
});

it("can navigate to home page", () => {
cy.get("button").contains("กดดูเลย").should("exist");
cy.get("button").contains("กดดูเลย").click();
cy.wait(2000);
});
});

describe("home page", () => {
it("should show carousel", () => {
cy.get("div.carousel.carousel-slider").should("exist");
});

it("should have 8 mini cards", () => {
cy.get("div.w-40.rounded-2xl.bg-white.shadow-md").should("have.length", 8);
});

it("should have pet cards", () => {
cy.get(
"div.flex.w-80.flex-col.items-start.justify-start.rounded-2xl.bg-white.p-4.shadow"
).should("have.length.at.least", 8);
});

it("can navigate to home page", () => {
cy.get("#open-sidebar").click();
cy.get("a").contains("สัตว์เลี้ยง").click();
cy.wait(2000);
});
});

describe("pets page", () => {
it("should have search input", () => {
cy.get(`input[placeholder="ค้นหาสัตว์เลี้ยง"]`).should("exist");
});

it("should have pet cards", () => {
cy.get(
"div.flex.w-80.flex-col.items-start.justify-start.rounded-2xl.bg-white.p-4.shadow"
).should("have.length.at.least", 8);
});

it("should have filter button", () => {
cy.get("button > svg.iconify--custom").should("exist");
cy.get("button > svg.iconify--custom").click();
});

it("should show filter menu correctly", () => {
cy.get("button.bg-accent-red")
.contains("ประเภทสัตว์เลี้ยง")
.should("exist");
cy.get("button.bg-accent-red").contains("เพศ").should("exist");
cy.get("button.bg-accent-red").contains("สี").should("exist");
cy.get("button.bg-accent-red").contains("อายุ").should("exist");
});

it("can navigate to pet detail page", () => {
// TODO: Add Random Click
cy.get(
"div.flex.w-80.flex-col.items-start.justify-start.rounded-2xl.bg-white.p-4.shadow"
)
.eq(1)
.click();
cy.wait(2000);
});
});

describe("pet detail page", () => {
it("should have carousel", () => {
cy.get("div.carousel.carousel-slider").should("exist");
});

it("should have pet name", () => {
cy.get("h2.text-3xl.font-bold.text-primary").should("exist");
});

it("should have description", () => {
cy.get("textarea").should("exist");
});

it("should have like button", () => {
cy.get("#like-button").should("exist");
});

it("should have gender detail", () => {
cy.get("div").contains("เพศ").should("exist");
});

it("should have type detail", () => {
cy.get("div").contains("ชนิด").should("exist");
});

it("should have birthdate detail", () => {
cy.get("div").contains("วันเกิด").should("exist");
});

it("should have habit detail", () => {
cy.get("div").contains("นิสัย").should("exist");
});

it("should have vaccinate detail", () => {
cy.get("button").contains("ฉีดวัคซีนแล้ว").should("exist");
});

it("should have sterile detail", () => {
cy.get("button").contains("ทำหมันแล้ว").should("exist");
});

it("should have adoption button", () => {
cy.get("button").contains("รับเลี้ยงเลย").should("exist");
});

it("should have small pet card", () => {
cy.get("div.w-48.rounded-2xl.bg-white.p-3.shadow-md").should(
"have.length.at.least",
8
);
});

it("can navigate to pet adoption page", () => {
cy.get("button").contains("รับเลี้ยงเลย").click();
cy.wait(2000);
});
});

describe("pet adoption page", () => {
it("should have carousel", () => {
cy.get("div.carousel.carousel-slider").should("exist");
});

it("should have pet name", () => {
cy.get("h2.text-3xl.font-bold.text-primary").should("exist");
});

it("should have pet name", () => {
cy.get("h3").contains("ข้อตกลงการรับเลี้ยง").should("exist");
cy.get("button.bg-accent-red").contains("รับเลี้ยงเลย").should("exist");
cy.get("button.bg-accent-red").contains("รับเลี้ยงเลย").click();

cy.get("button.bg-primary").contains("รับเลี้ยงเลย").should("exist");
});
});
5 changes: 5 additions & 0 deletions cypress/fixtures/example.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"name": "Using fixtures to represent data",
"email": "[email protected]",
"body": "Fixtures are a great way to mock data for responses to routes"
}
Loading