A light-weight platform for you to build up a notification system for your own projects.
Users can add account through API and grant account
(account operation) push
(push notifications) pull
(pull notifications) permissions.
root
account has all permissions,and can add/remove accounts or push/pull notifications.
Each notification has its own ID
Title
Content
Time
Target
Source
fileds.
Set Target
to select specific user to receive this notification,or set Target
to _global_
to send this notification to all users.
Programs can pull notifications sent to specific account through APIs.
Programs connect to esn-daemon
through APIs to interact with esn-daemon
,like the style of MySQL's interacting.
Users can also use Terminal
we published to interact with esn-daemon.
unit | function | repo |
---|---|---|
esn-daemon | Handle connections from api | https://github.com/EasyNotification/esn-daemon |
esn-api-golang | API for Golang projects to connect to esn-daemon | https://github.com/EasyNotification/esn-api-golang |
esn-api-java | API for Java projects to connect to esn-daemon | https://github.com/EasyNotification/esn-api-java |
esn-api-python | API for Python projects to connect to esn-daemon | https://github.com/EasyNotification/esn-api-python |
esn-terminal-swing | Made with esn-api-java,for users to manage notifications or accounts | https://github.com/EasyNotification/esn-terminal-swing |
esn-terminal-android | A terminal for Android platform | https://github.com/Soulter/esn-terminal-android |
If you don't want to use pre-build files,you can install golang on your device and build it by yourself.
- Install golang(version above 11) on your device.
- Enable GO111MODULE by execute
export GO111MODULE=on
on Linux/MacOS orset GO111MODULE=on
on Windows. - Clone this repo or download source code from release(recommended).
- Change directory to where the file
go.mod
in,executego mod tidy
to solve requirements. - Execute
go build -o bin/esnd-linux src/main/main.go
on Linux/MacOS orgo build -o bin\esnd-windows src\main\main.go
on Windows. - You can find executable file in
bin
directory.
Here are the steps to guide you to configure esn-daemon for your own projects.
A host with reachable IP address as server to run esn-daemon.
- Install MySQL on server.
- Add an account in MySQL and grant all permissions to access a specific database.
- Remember the user name,password and database name.
-
Make a work directory for esnd and download pre-build executable file from here.
-
Use
./esnd-linux-x64
on Linux or.\esnd-windows-x64.exe
on Windows to launch esnd first time. -
Esnd will auto generate config files and exit.
-
Change directory to
config/
and editesnd.conf
. -
Set
service.port
to the port specific for esnd. -
Set
db.user
db.addr
db.pass
db.database
to theMySQL user name
MySQL address and port
MySQL user password
database name
as you configured in previous steps. -
Set
root.mask
to the password for root account in esnd you expected,root account has all permissions in esnd system. -
If you want to enable debug mode and see more output during esnd runtime,append
debug.enable=true
in theesnd.conf
. -
Make sure the serivce port is open by firewall and then launch esnd.You can test esnd configuration in esn-terminal now.
Import APIs to your projects,and use provided ways to connect to daemon to push/pull notifications or add/remove accounts.
Please refer to READMEs of API repos.