Portal/README.md

192 lines
5.0 KiB
Markdown
Raw Normal View History

2024-06-07 20:17:03 +03:00
<div align="center">
<a href="https://portal.acconcept.ru/" target="_blank">
<img width="650" src="rsconcept/frontend/public/logo_full.svg" />
</a>
</div>
<br />
<br />
[![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:49:03 +03:00
[![Uptime Robot status](https://img.shields.io/uptimerobot/status/m797659312-8ab26c72de49d8d92eccc06e?label=Live%20Server)](https://portal.acconcept.ru)
2024-06-07 20:17:03 +03:00
React + Django based web portal for editing RSForm schemas.
2024-07-26 00:39:45 +03:00
This readme file is used mostly to document project dependencies and conventions.
2024-06-07 20:17:03 +03:00
## ❤️ Contributing notes
- feel free to open issues, discussion topics, contact maintainer directly
- use Test config in VSCode to run tests before pushing commits / requests
- use github actions to setup linter checks and test builds
2024-07-26 00:39:45 +03:00
- use conventional commits to describe changes
2024-06-07 20:17:03 +03:00
## ✨ Frontend [Vite + React + Typescript]
2024-07-21 15:17:36 +03:00
- to regenerate parsers use 'npm run generate' script
2024-06-07 20:17:03 +03:00
<details>
<summary>npm install</summary>
<pre>
- axios
- clsx
- react-icons
2024-11-25 19:52:57 +03:00
- react-router
2024-06-07 20:17:03 +03:00
- react-toastify
- react-loader-spinner
- react-tabs
- react-intl
- react-select
- react-error-boundary
- react-tooltip
2024-07-28 13:07:00 +03:00
- react-zoom-pan-pinch
2024-07-20 18:26:32 +03:00
- reactflow
2024-06-07 20:17:03 +03:00
- js-file-download
- use-debounce
- framer-motion
- reagraph
2024-07-24 18:11:28 +03:00
- html-to-image
2024-06-07 20:17:03 +03:00
- @tanstack/react-table
- @uiw/react-codemirror
- @uiw/codemirror-themes
- @lezer/lr
- @dagrejs/dagre
2024-06-07 20:17:03 +03:00
</pre>
</details>
<details>
<summary>npm install -D</summary>
<pre>
- tailwindcss
- postcss
- autoprefixer
- eslint-plugin-simple-import-sort
- eslint-plugin-react-hooks
2024-06-07 20:17:03 +03:00
- eslint-plugin-tsdoc
2024-07-20 18:26:32 +03:00
- vite
2024-06-07 20:17:03 +03:00
- jest
- ts-jest
- @types/jest
- @lezer/generator
</pre>
</details>
<details>
<summary>VS Code plugins</summary>
<pre>
- ESLint
- Colorize
2024-07-21 15:17:36 +03:00
- Tailwind CSS IntelliSense
2024-06-07 20:17:03 +03:00
- Code Spell Checker (eng + rus)
- Backticks
- Svg Preview
- TODO Highlight v2
- Prettier
2024-07-24 11:28:54 +03:00
- PowerShell (for Windows dev env)
2024-06-07 20:17:03 +03:00
</pre>
</details>
<details>
<summary>Google fonts</summary>
<pre>
- Fira Code
- Rubik
- Alegreya Sans SC
- Noto Sans Math
2024-10-17 15:44:53 +03:00
- Noto Sans Symbol
- Noto Color Emoji
2024-06-07 20:17:03 +03:00
</pre>
</details>
## 🗃️ Backend [Django + PostgreSQL/SQLite]
- [ConceptCore](https://github.com/IRBorisov/ConceptCore)
<details>
<summary>requirements</summary>
<pre>
- django
- djangorestframework
- django-cors-headers
- django-filter
- drf-spectacular
- tzdata
- gunicorn
- coreapi
- psycopg2-binary
- cctext
- pyconcept
</pre>
</details>
<details>
<summary>requirements-dev</summary>
<pre>
- coverage
- pylint
- mypy
- djangorestframework-stubs[compatible-mypy]
</pre>
</details>
<details>
<summary>VS Code plugins</summary>
<pre>
- Pylance
- Pylint
- autopep8
- isort
- Django
2024-07-16 12:17:40 +03:00
- SQLite
2024-06-07 20:17:03 +03:00
</pre>
</details>
## ⚙️ DevOps
- Docker compose
- PowerShell
- Certbot
- Docker VSCode extension
# Developer Notes
2024-07-26 00:39:45 +03:00
## 📝 Commit conventions
- 🚀 F: major feature implementation
2024-07-27 22:49:20 +03:00
- 🔥 B: bug fix
- 🚑 M: Minor fixes
2024-07-26 00:39:45 +03:00
- 🔧 R: refactoring and code improvement
- 📝 D: documentation
2024-07-26 00:39:45 +03:00
2024-06-07 20:17:03 +03:00
## 🖥️ Local build (Windows 10+)
This is the build for local Development
- Install Python 3.12, NodeJS, VSCode, Docker Desktop
- copy import wheels from ConceptCore to rsconcept/backend/import
2024-10-14 12:40:47 +03:00
- run scripts/dev/LocalEnvSetup.ps1
2024-06-07 20:17:03 +03:00
- use VSCode configs in root folder to start development
- use 'npm run prepare' to regenerate frontend parsers (if you change grammar files)
## 🔭 Local docker build
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'
- populate initial data: 'scripts/dev/PopulateDevData.ps1'
## 📦 Local production build
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'
## 🔥 Production build
This build is deployed on server.
- 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'
- 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'
- update via 'bash scripts/prod/UpdateProd.sh'