| migrations | ||
| src | ||
| .gitignore | ||
| build.rs | ||
| Cargo.lock | ||
| Cargo.toml | ||
| example.env | ||
| README.md | ||
Navak backend
Navak server
Quick Start
- clone this repo
- clone navak-proto in the same parent directory:
navak
├── navak-backend
└── navak-proto
- copy
example.envto.envand modify contents (see below) - in this repo, run
cargo run
Environment
DATABASE_CONNECTION_STRING="host=W dbname=X user=Y password='Z'"
The PostgreSQL connection data
SMTP_RELAY=example.eu
The email server host
SMTP_USERNAME=exampleuser
The email server user
SMTP_PASSWORD=mypassword
The email server password
SMTP_SENDER_EMAIL=navak@example.eu
The sender's email address
NAVAK_HOST=0.0.0.0
The host this server is listening to
NAVAK_PORT=3000
the port this server is listening to
NAVAK_PUBLIC_URL=https://example.eu
the public URL of this server (used for links in login emails)
Components
Migrations
The migrations directory contains database migrations, with each file being a transaction.
The migrations_manager.rs includes all the migrations at compile time, and apply them at runtime. Already applied migrations are ignored.
Notes:
- migrations are applied in alphabetical order
- a migration must not be modified after it has been applied
- or the modification won't be applied
- a migration filename must not be modified after it has been applied
- or it will be applied again (and will probably fail)
Inter-Socket communication
(wip) The ISC component holds a link to all connected clients. It's the hub allowing messages to flow from the sender to the receivers in real-time.