Stephane Mensah

The only difference between ordinary and extraordinary is just that little "extra".

fix b2 url format saved in database

i omitted the / between bucket name and key
Before => ${url.href}${this.bucket}${key}
Now => ${url.href}${this.bucket}/${key}

fix key saved in File table in db

it seems instead of using the key i used the extension to save inside the key field

finally got storage system working

Tested by creating a bot /getpic command that :
1. gets the user's telegram profile pic url,
2. get the raw file using axios,
3. convert to buffer,
4. save to backblaze
3. save metadata(mimetype, key, storage url and imagekit url) to db
6. return imagekit link

+1 for backblaze πŸ”₯

0 Likes

refactored Storage system to fix some bugs

installed @types/minio and removed some line of codes that was causing issues

new helper downloadPhoto() to download any image other than profile picture from telegram

new helper downloadProfilePhoto to download user profile picture from telegram

add helper to generate random username using human-readable-ids

Here's how i did it:
ts
import { hri } from "human-readable-ids"

export function genereateUsername() {
return hri.random()
}

properly resize buttons in 2nd menu for account creation.

The first image, i put all options in a single which didn't give me what i wanted. The second image, for each two button in row, i put them in a single array, while the last button is in its own array.

finally got account creation wizard working

Currently, the wizard uses session to save input in each step then i log to console to see final result.
I did it this way because i was testing it telegraf's wizard scenes.
Next up, is to save this data in the database.

yarn add libphonenumber-js title

these two packages will be extensively for the bot and webapp.
1. libphonenumber-js ==> will be used to validate phone numbers input from the user. Because i'm not familiar with regex, it's the best alternative for.
2. title ==> will be used to titleize names for users, products, stores etc.

Implemented new Storage system

it's a 100% port of https://twitter.com/jeserodz/status/1371920489132781568. Direct link at https://github.com/jeserodz/nestjs-land/blob/main/libs/storage/src/storage.service.ts
New methods were added to in accordance to my needs, eg: replaced typeorm with prisma
Stephane Mensah Author

Oh I forgot to mention that i replaced(totally removed it from my project) aws-sdk in favor of min.io

0 Likes

Added a new File model to save uploaded files metadata

I came up with this idea after seeing [this tweet](https://twitter.com/flybayer/status/1371865319271239680)