An ExpressJS starter repository for Web3.0, with TypeScript.
MIT License
A generic backend with Redis, Prisma ORM (to PgSQL) and Ethers setup. It also has a signature-based authorization middleware, that maps a common signature to a public key.
You need to have the following:
The connection information for these are stored in .env
. See an example file under environments.
Just run yarn
to install the packages and then yarn run start
to start the server. An environment file .env
is required as follows:
PORT=<the port to listen>
Start the backend in a terminal with yarn run start:test
, and in another run yarn test
to execute unit tests. You can skip some tests with .skip
if wanted, as linter will not be happy with the code when you comment stuff out. Note that Jest also sets NODE_ENV
variable to be test
when during testing.
The entry point is app.ts
. The other files are structured as follows:
Within the tests folder, there are also utilities, mock data and isolated scripts.
Google TypeScript code formatting & linting is used as an extension of eslint
and prettier
. I have also included my VSCode settings, though you should feel free to change them.