Handy is a website for creating notes. We have done everything to make your notes and our code look like a work of art.
We are aware of how important the security of users' personal data is, so authentication in our application is based on JWT tokens. This approach is considered one of the safest ways to transmit information .
Markdown is a markup language for text documents. Today it is the most convenient language for text formatting, which is why we decided to use it for editing notes. Our editor supports:
- Headings (up to 6 levels)
- Text formatting (bold, italic)
- Quotes
- Lists (ordered and not)
- Links
Since Handy was originally supposed to be a multiplatform application, we decided to implement support for syncing notes. To correctly combine the edited text with its old version, we used a simplified version of the Operational Transformation (OT) algorithm . Now users can edit notes simultaneously from two devices!
Client | Server | Deploy |
---|---|---|
To run the project locally, it is recommended to install the following.
For client:
For server:
It is also necessary to install Docker Compose to simplify the process of building the application.
- Clone the repository
git clone https://gitlab.com/zavod-team/handy.git
- Create a file .env in the root of the project (next to docker-compose.yml)
LOGS_DIR=../logs BUILD_DIR=./server DB_DIR=../db LETSENCRYPT_DIR=../letsencrypt MYSQL_DATABASE=database MYSQL_USER=user MYSQL_PASSWORD=password MYSQL_ROOT_PASSWORD=root MYSQL_HOST=host MYSQL_PORT=port
- Change in docker-compose.yml the following sections
backend: build: ./server restart: always env_file: - .env depends_on: - db ports: - 8080:8080 frontend: build: ./client env_file: - .env volumes: - ${BUILD_DIR}:/server
- Optional. For a separate client launch install npm
dependencies outside of Docker
cd ./client npm install
Fullstack (with Docker)
- Build client
docker-compose build frondend docker-compose up frondend
- Build server
docker-compose build backend
- Run it all together
docker-compose up db backend
The Handy website should be available at localhost:8080
.
It is important to up the client and server containers in this order, because the client leaves artifacts in the server resources folder, and the server image is already being built with them.
After each client rebuild, all commands must be executed.
Client
If necessary, the client can be run separately. There are two ways to do this.
- Build mode:
As a result, a bundle will appear in the
npm run build
client/build
folder. - Development mode:
The website will be available at
npm run start
localhost:4200
.