Secretary Server
Your personal assistant: diary watcher, life analyzer, and task manager.
Install
Dev only
npm i
chmod +x scripts/prepare
scripts/prepare
For HTTPS
Add host /etc/hosts for local development
127.0.0.1 web-dev.gotointeractive.com
mkdir cert;
openssl req -x509 -newkey rsa:2048 \
-keyout certs/server/bot-key.pem \
-out certs/server/bot-cert.pem \
-days 365 -nodes \
-subj "/CN=web-dev.gotointeractive.com" \
-addext "subjectAltName=DNS:web-dev.gotointeractive.com"
For MacOS add certificate to trusted
sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain certs/server/bot-cert.pem
Run dev server
npm run dev:secure
ENVIRONMENTS
Copy .env.example to .env and fill in the required values. Do not commit .env.
Required values: TELEGRAM_TOKEN, HOST, SECRETARY_HOST, APP_URL, CLIENT_ID, and CLIENT_SECRET.
Tests
Unit
npm run test:unit [-- --watch]
#npm run test:unit [-- --match='config']
Run the full package check:
npm run test
Tools
Package upgrade
ncu -u
Secretary API types
SecretaryGateway imports generated types from the package root api.d.ts.
They are generated from the checked-in OpenAPI snapshot at
openapi/secretary.json; redocly.yaml defines the input and output. The
generated file is ignored by Git, and the types stay at the infrastructure
boundary instead of entering the domain layer.
Run these commands from the standalone Web repository root:
npm install --ignore-scripts
npm run generate:api
npm run check:api
npm run lint
Generation uses the checked-in snapshot and does not need the private Secretary
core, a parent repository, a running server, a database, Docker, or network
access. Node 26 strips erasable TypeScript syntax when running the source, but
does not perform static type checking. check:api checks that an existing
api.d.ts matches the snapshot without writing files; run generate:api first
from a clean checkout.
To update the API contract, obtain the OpenAPI JSON for the agreed API version
from its provider, replace openapi/secretary.json, then run generate:api,
check:api, and lint. Review the snapshot and the locally generated types.
Commit the snapshot; regenerate api.d.ts when needed. A core
release can change API descriptions; Web owns its snapshot and updates it
deliberately when adopting a compatible API.
JSON-RPC parameter and result schemas are supplied by the API contract. Results
for methods without a specific schema, and responses requested with arbitrary
Accept headers, remain unknown. These compile-time types do not validate
external responses at runtime.
Fix lint
npm run lint -- --fix --quite
Show dependencies graph
report:dependency uses Graphviz dot to render the dependency-cruiser DOT output to SVG.
Install Graphviz first and make sure dot is available in PATH.
# macOS
brew install graphviz
npm run report:dependency
Validate dependencies
npm run lint:dependency
docs only Dev
Install
sudo gem install bundler jekyll
cd docs
bundle install
Run
npm run dev:docs
Docker Image
docker compose --env-file .env up --build
Run Telegram Bot Dev
docker compose --env-file .env up -d
Возможности управления системой
something text- Уведомление? something search- Поиск! something execute- Выполнение поручения
Make with Manifest GIC DAO.