Topic: Development Progress
Hello Traders,
I'm starting to work on a new trading-related application. I'll share more specific details later.
I'm working on a new backend framework for the new app. I aim to make it more secure, end users friendly, and easier for me to develop, debug, and maintain.
My first step is to develop new helper modules. I'll make all non-critical code open-source and publicly available.
Base64 encoding and decoding module for NodeJS
This module converts an arbitrary text to a combination of hexadecimal digits and letters suitable for online communication.
Example:
The text "Hello, World!" becomes: "SGVsbG8sIFdvcmxkIQ"
Later, the base64 text can be decoded to the original message.
This is very handy for the user's names and emails.
Link: https://github.com/PopovMP/base64
SHA-256 encoding module
This module encodes a piece of text with a private key. It encodes secure tokens to validate users.
For example, logging in to the software encodes your password in the browser. The password and your email go to the server, which checks if it corresponds to a currently active user. If so, the server will issue a secure token for the user.
The encoding works in one direction only. The encoded text cannot be recovered.
Link: https://github.com/PopovMP/sha256
JWT module
JWT stands for Jason Web Token. This is the secure token the server issues for a successfully logged-in user.
This module uses the above Base64 and SHA-256 modules.
The JWT token also contains information for the account type: free, trial, or premium...
It has an expiration time, which makes it handy for features such as "Remember me".
Link: https://github.com/PopovMP/jwt
File-writer
I'm especially happy with this piece of code. It reliably saves files to the disk, even if there are many overlapping save requests with different contents.
I will use this module in the Logger and the DataBase I'm developing.
For example, we can send 1000 append file requests, and the file-writer will ensure the correct file content with only two save operations.
for (let i = 1; i <= 1000; i++) {
appendAndForget("mambo.txt", "Mambo number: " + i);
}
Link: https://github.com/PopovMP/file-writer
Logger
This module helps the server save log messages to a file or show them on the terminal. It prints the messages in different colours depending on their kind.
Link: https://github.com/PopovMP/file-writer
Happy holidays!