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

Beta #57

Open
wants to merge 318 commits into
base: main
Choose a base branch
from
Open

Beta #57

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
318 commits
Select commit Hold shift + click to select a range
173763b
bug(http-only cookie): test why it's not work on live server
Dec 21, 2022
2878705
Merge pull request #82 from raselinfo/rasel
raselinfo Dec 21, 2022
31a5583
bug(http-only cookie): test why it's not work on live server
Dec 21, 2022
4ac12a0
bug(http-only cookie): test why it's not work on live server
Dec 21, 2022
5344179
Merge pull request #83 from raselinfo/rasel
raselinfo Dec 21, 2022
af7d5fd
Merge pull request #84 from raselinfo/rasel
raselinfo Dec 21, 2022
ef6654a
bug(http-only cookie): test why it's not work on live server
Dec 21, 2022
6dac35c
Merge pull request #85 from raselinfo/rasel
raselinfo Dec 21, 2022
9ec1e4c
bug(http-only cookie): test why it's not work on live server
Dec 21, 2022
8d3e3f1
Merge pull request #86 from raselinfo/rasel
raselinfo Dec 21, 2022
bae06c2
bug(http-only cookie): test why it's not work on live server
Dec 21, 2022
e399acd
Merge pull request #87 from raselinfo/rasel
raselinfo Dec 21, 2022
8f6a115
bug(http-only cookie): test why it's not work on live server
Dec 21, 2022
4fb73b9
Merge pull request #88 from raselinfo/rasel
raselinfo Dec 21, 2022
c0b5fe3
bug(http-only cookie): test why it's not work on live server
Dec 21, 2022
32f1311
Merge pull request #89 from raselinfo/rasel
raselinfo Dec 21, 2022
237a8bd
bug(http-only cookie): test why it's not work on live server
Dec 21, 2022
b7c085b
Merge pull request #90 from raselinfo/rasel
raselinfo Dec 21, 2022
0ca6b15
bug(http-only cookie): test why it's not work on live server
Dec 21, 2022
3bcdb3f
Merge pull request #91 from raselinfo/rasel
raselinfo Dec 21, 2022
0ab86ff
bug(http-only cookie): test why it's not work on live server
Dec 21, 2022
6002549
bug(http-only cookie): test why it's not work on live server
Dec 21, 2022
61a715f
Merge pull request #92 from raselinfo/rasel
raselinfo Dec 21, 2022
3414e9c
bug(http-only cookie): test why it's not work on live server
Dec 21, 2022
a8ee5c7
feat(SSL): install ssl certificate on expess server
Dec 22, 2022
3db5b5a
Merge pull request #93 from raselinfo/rasel
raselinfo Dec 22, 2022
540b65f
bug(http-only cookie): test why it's not work on live server
Dec 22, 2022
ab27182
Merge pull request #94 from raselinfo/rasel
raselinfo Dec 22, 2022
7a53aba
Merge pull request #95 from raselinfo/rasel
raselinfo Dec 22, 2022
50f2623
bug(http-only cookie): test why it's not work on live server
Dec 22, 2022
e66cb11
Merge pull request #96 from raselinfo/rasel
raselinfo Dec 22, 2022
dc1de44
bug(http-only cookie): test why it's not work on live server
Dec 22, 2022
a52339a
bug(http-only cookie): test why it's not work on live server
Dec 22, 2022
73435a1
bug(http-only cookie): test why it's not work on live server
Dec 22, 2022
fe9efdb
bug(http-only cookie): test why it's not work on live server
Dec 22, 2022
7eb978e
bug(http-only cookie): test why it's not work on live server
Dec 22, 2022
7d41eee
bug(http-only cookie): test why it's not work on live server
Dec 22, 2022
3cfe520
bug(http-only cookie): test why it's not work on live server
Dec 22, 2022
1217716
bug(http-only cookie): test why it's not work on live server
Dec 22, 2022
f028915
bug(http-only cookie): test why it's not work on live server
Dec 22, 2022
aef0e1e
bug(http-only cookie): test why it's not work on live server
Dec 22, 2022
f8c6d5b
bug(http-only cookie): test why it's not work on live server
Dec 22, 2022
2187843
bug(http-only cookie): test why it's not work on live server
Dec 22, 2022
8ca1cbe
bug(http-only cookie): test why it's not work on live server
Dec 22, 2022
d9c1c1a
bug(http-only cookie): test why it's not work on live server
Dec 22, 2022
c1353b8
bug(http-only cookie): test why it's not work on live server
Dec 22, 2022
5b7e6c6
bug(http-only cookie): test why it's not work on live server
Dec 22, 2022
b24cb11
bug(http-only cookie): test why it's not work on live server
Dec 22, 2022
aa67cff
bug(http-only cookie): test why it's not work on live server
Dec 22, 2022
ab31853
bug(http-only cookie): test why it's not work on live server
Dec 22, 2022
68bb601
bug(http-only cookie): test why it's not work on live server
Dec 22, 2022
277c0c9
bug(http-only cookie): test why it's not work on live server
Dec 22, 2022
9cae4cd
bug(http-only cookie): test why it's not work on live server
Dec 22, 2022
42a4453
bug(http-only cookie): test why it's not work on live server
Dec 23, 2022
950b839
bug(http-only cookie): test why it's not work on live server
Dec 23, 2022
3fb0cc0
fix(http-only cookie): httpOnly cookie fix finally 🥰🥰
Dec 23, 2022
fbb98a8
fix(http-only cookie): fix google sigin cookie
Dec 23, 2022
9a1f942
fix(http-only cookie): fix google sigin cookie
Dec 23, 2022
71ee4c3
fix(http-only cookie): fix google sigin cookie
Dec 23, 2022
8eaab99
fix(http-only cookie): fix google sigin cookie
Dec 23, 2022
fc870cc
Merge pull request #97 from raselinfo/rasel
raselinfo Dec 23, 2022
30feae6
refector(index.js): refector test api
Dec 24, 2022
6ec7d11
bug(refreshTokenController.js): Fix refres token functionality
Dec 24, 2022
bd7380b
bug(authentication.middleware.js):Fix authentication middleware bug
Dec 24, 2022
c62c327
perf(signInService.js): reduce access token,refresh token and cookie …
Dec 24, 2022
25bfb2f
chore(UserService.js): make some document comment usign js-docs
Dec 24, 2022
9e8bef9
perf(generateTokenAndCookie.js): combina access,refresht token and se…
Dec 24, 2022
ae2c2cc
fix(setCookie.js): return true instend of promise
Dec 24, 2022
0017a81
refector(useAxios): remove comment
Dec 24, 2022
6664739
Merge pull request #98 from raselinfo/rasel
raselinfo Dec 24, 2022
1da406f
refector(index.js):remove test route
Dec 27, 2022
801109e
build(package.json): install vitest
Dec 27, 2022
1eb3134
feat(addShippingChargeController.js): add on property to save the db
Dec 27, 2022
cb46ed1
feat(getShippingChargeController):get item price
Dec 27, 2022
fc4e0f6
feat(setCouponTontroller.js):add coupon controller
Dec 27, 2022
ef60e34
feat(getCouponController.js):Get coupon by query and validate coupon …
Dec 27, 2022
a8a4113
feat(setStorUtilsController.js): Add stor utils like store name tax etc
Dec 27, 2022
b8b9ffc
feat(getStoreUtilsController.js): get stor utils from db
Dec 27, 2022
8cde725
fix(admin.middleware.js): add split and trim function for the headers…
Dec 27, 2022
078522d
fix(user.middleware.js): remove user middleware function
Dec 27, 2022
047bd55
feat(Coupon.js):Add Coupon model
Dec 27, 2022
ce058db
feat(Coupon.js):add on property in ShippinPrice Model
Dec 27, 2022
cf7507d
feat(StoreUtils.js):add store utils model
Dec 27, 2022
648e740
feat(couponRoutes.js):add coupon routes
Dec 27, 2022
8aee771
feat(storeUtilsRoutes.js):add storeUtilsRoutes
Dec 27, 2022
1093697
feat(addShippingChargeService.js):add on property
Dec 27, 2022
134128c
feat(getShippinChargeService.js):Improve shipping charge funtionality
Dec 27, 2022
a8c49f2
feat(getcouponService.js):add coupon service functionality
Dec 27, 2022
86d5425
feat(setCouponService.js):add setcoupon service functionality
Dec 27, 2022
ec6838c
feat(getStoreUtils):add get store Utils service functionality
Dec 27, 2022
4cfb5b2
feat(setStoreUtilsService.js):add set store Utils service functionality
Dec 27, 2022
dd1b5ba
feat(PlaceOrder.js):Add ShippingCharge and Tax functionality
Dec 27, 2022
3a1abc6
build(vitest):add vitest
Dec 27, 2022
a6cfd88
build(vitest):add vitest
Dec 27, 2022
b91d405
build(vitest):add vitest
Dec 27, 2022
5b90eca
build(vitest):add vitest
Dec 27, 2022
77bd97e
build(vitest):add vitest
Dec 27, 2022
eb6eb27
build(vitest):add vitest
Dec 27, 2022
d0824fe
build(vitest):add vitest
Dec 27, 2022
59ed16e
build(vitest):add vitest
Dec 27, 2022
215c858
build(vitest):add vitest
Dec 27, 2022
0284f4e
Merge pull request #99 from raselinfo/rasel
raselinfo Dec 28, 2022
6241094
Merge pull request #100 from raselinfo/rasel
raselinfo Dec 29, 2022
f6db69b
build(swagger-ui):add swagger ui
Dec 29, 2022
b23aee8
build(swagger-ui):add swagger ui
Dec 29, 2022
2a50c2d
feat(placeorder):calculate placeorder
Dec 30, 2022
5539352
feat(placeorder):calculate placeorder
Dec 31, 2022
1d7cdd8
feat(placeorder):calculate placeorder
Dec 31, 2022
1be88e4
feat(placeorder):calculate placeorder
Dec 31, 2022
b045f91
feat(api-doc): api doc for store utils
Dec 31, 2022
aea0f93
feat(api-doc): api doc for store utils
Dec 31, 2022
1e34d94
feat(api-doc): api doc for store utils
Dec 31, 2022
1e0e9f2
feat(api-doc): api doc for store utils
Dec 31, 2022
08f0fb3
feat(order routes): Create order routes
Dec 31, 2022
af94c23
feat(createOrderController.js): A controller for order create
Dec 31, 2022
35229e2
feat(getOrderController.js): A controller for get order by id
Dec 31, 2022
13a1b30
feat(authentication.middleware.js): pass user inside req.use
Dec 31, 2022
e71413e
feat(Order Model): model for order
Dec 31, 2022
2f82aae
feat(createOrderService): add create order related funtionality. and …
Dec 31, 2022
2510dc9
feat(getOrderService.js): create a service for get order details
Dec 31, 2022
f79fd6e
feat(App.js): add a private order route
Dec 31, 2022
4924f8a
feat(Order Page): create order page
Dec 31, 2022
3c780ec
feat(placeOrder.js): call ajax request for save the order in the data…
Dec 31, 2022
9d6ef1a
Merge pull request #101 from raselinfo/rasel
raselinfo Dec 31, 2022
ad5c610
feat(getOrderController.js): return order details by order id
Jan 2, 2023
4205671
refector(orderRoutes.js): remove white space and comment
Jan 2, 2023
b12b60a
feat(getOrderService): query order by order id
Jan 2, 2023
855ce61
build(react-lazy-load-image-component): add react image lazy loading …
Jan 2, 2023
77dee5a
chore(index.js): add react lazy image loading blur.css in root file
Jan 2, 2023
9e6dcef
feat(Product.js):add LazyLoadImage in Product file
Jan 2, 2023
228efcb
feat(ItemsSkeletor.js): add items skeletor
Jan 2, 2023
751f03d
feat(OrderSkeleton): add skeleton for order page
Jan 2, 2023
8a74074
chore(Store.js): add a case for remove cart items
Jan 2, 2023
69e6117
fix(formateError.js): remove p tag
Jan 2, 2023
35d3625
feat(Order.js): get order details from the backend and implement orde…
Jan 2, 2023
851af96
feat(PlaceOrder.js): Add helmet for place order tile and convert tota…
Jan 2, 2023
16400d8
fix(React Helmet): import helmet as name import
Jan 2, 2023
403b282
fix(Order.js): remove unwanted message box
Jan 2, 2023
5ad9c01
Merge pull request #102 from raselinfo/rasel
raselinfo Jan 2, 2023
1dbad6a
Merge pull request #103 from raselinfo/rasel
raselinfo Jan 5, 2023
53e0e64
fix(build file): fix build file
raselinfo Jan 5, 2023
0576bdf
feat(getOrderHistory): create getOrderHistory controller
Jan 7, 2023
9642284
chore(authentication.middlewar.js): call findUserByProperty usign key…
Jan 7, 2023
669989b
feat(orderRoutes.js): create a route for get all order history
Jan 7, 2023
4a920ac
chore(findUserByProperty): change key and value as object
Jan 7, 2023
79711cf
feat(getOrderHistoryService.js): create funtionality for get order hi…
Jan 7, 2023
99cdefc
chore(findUserByProperty): change key and value as object
Jan 7, 2023
6574aa8
feat(order): create order history route and page
Jan 7, 2023
747933e
formate(useAxios): add white space
Jan 7, 2023
d45a534
feat(useFetch Hook): creat a hook for call all ajax request
Jan 7, 2023
9400e1e
chore(protected routes): improve protected routes query
Jan 7, 2023
f157475
feat(OrderHistorySkeletor.js): Create a skeleton for order history page
Jan 7, 2023
e33a40f
Merge pull request #104 from raselinfo/rasel
raselinfo Jan 7, 2023
a956582
feat(OrderHisoryService.js): sort order documents by descending
Jan 7, 2023
d13e91f
feat(pagination): add pagination in backend as a service
Jan 8, 2023
18baaca
chore(Navbar.js): add order history link in the navbar
Jan 8, 2023
40ab726
feat(Paypal): style paypal button
Jan 8, 2023
79e9cc5
feat(OrderHistory.js): add pagination on
Jan 8, 2023
ccfbb35
chore(Signin.js): add page query
Jan 8, 2023
d2061c9
feat(testing): add test configuration
Jan 10, 2023
80dc0c6
feat(testing): add test configuration
Jan 10, 2023
11d9e98
feat(testing): add test configuration
Jan 10, 2023
f36f9b7
feat(testing): add test configuration
Jan 10, 2023
cf37999
feat(testing): add test configuration
Jan 10, 2023
315c883
feat(testing): add test configuration
Jan 10, 2023
53dd2ee
feat(testing): add test configuration
Jan 10, 2023
d551516
feat(testing): add test configuration
Jan 10, 2023
4854c67
feat(testing): add test configuration
Jan 11, 2023
65696d0
feat(testing): add test configuration
Jan 11, 2023
bccd23b
feat(testing): add test configuration
Jan 11, 2023
4b15126
feat(testing): add test configuration
Jan 11, 2023
2b8294c
feat(testing): add test configuration
Jan 11, 2023
74a1136
feat(testing): add test configuration
Jan 11, 2023
e12cee7
feat(testing): add test configuration
Jan 11, 2023
17fdd91
feat(testing): add test configuration
Jan 11, 2023
2058eb5
feat(testing): add test configuration
Jan 11, 2023
8632e36
feat(testing): add test configuration
Jan 11, 2023
3313a9b
feat(testing): add test configuration
Jan 11, 2023
3867fae
feat(testing): add test configuration
Jan 11, 2023
9a50335
feat(testing): add test configuration
Jan 11, 2023
e78b4ac
feat(testing): add test configuration
Jan 12, 2023
09c6cd6
feat(testing): add test configuration
Jan 12, 2023
11d6aa6
chore(updateProfileController.js): send respon message OK
Jan 13, 2023
0a3ece8
chore(signUpService): image uploadImage as name import
Jan 13, 2023
a56eb38
feat(updateProfileService.js): add image upload and delete previous i…
Jan 13, 2023
e907575
chore(imageHandler.js): export uploadImage and deleteImage function …
Jan 13, 2023
366be8c
chore(App.js): import necessary file with react lazy function and add…
Jan 13, 2023
423b64f
chore(Google.js): change user image save structure
Jan 13, 2023
bd5baf5
chore(Navbar.js): change logout toast message
Jan 13, 2023
687e8c3
refector(useFetch.js): refector useFetch hook
Jan 13, 2023
6793760
fix(Profile.js): fix image upload issue
Jan 13, 2023
9208960
chore(SignIn.js): handle ismount lifecycle
Jan 13, 2023
c9171cb
chore(SignUP.js): handle ismount lifecycle
Jan 13, 2023
b229e5f
test(Profile.test.js): get change button inside waitFor function
Jan 14, 2023
63e9669
test(profile.test.js): test profile routes
Jan 14, 2023
18b2055
test(profile.test.js): test profile routes
Jan 14, 2023
3ae1401
test(profile.test.js): test profile routes
Jan 14, 2023
aa2f384
test(profile.test.js): test profile routes
Jan 14, 2023
7bcc3ed
test(profile.test.js): test profile routes
Jan 14, 2023
897ad99
test(profile.test.js): test profile routes
Jan 14, 2023
f1616d5
build(nodemon,package.json): configure
Jan 17, 2023
df1a19d
test(categories.test.js): write test for categories route
Jan 17, 2023
4babed8
test(profile.test.js): change test file
Jan 17, 2023
bf2e3b8
refector(index.js):export app from index file
Jan 17, 2023
0214b33
feat(category):Add category functionality
Jan 17, 2023
2e41842
style(App.css,index.css):add css for search page
Jan 17, 2023
1ca0215
feat(search): create search bar and search page functionality
Jan 17, 2023
29a6fbe
feat(Sidebar): add sidebar in layout component
Jan 17, 2023
d61eb8a
feat(Navbar.js):add search bar
Jan 17, 2023
e52243f
chore(Rating.js): configure somthing for add caption
Jan 17, 2023
a92c5d5
refector(Product,Button,Profile): update these components
Jan 17, 2023
087d3f0
feat(router):review and search router use inside indexjs
Jan 24, 2023
70a427e
feat(saveReviewsController.js): controller for reviews router
Jan 24, 2023
cd5db92
feat(seearchController): controller for search router
Jan 24, 2023
3e26ded
feat(seedController.js): add avarage rating for every product
Jan 24, 2023
3453605
chore(data.js):add some filed for seed data
Jan 24, 2023
1c457c3
chore(Product.js): add avgRating in Product model
Jan 24, 2023
4c9a723
chore(Review.js): add user referance in Review Model
Jan 24, 2023
c4f4a64
feat(searchRoute.js): create searchRoutes
Jan 24, 2023
5cb9dbf
feat(searchRoute.js): create searchRoutes
Jan 24, 2023
f0cfe0f
refector(getOrderHistoryService):remove a log
Jan 24, 2023
8c1e6a4
chore(getProductByProperty):sort and populate reviews from the product
Jan 24, 2023
7640b4d
chore(saveReviewsService.js):add save review functionality in saveRei…
Jan 24, 2023
19abb9f
feat(searchService.js):add search functionality in search service
Jan 24, 2023
e7ca0a3
build(package.json):add react-rating-star-components in frontend
Jan 24, 2023
281f306
feat(CartItem.js):add flashmessage inside Crart item component
Jan 24, 2023
bee2563
refector(Product.js): remove a log from Product component
Jan 24, 2023
84080cd
chore(Rating.js): update Rating Component funtionality
Jan 24, 2023
1657d26
perf(SideBar.js): Only request for categories when the sidebar open
Jan 24, 2023
182c098
feat(Star.js): create a start rating component
Jan 24, 2023
ae215cf
chore(restore):restore useAxios,useCheckPdQuantity,useFetch hooks
Jan 24, 2023
929cc4e
refector(Checkout.js): remove comments
Jan 24, 2023
9ad58f6
refector(Home.js): remove double quotation
Jan 24, 2023
deb945a
refector(Oder.js,OrderHistory): remove logs
Jan 24, 2023
5ae2906
feat(ProductDetails.js): add flashMessage and update product state if…
Jan 24, 2023
269a4b4
feat(Search.js): add pagination for search page
Jan 24, 2023
c3e396f
refector(SigIn.js): remove refreshToken variable
Jan 24, 2023
d8db57c
fix(Hocks=> Hooks): rename Hocks forder to Hooks and update import st…
Jan 24, 2023
63601c8
fix(Hocks=> Hooks): rename Hocks forder to Hooks and update import st…
Jan 24, 2023
cac8034
fix(formateError.js): add optional chaing
Jan 24, 2023
18bff50
fix(formateError.js): add optional chaing
Jan 24, 2023
0c145af
feat(PayOrderService.js): reduce product stock when user complete his…
Jan 24, 2023
2c046bb
test(reviews.test.js): write test for reviews routes
Jan 24, 2023
45cb0dc
Merge pull request #105 from raselinfo/rasel
raselinfo Jan 24, 2023
3d66909
perf:(payOrderService.js): remove upadte product stock in async loop
Jan 25, 2023
5594626
Merge pull request #106 from raselinfo/rasel
raselinfo Jan 25, 2023
d9a8804
build(admin): build admin with vite starter project
Jan 25, 2023
9173a84
build(admin): build admin with vite starter project
Jan 25, 2023
3797662
Merge pull request #107 from raselinfo/rasel
raselinfo Jan 25, 2023
02f9c6f
Update README.md
raselinfo Apr 30, 2023
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
35 changes: 20 additions & 15 deletions .github/workflows/nodeCI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,21 @@ jobs:
runs-on: ubuntu-latest
needs: backend
steps:

- name: Checkout Codes
uses: actions/[email protected]
- name: Install Node Version
uses: actions/setup-node@v3
with:
node-version: 16
node-version: 18
- name: Install Frontend Dependance
run: |
cd frontend
yarn install --frozen-lockfile
- name: Run Test
run: |
cd frontend
yarn test
node -v
cd frontend
yarn install --frozen-lockfile
# run: |
# cd frontend
# yarn test
# node -v
# - name: Run Test

backend:
name: Backend Task
Expand All @@ -35,12 +34,18 @@ jobs:
- name: Install Node Version
uses: actions/setup-node@v3
with:
node-version: 16
node-version: 18
- name: Start MongoDb
uses: supercharge/[email protected]
with:
mongodb-version: 6.0
- name: Install Backend Dependance
run: |
cd backend
yarn install --frozen-lockfile
cd backend &&
yarn install --frozen-lockfile &&
ls
node -v


# - name: Run Backend Test
# run: |
# cd backend
# yarn test
# node -v
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Created by https://www.toptal.com/developers/gitignore/api/windows,react,node
# Edit at https://www.toptal.com/developers/gitignore?templates=windows,react,node
### Node ###
# build
# Logs
logs
*.log
Expand Down
3 changes: 0 additions & 3 deletions DB/.default.env

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

### Frontend

<a href="https://e-commerce-full-stack-one.vercel.app/" target="_blank">Preview</a>
<a href="https://raselofficial.me/" target="_blank">Preview</a>

### Backend

Expand Down
33 changes: 33 additions & 0 deletions admin/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
module.exports = {
env: {
browser: true,
es2021: true,
},
extends: [
'airbnb',
'airbnb/hooks',
'airbnb-typescript',
'plugin:react/recommended',
'plugin:@typescript-eslint/recommended',
],
overrides: [],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
tsconfigRootDir: __dirname,
project: './tsconfig.json',
},
plugins: ['react', '@typescript-eslint', 'prettier'],
rules: {
'react/react-in-jsx-scope': 'off',
'linebreak-style': 0,
'no-unused-vars': 'warn',
'no-console': 'off',
'func-names': 'off',
'no-process-exit': 'off',
'object-shorthand': 'off',
'class-methods-use-this': 'off',
'jsx-a11y/label-has-associated-control': 'off',
},
};
6 changes: 6 additions & 0 deletions admin/.prettierrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
trailingComma: 'es5',
tabWidth: 2,
semi: true,
singleQuote: true,
};
13 changes: 13 additions & 0 deletions admin/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!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>Vite + React + TS</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
42 changes: 42 additions & 0 deletions admin/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"name": "admin",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
"preview": "vite preview",
"test": "vitest"
},
"dependencies": {
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-router-dom": "^6.7.0"
},
"devDependencies": {
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^13.4.0",
"@types/react": "^18.0.26",
"@types/react-dom": "^18.0.9",
"@typescript-eslint/eslint-plugin": "^5.49.0",
"@typescript-eslint/parser": "^5.49.0",
"@vitejs/plugin-react": "^3.0.0",
"eslint": "^8.32.0",
"eslint-config-airbnb": "^19.0.4",
"eslint-config-airbnb-typescript": "^17.0.0",
"eslint-config-node": "^4.1.0",
"eslint-config-prettier": "^8.6.0",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-jsx-a11y": "^6.7.1",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-react": "^7.32.1",
"eslint-plugin-react-hooks": "^4.6.0",
"jsdom": "^21.1.0",
"prettier": "^2.8.3",
"typescript": "^4.9.3",
"vite": "^4.0.0",
"vitest": "^0.28.1"
}
}
1 change: 1 addition & 0 deletions admin/public/vite.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file added admin/src/App.css
Empty file.
8 changes: 8 additions & 0 deletions admin/src/App.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { useState } from 'react';
import reactLogo from './assets/react.svg';
import './App.css';

function App() {
return <h1>Hello World</h1>;
}
export default App;
1 change: 1 addition & 0 deletions admin/src/assets/react.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions admin/src/index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
* {
margin : 0;
padding : 0;
box-sizing: border-box;
outline : 0,

}

ul {
margin: 0,
padding:0,
}
11 changes: 11 additions & 0 deletions admin/src/main.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { RouterProvider } from 'react-router-dom';
import React from 'react';
import ReactDOM from 'react-dom/client';
import routes from './routes';
import './index.css';

ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render(
<React.StrictMode>
<RouterProvider router={routes} />
</React.StrictMode>,
);
23 changes: 23 additions & 0 deletions admin/src/routes/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { lazy } from 'react';
import { createBrowserRouter } from 'react-router-dom';

const App = lazy(() => import('../App'));
const NotFound = lazy(() => import('../views/NotFound/NotFound'));
export const routesConfig = [
{
path: '/',
element: <App />,
},
{
path: '/banana',
element: <h1>banana page</h1>,
},
{
path: '*',
element: <NotFound />,
},
];

const routes = createBrowserRouter(routesConfig);

export default routes;
7 changes: 7 additions & 0 deletions admin/src/setupTest.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/* eslint-disable import/no-extraneous-dependencies */
import { expect, afterEach } from 'vitest';
import { cleanup } from '@testing-library/react';
import matchers from '@testing-library/jest-dom/matchers';

expect.extend(matchers);
afterEach(() => cleanup());
16 changes: 16 additions & 0 deletions admin/src/test/App.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { describe, it } from 'vitest';

import { render, screen } from '@testing-library/react';
import App from '../App';

describe('App', () => {
it('Return Hello World', () => {
// Arrange
render(<App />);
// Act
// Expect
expect(screen.getByRole('heading', {
level: 1,
})).toHaveTextContent('Hello World');
});
});
9 changes: 9 additions & 0 deletions admin/src/views/NotFound/NotFound.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import React from 'react';

function NotFound() {
return (
<h1>Not Found Page</h1>
);
}

export default NotFound;
1 change: 1 addition & 0 deletions admin/src/vite-env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/// <reference types="vite/client" />
21 changes: 21 additions & 0 deletions admin/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"compilerOptions": {
"target": "ESNext",
"useDefineForClassFields": true,
"lib": ["DOM", "DOM.Iterable", "ESNext"],
"allowJs": true,
"skipLibCheck": true,
"esModuleInterop": false,
"allowSyntheticDefaultImports": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"module": "ESNext",
"moduleResolution": "Node",
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react-jsx",
},
"include": ["vite.config.ts",".eslintrc.cjs", "src"],
"references": [{ "path": "./tsconfig.node.json" }]
}
9 changes: 9 additions & 0 deletions admin/tsconfig.node.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"compilerOptions": {
"composite": true,
"module": "ESNext",
"moduleResolution": "Node",
"allowSyntheticDefaultImports": true
},
"include": ["vite.config.ts"]
}
16 changes: 16 additions & 0 deletions admin/vite.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/* eslint-disable import/no-extraneous-dependencies */
/// <reference types="vitest" />
/// <reference types="vite/client" />

import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';

// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
test: {
globals: true,
environment: 'jsdom',
setupFiles: ['./src/setupTest.ts'],
},
});
Loading