ConceptPortal-public/README.md

205 lines
5.4 KiB
Markdown
Raw Permalink 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)
2024-09-11 13:48:23 +03:00
[![Uptime Robot status](https://img.shields.io/uptimerobot/status/m797659312-8ab26c72de49d8d92eccc06e?label=Live%20Server)](https://portal.acconcept.ru)
2024-04-20 18:36:46 +03:00
2023-07-27 11:24:25 +03:00
React + Django based web portal for editing RSForm schemas.
2024-07-26 00:40:15 +03:00
This readme file is used mostly to document project dependencies and conventions.
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
2024-05-02 17:14:20 +03:00
- feel free to open issues, discussion topics, contact maintainer directly
- use Test config in VSCode to run tests before pushing commits / requests
2024-05-02 17:14:20 +03:00
- use github actions to setup linter checks and test builds
2024-07-26 00:40:15 +03:00
- use conventional commits to describe changes
2024-04-07 21:10:32 +03:00
## ✨ Frontend [Vite + React + Typescript]
2023-12-30 14:46:43 +03:00
2024-07-21 15:19:57 +03:00
- to regenerate parsers use 'npm run generate' script
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
2024-11-25 19:53:20 +03:00
- react-router
2023-07-27 11:24:25 +03:00
- react-toastify
- react-tabs
- react-intl
- react-error-boundary
- react-tooltip
2024-07-28 13:07:22 +03:00
- react-zoom-pan-pinch
- react-hook-form
- react-scan
2024-07-21 15:19:57 +03:00
- reactflow
- js-file-download
2024-04-10 15:54:47 +03:00
- use-debounce
2024-12-18 12:35:48 +03:00
- qrcode.react
- zustand
2025-01-30 19:23:15 +03:00
- zod
- @hookform/resolvers
- @tanstack/react-table
- @tanstack/react-query
- @tanstack/react-query-devtools
- @uiw/react-codemirror
- @uiw/codemirror-themes
2023-08-12 20:52:11 +03:00
- @lezer/lr
- @dagrejs/dagre
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
2025-02-12 21:36:25 +03:00
- eslint-plugin-import
- eslint-plugin-react-compiler
2023-07-27 11:24:25 +03:00
- eslint-plugin-simple-import-sort
2024-10-23 16:21:08 +03:00
- eslint-plugin-react-hooks
2023-09-21 14:58:01 +03:00
- eslint-plugin-tsdoc
2025-03-02 19:42:19 +03:00
- eslint-plugin-playwright
- babel-plugin-react-compiler
2024-07-21 15:19:57 +03:00
- vite
2023-08-01 23:43:43 +03:00
- jest
- shadcn
2023-08-01 23:43:43 +03:00
- ts-jest
- stylelint
- stylelint-config-recommended
- stylelint-config-standard
- stylelint-config-tailwindcss
- @vitejs/plugin-react
2023-08-01 23:43:43 +03:00
- @types/jest
2023-08-12 20:52:11 +03:00
- @lezer/generator
- @playwright/test
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
2025-04-16 15:22:31 +03:00
- Oklch Color Preview
2024-07-21 15:19:57 +03:00
- Tailwind CSS IntelliSense
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
2024-07-19 11:20:53 +03:00
- Prettier
2024-07-24 11:29:19 +03:00
- PowerShell (for Windows dev env)
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
2024-05-24 15:40:28 +03:00
- Alegreya Sans SC
2023-12-30 20:11:54 +03:00
- Noto Sans Math
2024-10-17 15:45:23 +03:00
- Noto Sans Symbol
- Noto Color Emoji
2023-12-30 20:11:54 +03:00
</pre>
</details>
2023-07-15 18:00:20 +03:00
2024-05-02 17:14:20 +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
2024-05-24 15:40:28 +03:00
- autopep8
2024-07-19 11:20:53 +03:00
- isort
- Django
2024-07-15 12:36:18 +03:00
- SQLite
- Playwright
2023-07-27 11:24:25 +03:00
</pre>
</details>
2023-07-15 17:55:28 +03:00
2024-05-02 17:14:20 +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-07-26 00:40:15 +03:00
## 📝 Commit conventions
- 🚀 F: major feature implementation
2024-07-27 22:49:49 +03:00
- 🔥 B: bug fix
- 🚑 M: Minor fixes
2024-07-26 00:40:15 +03:00
- 🔧 R: refactoring and code improvement
- 📝 D: documentation
2024-07-26 00:40:15 +03:00
2024-05-02 17:14:20 +03:00
## 🖥️ Local build (Windows 10+)
This is the build for local Development
2023-12-30 14:46:43 +03:00
- Install Python 3.12, NodeJS, VSCode, Docker Desktop
- copy import wheels from ConceptCore to rsconcept/backend/import
2024-10-14 12:41:19 +03:00
- run scripts/dev/LocalEnvSetup.ps1
2023-12-30 14:46:43 +03:00
- use VSCode configs in root folder to start development
- use 'npm run prepare' to regenerate frontend parsers (if you change grammar files)
2024-05-02 17:14:20 +03:00
## 🔭 Local docker build
This build does not use HTTPS and nginx for networking
2023-12-30 14:46:43 +03:00
- 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'
2024-05-02 17:14:20 +03:00
## 📦 Local production build
This build is same as production except not using production secrets and working on localhost
2023-12-30 14:46:43 +03:00
- 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-05-02 17:14:20 +03:00
## 🔥 Production build
This build is deployed on server.
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'