$ npm install# development
$ npm run start
# watch mode
$ npm run start:dev
# production mode
$ npm run start:prod# unit tests
$ npm run test
# e2e tests
$ npm run test:e2e
# test coverage
$ npm run test:covWhen you're ready to deploy your NestJS application to production, there are some key steps you can take to ensure it runs as efficiently as possible. Check out the deployment documentation for more information.
If you are looking for a cloud-based platform to deploy your NestJS application, check out Mau, our official platform for deploying NestJS applications on AWS. Mau makes deployment straightforward and fast, requiring just a few simple steps:
$ npm install -g @nestjs/mau
$ mau deployWith Mau, you can deploy your application in just a few clicks, allowing you to focus on building features rather than managing infrastructure.
This guide explains how to obtain the credentials required for each service and add them to your .env file.
Copy .env.example to .env before you start:
cp .env.example .envNIGHTSCOUT_URL=https://your-nightscout-instance.example.com
NIGHTSCOUT_API_KEY=your_api_secret_here
- Open your Nightscout instance in a browser.
- Go to Admin Tools → note the URL in your address bar — this is your
NIGHTSCOUT_URL(e.g.https://mysite.fly.dev). - Your
NIGHTSCOUT_API_KEYis the API Secret you chose when setting up Nightscout.- You can find or change it under Admin Tools → Profile Editor or in your hosting provider's environment variables (
API_SECRET).
- You can find or change it under Admin Tools → Profile Editor or in your hosting provider's environment variables (
- Enter the plain-text value — the application hashes it automatically before sending it to the API.
npm run test:check-nightscout-apiPUSHOVER_APP_TOKEN=your_pushover_app_token_here
PUSHOVER_USER_KEY=your_pushover_user_key_here
- Log in at pushover.net.
- Your User Key is displayed on the dashboard under your name.
Copy it into
PUSHOVER_USER_KEY.
- Scroll down to Your Applications on the dashboard and click Create an Application/API Token.
- Fill in a name (e.g.
diakem-notify) and accept the terms. - Copy the generated API Token/Key into
PUSHOVER_APP_TOKEN.
Install the Pushover app on your Android device and log in with the same account. The app must be installed for notifications to be delivered.
npm run test:check-pushover-apiTELEGRAM_BOT_TOKEN=your_telegram_bot_token_here
TELEGRAM_CHAT_ID=your_telegram_chat_id_here
- Open Telegram and search for @BotFather.
- Send
/newbotand follow the prompts to choose a name and username. - BotFather will reply with a token in the format
123456789:ABCdef.... Copy it intoTELEGRAM_BOT_TOKEN.
You need the numeric ID of the chat (private chat, group, or channel) where the bot should send messages.
For a private chat:
- Start a conversation with your bot by searching for its username and pressing Start.
- Send any message to the bot.
- Open the following URL in your browser (replace
<TOKEN>with your bot token):https://api.telegram.org/bot<TOKEN>/getUpdates - Find the
"chat"object in the response — the"id"field is yourTELEGRAM_CHAT_ID.
For a group or channel:
- Add the bot to the group or channel as an administrator.
- Send a message in the group/channel by mentioning the bot directly via
/test @<BOT_USERNAME>. - Call
getUpdatesas above and look for the"chat"."id"field. Group/channel IDs are negative numbers (e.g.-1001234567890).
npm run test:check-telegram-apiThe connection check sends a test message to the configured chat — you should see it arrive on your device.
Nest is MIT licensed.