develop #5

Merged
behnam merged 6 commits from develop into main 2023-05-23 13:12:38 +00:00
18 changed files with 297 additions and 26 deletions
Showing only changes of commit b5203e6ac2 - Show all commits

View File

@ -7,4 +7,5 @@ VITE_API_CREATE_MEMBER = /user_place/members
VITE_API_PLACES = /place VITE_API_PLACES = /place
VITE_API_USERS = /profile VITE_API_USERS = /profile
VITE_API_USERS_ACCOUNT = /account VITE_API_USERS_ACCOUNT = /account
VITE_API_USERS_PROFILE = /profile VITE_API_USERS_PROFILE = /profile
VITE_API_QR = /qr_code

130
Readme.md Normal file
View File

@ -0,0 +1,130 @@
# Dipal admin panel
# Table of Contents
- [Dipal admin panel](#dipal-admin-panel)
- [Overview](#overview)
- [Technologies](#technologies)
- [Getting Started](#getting-started)
- [Development](#development)
- [Simple Start](#simple-start)
- [Start with Docker](#start-with-docker)
- [Production](#production)
- [Simple Build](#simple-build)
- [Build with Docker](#build-with-docker)
- [Todo List](#todo-list)
- [Naming Convetions](#naming-convetions)
## Overview
`Dipal admin panel` is a demo project for main admin panel of the dipal.
### Technologies
- language: [Typescript](https://www.typescriptlang.org/)
- framework: [React](https://reactjs.org/)
- api state management: [SWR](https://swr.vercel.app/)
- testing tools: [Jest](https://jestjs.io/) | [React Testing Library](https://testing-library.com/docs/react-testing-library/intro/)
- lintins: [ESlint](https://eslint.org/)
- module bundler: [Vite](https://vitejs.dev/)
- HTTP client: [Axios](https://axios-http.com/)
- css framework: [Tailwindcss](https://tailwindcss.com/)
## Getting Started
you can start this project in two ways: running simple, running with Docker
### Development
#### Simple Start
1. define your resource server OIDC's static data as environment variable in [.env.development](./.env.development). in this file you should define client id, client secret, realm and resource server base url
2.
```bash
yarn dev / npm run dev
```
#### Start with Docker
1. at first you should define four environment variable such as following variables in .env.development like following example:
- VITE_API_ORIGIN = https://admin.dev.dipal.ru/api/v1
- VITE_API_AUTH_ORIGIN = https://auth.dev.dipal.ru/api/v1/auth
- VITE_API_AUTH_PHONENUMBER = /start-challenge
- VITE_API_AUTH_LOGIN = /login
- VITE_API_AUTH_REFRESH = /refresh-token
- VITE_API_CREATE_MEMBER = /user_place/members
- VITE_API_PLACES = /place
- VITE_API_USERS = /profile
- VITE_API_USERS_ACCOUNT = /account
- VITE_API_USERS_PROFILE = /profile
- VITE_API_QR = /qr_code
for running with docker-compose, you can set these environment variable in [docker-compose](./docker-compose.yml) file and in the args.
2.
```bash
docker-compose -f docker-compose.yml up [-d] [--build] [--foce-recreate]
```
### Production
#### Simple Build
1. define your resource server OIDC's static data as environment variable in [.env.production](./.env.production). in this file you should define client id, client secret, realm and resource server base url
2.
```bash
yarn build
```
for running the built project in your local you can use following commands after building.
```bash
npm i -g serve
serve dist
```
#### Build with Docker
1. at first you should define four environment variable such as following variables in .env.production like following example:
- VITE_API_ORIGIN = https://admin.dev.dipal.ru/api/v1
- VITE_API_AUTH_ORIGIN = https://auth.dev.dipal.ru/api/v1/auth
- VITE_API_AUTH_PHONENUMBER = /start-challenge
- VITE_API_AUTH_LOGIN = /login
- VITE_API_AUTH_REFRESH = /refresh-token
- VITE_API_CREATE_MEMBER = /user_place/members
- VITE_API_PLACES = /place
- VITE_API_USERS = /profile
- VITE_API_USERS_ACCOUNT = /account
- VITE_API_USERS_PROFILE = /profile
- VITE_API_QR = /qr_code
for running with docker-compose, you can set these environment variable in [docker-compose](./docker-compose.prod.yml) file in the args.
2.
```bash
docker-compose -f docker-compose.prod.yml up [-d] [--build] [--foce-recreate]
```
## Todo List
- project follows the hexagonal architecture for this architecture some of the features didn't follow the architecture rules we should seperate the logic from the other layers
- make full documentation for describing the full documentation
- strategy for intercepting the requests should be refactored to follow more clean and more reusable way handle all of the access token and refresh tokens in the interceptors
- we can use other strategies for error handling on getting the places list and users lists for requesting the api
- handling pagination or lazy loading for the tables
- use stale strategies for the api statemanager
## naming convetions:
1. all **_folders_** follow the kebab-case convention for naming.
2. all **_files_** follow the camelCase convention for naming.
3. all **_variables_** and **_functions_** follow the camelCase convention for naming.

7
dist/assets/icons/createuser.svg vendored Normal file
View File

@ -0,0 +1,7 @@
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M14 2H6C5.46957 2 4.96086 2.21071 4.58579 2.58579C4.21071 2.96086 4 3.46957 4 4V20C4 20.5304 4.21071 21.0391 4.58579 21.4142C4.96086 21.7893 5.46957 22 6 22H18C18.5304 22 19.0391 21.7893 19.4142 21.4142C19.7893 21.0391 20 20.5304 20 20V8L14 2Z" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M14 2V8H20" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M16 13H8" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M16 17H8" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M10 9H9H8" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
</svg>

After

Width:  |  Height:  |  Size: 841 B

15
dist/assets/icons/logo-black.svg vendored Normal file
View File

@ -0,0 +1,15 @@
<svg width="198" height="48" viewBox="0 0 198 48" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M29.2175 33.8487H23.577C21.0802 33.8442 18.6869 32.8468 16.9213 31.075C15.1558 29.3032 14.162 26.9014 14.1575 24.3957V18.7353L13.255 17.8296C12.5503 17.1065 11.7076 16.5333 10.7773 16.1443C9.84695 15.7553 8.84804 15.5584 7.84021 15.5654C6.83237 15.5584 5.83346 15.7553 4.90313 16.1443C3.97279 16.5333 3.13011 17.1065 2.42539 17.8296L2.25617 17.9428C1.54128 18.6542 0.973841 19.5007 0.586605 20.4334C0.199369 21.3661 0 22.3664 0 23.3768C0 24.3872 0.199369 25.3876 0.586605 26.3203C0.973841 27.2529 1.54128 28.0994 2.25617 28.8109L19.1211 45.7356C20.5661 47.1651 22.507 47.9767 24.5359 47.9998C25.5437 48.0068 26.5426 47.8099 27.473 47.4209C28.4033 47.0319 29.246 46.4587 29.9507 45.7356L30.0635 45.6224C31.4998 44.1699 32.3058 42.2065 32.3058 40.1601C32.3058 38.1137 31.4998 36.1503 30.0635 34.6977L29.2175 33.8487Z" fill="#9E00C5"/>
<path d="M40.2726 16.528H33.1657V24.396C33.1584 25.9067 32.7911 27.3938 32.0944 28.733C31.3978 30.0722 30.3919 31.2247 29.1609 32.0943H40.329C42.363 32.0928 44.3133 31.2812 45.7516 29.8378C47.1898 28.3945 47.9985 26.4373 48 24.396V24.2262C47.9749 22.1826 47.1509 20.2306 45.7056 18.7907C44.2602 17.3508 42.3092 16.5382 40.2726 16.528Z" fill="#9E00C5"/>
<path d="M18.162 18.7924C17.4415 19.4996 16.8704 20.3453 16.4827 21.2789C16.0951 22.2125 15.8989 23.215 15.9058 24.2264V24.3962C15.9073 26.4374 16.716 28.3947 18.1543 29.838C19.5925 31.2814 21.5428 32.0929 23.5768 32.0944H23.746C25.7801 32.0929 27.7303 31.2814 29.1686 29.838C30.6069 28.3947 31.4156 26.4374 31.417 24.3962V16.5282H23.5768C22.569 16.5212 21.5701 16.7181 20.6398 17.1071C19.7094 17.4961 18.8667 18.0693 18.162 18.7924Z" fill="#9E00C5"/>
<path d="M16.9778 17.604C18.7246 15.8387 21.0981 14.8412 23.5771 14.8304H31.4173V7.69822C31.4158 5.65699 30.6072 3.69978 29.1689 2.25641C27.7306 0.813041 25.7804 0.00149926 23.7463 0H23.5771C21.5431 0.00149926 19.5928 0.813041 18.1546 2.25641C16.7163 3.69978 15.9076 5.65699 15.9061 7.69822V18.9059C16.2004 18.4234 16.5612 17.9851 16.9778 17.604Z" fill="#9E00C5"/>
<path d="M55 16.7575H57.7267V31.1991H55V16.7575ZM65.3874 31.1991L59.3281 25.6811C59.0732 25.429 58.8757 25.1254 58.7488 24.7907C58.6218 24.456 58.5685 24.0981 58.5923 23.7412C58.6196 23.1431 58.8659 22.5756 59.2848 22.1461L64.7815 16.7144H68.2006L61.9249 22.6635C61.5787 23.0083 61.2324 23.2239 61.2324 23.7412C61.2324 24.3447 61.6652 24.7327 62.0981 25.0776L68.9797 31.1991H65.3874Z" fill="black"/>
<path d="M83.3027 24C83.3027 29.8629 81.2685 31.4148 75.8584 31.4148C70.4483 31.4148 68.4141 29.8629 68.4141 24C68.4141 18.1371 70.4915 16.5852 75.8584 16.5852C81.2252 16.5852 83.3027 18.1371 83.3027 24ZM75.8584 29.2163C79.4074 29.2163 80.4894 28.1385 80.4894 24C80.4894 19.8615 79.4074 18.7838 75.8584 18.7838C72.3093 18.7838 71.2273 19.8615 71.2273 24C71.2273 28.1385 72.2661 29.2163 75.8584 29.2163Z" fill="black"/>
<path d="M96.2439 29.6474C95.8111 30.7682 95.4216 31.3717 94.1665 31.3717C92.9113 31.3717 92.5218 30.7682 92.089 29.6474L88.4101 19.9908C88.3668 19.8184 88.1937 19.5166 88.0639 19.5166C87.8475 19.5166 87.8475 19.9046 87.8475 19.9477L87.8908 31.1993H85.1641V18.482C85.1641 17.1456 86.073 16.5852 87.5012 16.5852C89.1459 16.5852 89.6653 17.4474 90.0548 18.4389L93.8202 28.0954C93.9501 28.3972 94.0799 28.6127 94.2097 28.6127C94.3396 28.6127 94.4694 28.3972 94.5993 28.0954L98.3647 18.4389C98.7542 17.4474 99.2736 16.5852 100.918 16.5852C102.39 16.5852 103.255 17.1456 103.255 18.482V31.1993H100.529L100.615 19.9477C100.615 19.5598 100.442 19.5166 100.356 19.5166C100.269 19.5166 100.053 19.8184 100.009 19.9908L96.2439 29.6474Z" fill="black"/>
<path d="M115.163 16.7578V17.9218H117.63C121.785 17.9218 122.607 20.1203 122.607 23.8278C122.607 27.5352 121.742 29.7768 117.63 29.7768H115.163V31.1995H112.436V29.7768H109.969C105.815 29.7768 104.992 27.5352 104.992 23.8278C104.992 20.1203 105.815 17.9218 109.969 17.9218H112.436V16.7578H115.163ZM112.436 20.1203H110.792C108.282 20.1203 107.805 21.155 107.805 23.8709C107.805 26.5868 108.282 27.7076 110.792 27.7076H112.436V20.1203ZM116.808 27.6645C119.318 27.6645 119.794 26.5436 119.794 23.8278C119.794 21.1119 119.318 20.0772 116.808 20.0772H115.163V27.6214L116.808 27.6645Z" fill="black"/>
<path d="M138.967 24C138.967 29.8629 136.933 31.4148 131.522 31.4148C126.112 31.4148 124.078 29.8629 124.078 24C124.078 18.1371 126.156 16.5852 131.522 16.5852C136.889 16.5852 138.967 18.1371 138.967 24ZM131.522 29.2163C135.071 29.2163 136.153 28.1385 136.153 24C136.153 19.8615 135.071 18.7838 131.522 18.7838C127.973 18.7838 126.891 19.8615 126.891 24C126.891 28.1385 127.93 29.2163 131.522 29.2163Z" fill="black"/>
<path d="M140.781 18.9133C140.781 17.2751 141.647 16.7578 142.902 16.7578H150.13C153.246 16.7578 153.809 18.9133 153.809 21.4136C153.809 23.914 153.246 26.1126 150.13 26.1126H143.551V31.1995H140.825V18.9133H140.781ZM148.745 23.914C150.606 23.914 150.952 23.0518 150.952 21.4136C150.952 19.7755 150.606 18.9564 148.745 18.9564H144.547C143.724 18.9564 143.508 19.1719 143.508 19.991V23.9571H148.745V23.914Z" fill="black"/>
<path d="M160.256 31.1995V18.9133H154.586V16.7578H168.652V18.9133H162.982V31.1995H160.256Z" fill="black"/>
<path d="M181.557 31.1995H172.035C170.78 31.1995 169.914 30.6821 169.914 29.044V18.9133C169.914 17.2751 170.78 16.7578 172.035 16.7578H181.47V18.9133H173.679C172.857 18.9133 172.641 19.1288 172.641 19.9479V22.75H181.254V24.9055H172.641V28.0094C172.641 28.8284 172.857 29.044 173.679 29.044H181.557V31.1995Z" fill="black"/>
<path d="M187.958 17.9647C188.218 17.3181 188.651 16.5852 190.166 16.5852C191.68 16.5852 192.113 17.275 192.373 17.9647L197.999 31.1993H195.1L190.512 19.646C190.469 19.4735 190.425 19.2149 190.166 19.2149C189.906 19.2149 189.863 19.4735 189.819 19.646L185.275 31.1993H182.375L187.958 17.9647Z" fill="black"/>
</svg>

After

Width:  |  Height:  |  Size: 5.7 KiB

15
dist/assets/icons/logo.svg vendored Normal file
View File

@ -0,0 +1,15 @@
<svg width="136" height="40" viewBox="0 0 136 40" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M19.4783 26.5658H15.718C14.0535 26.5628 12.4579 25.8979 11.2809 24.7167C10.1039 23.5355 9.44131 21.9343 9.43833 20.2638V16.4902L8.83668 15.8864C8.36687 15.4043 7.80508 15.0222 7.18486 14.7629C6.56463 14.5035 5.8987 14.3723 5.2268 14.3769C4.55491 14.3723 3.88897 14.5035 3.26875 14.7629C2.64853 15.0222 2.08674 15.4043 1.61692 15.8864L1.50412 15.9619C1.02752 16.4362 0.649227 17.0005 0.39107 17.6223C0.132913 18.244 0 18.911 0 19.5846C0 20.2581 0.132913 20.9251 0.39107 21.5468C0.649227 22.1686 1.02752 22.7329 1.50412 23.2072L12.7474 34.4904C13.7107 35.4434 15.0047 35.9845 16.3573 35.9999C17.0292 36.0045 17.6951 35.8733 18.3153 35.6139C18.9355 35.3546 19.4973 34.9725 19.9671 34.4904L20.0423 34.415C20.9999 33.4466 21.5372 32.1376 21.5372 30.7734C21.5372 29.4091 20.9999 28.1002 20.0423 27.1318L19.4783 26.5658Z" fill="#D700FE"/>
<path d="M26.8484 15.0187H22.1104V20.264C22.1056 21.2712 21.8607 22.2625 21.3963 23.1553C20.9318 24.0481 20.2613 24.8165 19.4406 25.3962H26.886C28.242 25.3952 29.5422 24.8541 30.501 23.8919C31.4599 22.9296 31.999 21.6248 32 20.264V20.1508C31.9833 18.7884 31.4339 17.4871 30.4704 16.5271C29.5068 15.5672 28.2061 15.0255 26.8484 15.0187Z" fill="#D700FE"/>
<path d="M12.108 16.5282C11.6277 16.9997 11.2469 17.5635 10.9885 18.1859C10.7301 18.8084 10.5993 19.4767 10.6039 20.1509V20.2641C10.6049 21.625 11.144 22.9298 12.1029 23.892C13.0617 24.8543 14.3619 25.3953 15.7179 25.3963H15.8307C17.1867 25.3953 18.4869 24.8543 19.4457 23.892C20.4046 22.9298 20.9437 21.625 20.9447 20.2641V15.0188H15.7179C15.046 15.0141 14.3801 15.1454 13.7598 15.4047C13.1396 15.6641 12.5778 16.0462 12.108 16.5282Z" fill="#D700FE"/>
<path d="M11.3186 15.736C12.4831 14.5591 14.0654 13.8941 15.7181 13.8869H20.9449V9.13215C20.9439 7.77132 20.4048 6.46652 19.4459 5.50428C18.4871 4.54203 17.1869 4.001 15.8309 4H15.7181C14.3621 4.001 13.0619 4.54203 12.103 5.50428C11.1442 6.46652 10.6051 7.77132 10.6041 9.13215V16.604C10.8002 16.2823 11.0408 15.99 11.3186 15.736Z" fill="#D700FE"/>
<path d="M39 15.116H40.8387V24.8544H39V15.116ZM46.0045 24.8544L41.9185 21.1334C41.7467 20.9634 41.6135 20.7587 41.5279 20.533C41.4423 20.3073 41.4063 20.066 41.4224 19.8253C41.4408 19.422 41.6069 19.0393 41.8894 18.7497L45.5959 15.0869H47.9015L43.6697 19.0985C43.4362 19.3311 43.2027 19.4764 43.2027 19.8253C43.2027 20.2323 43.4945 20.4939 43.7864 20.7264L48.4269 24.8544H46.0045Z" fill="white"/>
<path d="M58.0866 20C58.0866 23.9535 56.7149 25 53.0668 25C49.4186 25 48.0469 23.9535 48.0469 20C48.0469 16.0465 49.4478 15 53.0668 15C56.6857 15 58.0866 16.0465 58.0866 20ZM53.0668 23.5174C55.46 23.5174 56.1896 22.7907 56.1896 20C56.1896 17.2093 55.46 16.4826 53.0668 16.4826C50.6736 16.4826 49.9439 17.2093 49.9439 20C49.9439 22.7907 50.6444 23.5174 53.0668 23.5174Z" fill="white"/>
<path d="M66.8132 23.8081C66.5214 24.564 66.2587 24.9709 65.4124 24.9709C64.566 24.9709 64.3033 24.564 64.0115 23.8081L61.5307 17.2965C61.5015 17.1802 61.3848 16.9767 61.2972 16.9767C61.1513 16.9767 61.1513 17.2384 61.1513 17.2674L61.1805 24.8547H59.3418V16.2791C59.3418 15.3779 59.9547 15 60.9178 15C62.0268 15 62.3771 15.5814 62.6397 16.25L65.1789 22.7616C65.2664 22.9651 65.354 23.1105 65.4415 23.1105C65.5291 23.1105 65.6167 22.9651 65.7042 22.7616L68.2433 16.25C68.506 15.5814 68.8562 15 69.9653 15C70.9576 15 71.5413 15.3779 71.5413 16.2791V24.8547H69.7026L69.761 17.2674C69.761 17.0058 69.6442 16.9767 69.5859 16.9767C69.5275 16.9767 69.3816 17.1802 69.3524 17.2965L66.8132 23.8081Z" fill="white"/>
<path d="M79.5675 15.1162V15.9011H81.2311C84.0329 15.9011 84.5874 17.3837 84.5874 19.8837C84.5874 22.3837 84.0037 23.8953 81.2311 23.8953H79.5675V24.8546H77.7289V23.8953H76.0653C73.2635 23.8953 72.709 22.3837 72.709 19.8837C72.709 17.3837 73.2635 15.9011 76.0653 15.9011H77.7289V15.1162H79.5675ZM77.7289 17.3837H76.6198C74.9271 17.3837 74.606 18.0813 74.606 19.9127C74.606 21.7441 74.9271 22.4999 76.6198 22.4999H77.7289V17.3837ZM80.6766 22.4709C82.3693 22.4709 82.6904 21.715 82.6904 19.8837C82.6904 18.0523 82.3693 17.3546 80.6766 17.3546H79.5675V22.4418L80.6766 22.4709Z" fill="white"/>
<path d="M95.6198 20C95.6198 23.9535 94.2481 25 90.6 25C86.9518 25 85.5801 23.9535 85.5801 20C85.5801 16.0465 86.981 15 90.6 15C94.2189 15 95.6198 16.0465 95.6198 20ZM90.6 23.5174C92.9932 23.5174 93.7228 22.7907 93.7228 20C93.7228 17.2093 92.9932 16.4826 90.6 16.4826C88.2068 16.4826 87.4771 17.2093 87.4771 20C87.4771 22.7907 88.1776 23.5174 90.6 23.5174Z" fill="white"/>
<path d="M96.8457 16.5697C96.8457 15.465 97.4294 15.1162 98.2758 15.1162H103.15C105.251 15.1162 105.63 16.5697 105.63 18.2557C105.63 19.9418 105.251 21.4244 103.15 21.4244H98.7136V24.8546H96.8749V16.5697H96.8457ZM102.216 19.9418C103.471 19.9418 103.704 19.3604 103.704 18.2557C103.704 17.1511 103.471 16.5988 102.216 16.5988H99.3848C98.8303 16.5988 98.6844 16.7441 98.6844 17.2964V19.9709H102.216V19.9418Z" fill="white"/>
<path d="M109.98 24.8546V16.5697H106.156V15.1162H115.641V16.5697H111.818V24.8546H109.98Z" fill="white"/>
<path d="M124.337 24.8546H117.916C117.07 24.8546 116.486 24.5057 116.486 23.4011V16.5697C116.486 15.465 117.07 15.1162 117.916 15.1162H124.279V16.5697H119.025C118.471 16.5697 118.325 16.715 118.325 17.2674V19.1569H124.133V20.6104H118.325V22.7034C118.325 23.2557 118.471 23.4011 119.025 23.4011H124.337V24.8546Z" fill="white"/>
<path d="M128.657 15.9302C128.833 15.4942 129.124 15 130.146 15C131.167 15 131.459 15.4651 131.634 15.9302L135.428 24.8547H133.473L130.379 17.064C130.35 16.9477 130.321 16.7733 130.146 16.7733C129.971 16.7733 129.942 16.9477 129.912 17.064L126.848 24.8547H124.893L128.657 15.9302Z" fill="white"/>
</svg>

After

Width:  |  Height:  |  Size: 5.6 KiB

BIN
dist/assets/icons/qrcode.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

6
dist/assets/icons/users.svg vendored Normal file
View File

@ -0,0 +1,6 @@
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M17 21V19C17 17.9391 16.5786 16.9217 15.8284 16.1716C15.0783 15.4214 14.0609 15 13 15H5C3.93913 15 2.92172 15.4214 2.17157 16.1716C1.42143 16.9217 1 17.9391 1 19V21" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M9 11C11.2091 11 13 9.20914 13 7C13 4.79086 11.2091 3 9 3C6.79086 3 5 4.79086 5 7C5 9.20914 6.79086 11 9 11Z" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M23 20.9999V18.9999C22.9993 18.1136 22.7044 17.2527 22.1614 16.5522C21.6184 15.8517 20.8581 15.3515 20 15.1299" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M16 3.12988C16.8604 3.35018 17.623 3.85058 18.1676 4.55219C18.7122 5.2538 19.0078 6.11671 19.0078 7.00488C19.0078 7.89305 18.7122 8.75596 18.1676 9.45757C17.623 10.1592 16.8604 10.6596 16 10.8799" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
</svg>

After

Width:  |  Height:  |  Size: 1.0 KiB

1
dist/assets/index-32cf486f.css vendored Normal file

File diff suppressed because one or more lines are too long

85
dist/assets/index-43ad9ab6.js vendored Normal file

File diff suppressed because one or more lines are too long

15
dist/index.html vendored Normal file
View File

@ -0,0 +1,15 @@
<!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>
<script type="module" crossorigin src="/assets/index-43ad9ab6.js"></script>
<link rel="stylesheet" href="/assets/index-32cf486f.css">
</head>
<body>
<div id="root"></div>
</body>
</html>

1
dist/vite.svg vendored Normal file
View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@ -3,17 +3,7 @@ services:
dipal-admin: dipal-admin:
ports: ports:
- 8000:80 - 8000:80
environment: env_file: .env.production
- VITE_API_ORIGIN=https://admin.dev.dipal.ru/api/v1
- VITE_API_AUTH_ORIGIN=https://auth.dev.dipal.ru/api/v1/auth
- VITE_API_AUTH_PHONENUMBER=/start-challenge
- VITE_API_AUTH_LOGIN=/login
- VITE_API_AUTH_REFRESH=/refresh-token
- VITE_API_CREATE_MEMBER=/user_place/members
- VITE_API_PLACES=/place
- VITE_API_USERS=/profile
- VITE_API_USERS_ACCOUNT=/account
- VITE_API_USERS_PROFILE=/profile
build: build:
context: . context: .
dockerfile: dockerfile.prod dockerfile: dockerfile.prod

View File

@ -4,6 +4,7 @@ services:
dipal-panel: dipal-panel:
ports: ports:
- 5173:5173 - 5173:5173
env_file: .env.development
build: build:
context: ./ context: ./
dockerfile: Dockerfile dockerfile: Dockerfile

View File

@ -1,4 +1,4 @@
import Places from '../../../common/entity/placeEntity'; import { QrPlace } from '../../../common/entity/placeEntity';
export type GetPlacesResponse = { export type GetPlacesResponse = {
_id: string; _id: string;
@ -10,9 +10,13 @@ export type GetPlacesResponse = {
available_services: string[]; available_services: string[];
}[]; }[];
export type GetPlacesRO = Places[] & export type GetPlacesRO = {
{ availableServices: string[];
availableServices: string[]; createdAt: string;
createdAt: string; updatedAt: string;
updatedAt: string; placeType: string;
}[]; name: string;
qr: null | QrPlace;
id: string;
parentId: string | null;
}[];

View File

@ -5,7 +5,7 @@ import GettingPlacesUsecase from '../getPlaceUsecase';
const mockedRO: GetPlacesRO = [ const mockedRO: GetPlacesRO = [
{ {
availableServices: [''], availableServices: ['test'],
createdAt: 'createdAt', createdAt: 'createdAt',
id: 'id', id: 'id',
name: 'name', name: 'name',

View File

@ -1,4 +1,4 @@
import { INewUserData } from '../dto/protocols'; import { CreateAccountDTOReturnType } from '../dto/protocols';
import { CreateAcountResponseApi } from '../response-object/protocols'; import { CreateAcountResponseApi } from '../response-object/protocols';
export type HttpHandler = (newUser: INewUserData) => Promise<CreateAcountResponseApi>; export type HttpHandler = (newUser: CreateAccountDTOReturnType) => Promise<CreateAcountResponseApi>;

View File

@ -1,9 +1,9 @@
import IGetUsersRepo from '../data/repository/IGetUserRepo'; import IGetUsersRepo from '../data/repository/IGetUserRepo';
import getUsersRepo from '../data/repository/getUserRepo'; import getUsersRepo from '../data/repository/getUserRepo';
import GettingUsersUsecase from '../usecase/getUsersUsecase'; import GettingUsersUsecase from '../usecase/getUsersUsecase';
import { IgetusersInfra, getusersReturnType } from './protocols'; import { IgetUsersInfra, getUsersReturnType } from './protocols';
const getUsers = ({ httpHandler }: IgetusersInfra): getusersReturnType => { const getUsers = ({ httpHandler }: IgetUsersInfra): getUsersReturnType => {
// get httpHandler // get httpHandler
const repository: IGetUsersRepo = () => getUsersRepo(httpHandler); const repository: IGetUsersRepo = () => getUsersRepo(httpHandler);
// connet usecase and repository // connet usecase and repository

View File

@ -1,4 +1,4 @@
import { INewUserData } from '~/business-logic/core/users/create-user/create-account/data/dto/protocols'; import { CreateAccountDTOReturnType } from '~/business-logic/core/users/create-user/create-account/data/dto/protocols';
import { CreateAcountResponseApi } from '~/business-logic/core/users/create-user/create-account/data/response-object/protocols'; import { CreateAcountResponseApi } from '~/business-logic/core/users/create-user/create-account/data/response-object/protocols';
import createUserPort from '~/business-logic/core/users/create-user/ports'; import createUserPort from '~/business-logic/core/users/create-user/ports';
import AdminUserModel from '~/business-logic/generic/admin-user/common/data/model/adminUserModel'; import AdminUserModel from '~/business-logic/generic/admin-user/common/data/model/adminUserModel';
@ -23,7 +23,7 @@ const createAccountAdapter = (
navigateToAuth, navigateToAuth,
); );
const httpHandler = (newUserData: INewUserData) => { const httpHandler = (newUserData: CreateAccountDTOReturnType) => {
// api options // api options
const httpOptions: HttpOptionsType = { const httpOptions: HttpOptionsType = {
url, url,