flexible wallet system with international coverage...
The Q-wallet is the backend API for a wallet system and is built on NodeJS and Express.
- The request processing flow in these terms: Signup request handling example:
/src → server.js → app.js → /routes/v1/index.js → /auth/apikey.js → schema.js → /helpers/validator.js → asyncHandler.js → /routes/v1/signup.js → schema.js → /helpers/validator.js → asyncHandler.js → /database/repository/UserRepo.js → /database/model/User.js → /core/ApiResponses.js
- The request is routed to its corresponsding handler via Router /src/routes/v1/index.js
- The RouteHandler is called for that particular endpoint (Example: /src/routes/v1/access/signup.js)
- Based on the validations and request it is either sent to the ErrorHandler [
app.use((err: Error, req: Request, res: Response, next: NextFunction) => {ApiError.handle(err);})
].- Else it is handled by the ResponseHandler i.e. ApiResponse → send(res) Database used is MongoDB, a No SQL database. MongoDB was used as opposed to a relational database because the document data model is a powerful way to store and retrieve data that allows developers to move fast. MongoDB's horizontal, scale-out architecture can support huge volumes of both data and traffic. In truth, RDBMSs help a lot for projects with many interconnected tables but this project contains little relationships so this feature is not missed.
Rename "config.env.example" to "config.env" and update the values/settings to your own.
- Install dependencies:
npm install
- Run app in dev mode:
npm run dev
- ...or run in prod mode:
npm start
- Admin account seeder:
node seeder -i
docker-compose.yml file included in project's root folder.
The API is live at Q-wallet API
Extensive documentation with examples here
- Version: 1.0.0
- Lisence: MIT
- Author: Usman Ogunsola