ConceptPortal-public/README.md

162 lines
4.2 KiB
Markdown
Raw Normal View History

2024-04-07 21:05:01 +03:00
<div align="center">
2024-04-07 21:09:13 +03:00
<a href="https://portal.acconcept.ru/" target="_blank">
2024-04-07 21:05:01 +03:00
<img width="650" src="rsconcept/frontend/public/logo_full.svg" />
</a>
</div>
<br />
<br />
2023-12-30 14:46:43 +03:00
2024-04-20 18:36:46 +03:00
[![Backend CI](https://github.com/IRBorisov/ConceptPortal/actions/workflows/backend.yml/badge.svg?branch=main)](https://github.com/IRBorisov/ConceptPortal/actions/workflows/backend.yml)
[![Frontend CI](https://github.com/IRBorisov/ConceptPortal/actions/workflows/frontend.yml/badge.svg?branch=main)](https://github.com/IRBorisov/ConceptPortal/actions/workflows/frontend.yml)
2023-07-27 11:24:25 +03:00
React + Django based web portal for editing RSForm schemas.
This readme file is used mostly to document project dependencies
2023-07-15 17:55:28 +03:00
2024-04-07 21:10:32 +03:00
## ❤️ Contributing notes
2023-12-30 14:46:43 +03:00
!BEFORE PUSHING INTO MAIN!
2023-12-30 14:46:43 +03:00
- use Test config in VSCode to run tests before pushing commits / requests
- cd rsconcept/frontend & npm run build
2024-04-07 21:10:32 +03:00
## ✨ Frontend [Vite + React + Typescript]
2023-12-30 14:46:43 +03:00
2023-07-27 11:24:25 +03:00
<details>
2023-12-30 20:10:19 +03:00
<summary>npm install</summary>
2023-07-27 11:24:25 +03:00
<pre>
- axios
- clsx
2023-12-16 19:20:26 +03:00
- react-icons
2023-07-27 11:24:25 +03:00
- react-router-dom
- react-toastify
- react-loader-spinner
- react-tabs
- react-intl
- react-select
2023-07-27 11:24:25 +03:00
- react-error-boundary
2023-12-07 23:08:49 +03:00
- react-pdf
- react-tooltip
- js-file-download
2024-04-10 15:54:47 +03:00
- use-debounce
- framer-motion
- reagraph
- @tanstack/react-table
- @uiw/react-codemirror
- @uiw/codemirror-themes
2023-08-12 20:52:11 +03:00
- @lezer/lr
2023-07-27 11:24:25 +03:00
</pre>
</details>
<details>
2023-12-30 20:10:19 +03:00
<summary>npm install -D</summary>
2023-07-27 11:24:25 +03:00
<pre>
2023-12-30 14:46:43 +03:00
- tailwindcss
- postcss
- autoprefixer
2023-07-27 11:24:25 +03:00
- eslint-plugin-simple-import-sort
2023-09-21 14:58:01 +03:00
- eslint-plugin-tsdoc
2023-08-01 23:43:43 +03:00
- jest
- ts-jest
- @types/jest
2023-08-12 20:52:11 +03:00
- @lezer/generator
2023-07-27 11:24:25 +03:00
</pre>
</details>
<details>
2023-12-30 20:11:54 +03:00
<summary>VS Code plugins</summary>
2023-07-27 11:24:25 +03:00
<pre>
- ESLint
2023-08-27 00:19:19 +03:00
- Colorize
2023-12-26 14:23:51 +03:00
- Code Spell Checker (eng + rus)
- Backticks
2023-12-27 16:45:18 +03:00
- Svg Preview
- TODO Highlight v2
2023-07-27 11:24:25 +03:00
</pre>
</details>
2023-12-30 20:11:54 +03:00
<details>
<summary>Google fonts</summary>
<pre>
2024-04-03 21:08:45 +03:00
- Fira Code
2023-12-30 20:11:54 +03:00
- Rubik
- Geologica
- Noto Sans Math
</pre>
</details>
2023-07-15 18:00:20 +03:00
2024-04-07 21:10:32 +03:00
## ✨ Backend [Django + PostgreSQL/SQLite]
2023-12-30 14:46:43 +03:00
2023-07-27 11:24:25 +03:00
- [ConceptCore](https://github.com/IRBorisov/ConceptCore)
<details>
2023-12-30 20:10:19 +03:00
<summary>requirements</summary>
2023-07-27 11:24:25 +03:00
<pre>
- django
- djangorestframework
- django-cors-headers
- django-filter
2023-09-21 23:09:51 +03:00
- drf-spectacular
- tzdata
2023-07-27 11:24:25 +03:00
- gunicorn
- coreapi
- psycopg2-binary
- cctext
2024-04-17 23:08:40 +03:00
- pyconcept
2023-07-27 11:24:25 +03:00
</pre>
</details>
<details>
2024-04-17 23:08:40 +03:00
<summary>requirements-dev</summary>
2023-07-27 11:24:25 +03:00
<pre>
- coverage
2023-08-17 21:23:54 +03:00
- pylint
- mypy
- djangorestframework-stubs[compatible-mypy]
2023-07-27 11:24:25 +03:00
</pre>
</details>
<details>
2023-12-30 20:10:19 +03:00
<summary>VS Code plugins</summary>
2023-07-27 11:24:25 +03:00
<pre>
- Pylance
- Pylint
- Django
2023-07-27 11:24:25 +03:00
</pre>
</details>
2023-07-15 17:55:28 +03:00
2024-04-07 21:10:32 +03:00
## ✨ DevOps
2023-12-30 14:46:43 +03:00
2023-07-27 11:24:25 +03:00
- Docker compose
- PowerShell
- Certbot
- Docker VSCode extension
# Developer Notes
2023-12-30 14:46:43 +03:00
2024-04-07 21:09:13 +03:00
## 🔭 Local build (Windows 10+)
2023-12-30 14:46:43 +03:00
- this is main developers build
- Install Python 3.12, NodeJS, VSCode, Docker Desktop
- copy import wheels from ConceptCore to rsconcept/backend/import
- run rsconcept/backend/LocalEnvSetup.ps1
2023-12-30 14:46:43 +03:00
- use VSCode configs in root folder to start development
2024-04-07 21:09:13 +03:00
## 🔭 Development build
2023-12-30 14:46:43 +03:00
- this build does not use HTTPS and nginx for networking
- backend and frontend debugging is supported
- hmr (hot updates) for frontend
- run via 'docker compose -f "docker-compose-dev.yml" up --build -d'
2023-12-07 23:08:49 +03:00
- populate initial data: 'scripts/dev/PopulateDevData.ps1'
## Local production build
2023-12-30 14:46:43 +03:00
- this build is same as production except not using production secrets and working on localhost
- provide TLS certificate (can be self-signed) 'nginx/cert/local-cert.pem' and 'nginx/cert/local-key.pem'
- run via 'docker compose -f "docker-compose-prod-local.yml" up --build -d'
2024-04-07 21:09:13 +03:00
## 📦 Production build
2023-12-30 14:46:43 +03:00
2024-02-25 21:07:30 +03:00
- provide secrets: 'secrets/db_password.txt', 'django_key.txt', 'email_host.txt', 'email_password.txt', 'email_user.txt'
- check if you need to change SSL/TLS and PORT in 'rsconcept\backend\.env.prod'
2023-12-07 23:08:49 +03:00
- setup domain names for application and API in configs: 'frontend\env\.env.production', 'rsconcept\backend\.env.dev', 'nginx\production.conf'
- provide privacy policy document in PDF: 'frontend/public/privacy.pdf'
- use certbot to obtain certificates via 'docker compose -f "docker-compose-prod.yml" run --rm certbot certonly --webroot --webroot-path /var/www/certbot/ -d portal.acconcept.ru api.portal.acconcept.ru'
- run via 'docker compose -f "docker-compose-prod.yml" up --build -d'
2023-12-07 23:08:49 +03:00
- update via 'bash scripts/prod/UpdateProd.sh'