This is a NodeJs REST API exclusively made for PAISABANK - CLIENT APP.
It allows creating an user, login in, get cards and transactions. It uses a simple auth flow with mocked token.
It uses Turso as a serverless SQLite database.
IMPORTANT: I'm using ESM modules (import/export) instead of CMJ (require, module.export) but this cause a problem with Typescript(module=NodeNext
in the tsconfig file) so I had to add js
extension instead of ts
extension when importing the modules. Check this discussion. Another solution would be to install a module bundler and transpiler like Webpack or try a different configuration.
DISCLAIMER: This is not a project ready for production. It's only for educational purposes.
.
├── src/
│ ├── controllers
│ ├── db
│ ├── middlewares
│ ├── routes
│ ├── index.ts
│ └── server.ts
└── config files
- Server
- NodeJs v20.15.0
- ExpressJs v4.19.2
- Typescript v5.5.3
- Package manager
- npm v10.7.0
- Database
- Turso
- Drizzle ORM v0.31.2
If you want to use it for another client app, you can fork the repo and follow this steps, adding the changes you need:
- Create your Turso account.
- Create your Turso DB and get token and database url. Copy them to a new .env file.
- Add the necessary DB schemas.
- Run
npm run generate
to create database .sql files. - Run
npm run migrate
to migrate database .sql files to Turso. - If everything went ok, you are able to start server with
npm run dev
.