docker-compose up
Then we can go to http://localhost:4567/ and start with the GraphiQL
npm inpm run migratenpm startnpm test
Can be found at ./docs/index.html
You can look at GraphQL schema here: ./schema.graphql. It consists of three entities:
It calls send and it works with three transports: LOG, HTTP(POST to the HTTP-resource) and SMTP(e-mail).
The last two transports can be configured via the config. The example of usage:
mutation {
send(user: "a", type: "LOG", body: "a")
}
It creates the user, and the message in the db (user can later comes from auth system). Returns message id. And starts check the status of the message delivery. Statuses can be: STARTED, PENDING, FINISHED or an ERROR.
After that we have four types of queries to check the status. The larger query to look at every entity is:
query {
users {
name
messages {
type
id
history {
status
date
}
}
}
}
Project written in typescript, uses jest unit test, which covers 99% of source. Also query builder knex.
Sending email via nodemailer. Sending requests via axios.
For code formatting there are prettier and eslint.
And, of course express-graphql.
Generated using TypeDoc