- Сертификаты
-
- CertificateLandingPage - Страница сертификата, которой делятся между собой пользователи
-
- CertificatesSelector - селектор сертификатов на странице бронирований
If you have just cloned this template, you should install the project dependencies using the command:
npm installInstall mkcert for making locally-trusted development certificates. After install one should to create certificates for dt-mini-app.local domain
mkdir -p .cert && mkcert -key-file ./.cert/localhost-key.pem -cert-file ./.cert/localhost.pem 'dt-mini-app.local'
Now in /etc/hosts
sudo nano /etc/hosts
Add line in the end of the file
127.0.0.1 dt-mini-app.local
This project contains the following scripts:
dev. Runs the application in development mode.dev:https. Runs the application in development mode using locally created valid SSL-certificates.build. Builds the application for production.lint. Runs eslint to ensure the code quality meets the required standards.deploy. Deploys the application to GitHub Pages.
To run a script, use the npm run command:
npm run {script}
# Example: npm run buildTo run the application in the development mode, use the dev script:
npm run dev:httpsВ настройках телеграм бота необходимо передать ссылку https://[ip сервера]:8090
Для работы приложения на сторонних устройствах (iOS, Android) необходимо установить корневой сертификат выпущенный vite-plugin-mkcert (C:\Users\user.vite-plugin-mkcert\rootCA.pem)
Note
As long as we use vite-plugin-mkcert,
launching the dev mode for the first time, you may see sudo password request.
The plugin requires it to properly configure SSL-certificates. To disable the plugin, use the npm run dev command.
В src/api/base.ts необходимо изменить адрес прод и дев сервера бэкэнда
Before deploying the application, make sure that you've built it and going to deploy the fresh static files:
npm run buildserver {
listen 443 ssl;
server_name tgapp.dreamteam.fm;
ssl_certificate /etc/letsencrypt/live/tgapp.dreamteam.fm/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/tgapp.dreamteam.fm/privkey.pem;
root /var/www/dist;
index index.html ;
location / {
try_files $uri $uri/ /index.html =404;
}
}