2021-07-23 18:25:54 +03:00
# CodeX Docs
Engine for documentation website using [Editor.js ](//editorjs.io )

## Development
### Set up the environment
2018-09-03 23:05:50 +03:00
Install node version manager and required version of node js
2021-07-23 18:25:54 +03:00
2018-09-03 23:05:50 +03:00
```
$ chmod u+x ./bin/nvm.sh & & ./bin/nvm.sh
$ nvm install
```
> For windows use [nvm for windows](https://github.com/coreybutler/nvm-windows)
Install Yarn package manager
```
$ brew install yarn --without-node
```
> Use `--without-node` flag because nvm version of Node is used
Or download it directly from the [website ](https://yarnpkg.com/en/docs/install )
2021-07-23 18:25:54 +03:00
### Install npm packages
2018-09-03 23:05:50 +03:00
```
$ yarn install --frozen-lockfile
```
2021-07-23 18:25:54 +03:00
### Available scripts
2022-03-05 22:57:23 +04:00
#### Compile to Javascript
```
$ yarn compile
```
2018-09-03 23:05:50 +03:00
2021-07-23 18:25:54 +03:00
#### Start the server
2018-09-03 23:05:50 +03:00
```
$ yarn start
```
2021-07-23 18:25:54 +03:00
#### Run ESLint with `--fix` option
2018-09-03 23:05:50 +03:00
```
$ yarn lint
```
2021-07-23 18:25:54 +03:00
#### Run tests
2018-09-03 23:05:50 +03:00
```
$ yarn test
```
Authentication (#22)
* Authorization added
* added secret to password, md5 hashing, removed promise from verifyToken, deleted links when not authorized
* added dbinsert script
* turned verifyToken to middleware, added description for dbinsert, added hidden csrf field in auth form
* added middlewares, user model and controller
* JSDoc fix
* wrong password processing fix
* added comments to dbinsert script, moved salt and passHash to singe db doc
* Moved salt to .env, upgradedscript for generating password was, fixed comments and JSDoc
* Deleted using salt (now user is only one), changed verifying password to bcrypt.compare, added httpyOnly property to jwt cookie
2019-03-06 13:22:57 +03:00
### Authentication
To manage pages you need to authorize (available on `/auth` ).
To generate password use `yarn generatePassword [password]` command.
2021-07-23 18:25:54 +03:00
2022-04-05 14:03:13 +04:00
## Release process
We use [release-drafter ](https://github.com/release-drafter/release-drafter ) to generate release notes and GitHub release.
It will automatically generate draft release based pull requests data between current version and previous version.
To make new release you need go to [releases ](https://github.com/codex-team/codex.docs/releases ) page find the latest draft release and mark it as ready.
After creating new release, new git tag will be created and new version will be published.
2021-07-23 18:25:54 +03:00
# About CodeX
< img align = "right" width = "120" height = "120" src = "https://codex.so/public/app/img/codex-logo.svg" hspace = "50" >
CodeX is a team of digital specialists around the world interested in building high-quality open source products on a global market. We are [open ](https://codex.so/join ) for young people who want to constantly improve their skills and grow professionally with experiments in cutting-edge technologies.
| 🌐 | Join 👋 | Twitter | Instagram |
| -- | -- | -- | -- |
| [codex.so ](https://codex.so ) | [codex.so/join ](https://codex.so/join ) |[@codex_team ](http://twitter.com/codex_team ) | [@codex_team ](http://instagram.com/codex_team ) |