How isaac0yen/finwise-backend works
Project type and purpose
• This is a Node.js/TypeScript backend service (no separate frontend).
• It exposes RESTful endpoints for user authentication, admin operations, transactions (deposit, withdrawal, transfer), and a dashboard.
• It also runs scheduled “cron” jobs for deposit verification and balance integrity checks.
• It integrates with external services (e.g., Paystack for payments, an email provider).
• It uses a SQL database (db.sql) via ORM or query layer.
File structure
• src/index.ts: application entry point, sets up server & routing.
• src/config: database and environment configuration.
• src/routes: maps HTTP routes to controllers.
• src/controllers: business-logic handlers grouped by feature (auth, admin, dashboard, deposit, transaction, transfer, withdrawal).
• src/middleware: authentication, authorization, status checks, generic middleware.
• src/modules: reusable integrations (authModule, emailModule, paystack integration, codes).
• src/models: data models (e.g., Transaction) mapping to database tables.
• src/service: database connection and any shared base classes (studentBase?).
• src/cron: scheduled tasks that run independently of HTTP requests.
• swagger.json: OpenAPI specification for documenting the REST API.
• Configuration/build: .eslintrc.js, tsconfig.json, nodemon.json.
README
• (Empty in this case, so we infer architecture solely from the file tree.)
Elements
• Green for business-logic controllers/modules
• Orange for persistence (database)
• Purple for external services
• Grey for cron jobs and background workers