- nodejs
- npm
- deno
Hint: we have a makefile that does all the steps for you
Just run make deploy
and it will automatically create a deployable bundle.
Otherwise follow the steps below:
Hint: If you are really lazy we provide precompiled deploy packages in the branch deno-deploy-data
- Install frontend dependencies, open app/frontend and run
npm install
- Build frontend, run
npm run build
- Create a deploy folder
mkdir deploy
- Copy the backend into a new folder
cp -r ./app/backend/* deploy
- Copy the frontend build into the backend folder
cp -r ./app/frontend/build ./deploy/static-site
- Go into the deploy folder
cd deploy
and start the app see run
--port
Port to listen on, default: 8080--vapidkey
Vapid key for your app (can be generated withmain.ts generate
)--sub
Email of the admin user must start withmailto:
--cors
Enable CORS - if you use the frontend on a different domain--frontend
Path to the frontend build directory--sendkey
Set the api key (for sending a new request)--loginkey
Set the api key (for login into the ui)
Example run:
deno run --allow-net --allow-read --allow-write --unstable ./deploy/main.ts run --port 8080 --vapidkey <vapidkey> --sub mailto:[email protected] --frontend ./static-site --sendkey <sendkey>
deno run --allow-net --allow-read --allow-write --unstable ./deploy/main.ts generate
or if you do not want to checkout this repository you can use the following command:
deno run -A --unstable --import-map https://raw.githubusercontent.com/K0IN/Notify/deno-port/app/backend/deno.json https://raw.githubusercontent.com/K0IN/Notify/deno-port/app/backend/main.ts generate
--remote
Set the remote url of the notification--key
Set the api key (for this request)--title
Set the title of the notification--message
Set the body of the notification--icon
Set the icon of the notification (optional)--tags
Comma separated list of all tags (optional)
deno run --allow-net --allow-read --allow-write --unstable ./deploy/main.ts notify --remote http://localhost:8080/api/notify --key <sendkey> --title "Hello World" --message "This is a test notification" --icon "https://picsum.photos/200/300" --tags "test,notification"
Example: deno run -A --unstable .\main.ts notify -r https://notify-demo.deno.dev/api/notify -t test -m world
You can compile the app to a single binary using deno compile
deno compile --allow-net --allow-read --allow-write --allow-env --unstable --output ./deploy/notify ./deploy/main.ts
then you can youse the executable as follows:
./deploy/notify run --port 8080 --vapidkey <vapidkey> --sub mailto:[email protected]