Local DB management for the NFTrone project.
- To provide safe and flexible data-storage level for the NFTrone project to supply frontend with required metadata.
- To practice in Backend development.
Heavily inspired by https://github.com/leejh3224/clean-architecture-express-typescript
For now I wanted to deliver ASAP to go on with the Frontend part. This is a one man (demo) project, so I wanted to cut as many corners as possible, while maintaining in clean and easily maintainable.
ATM Local DB would be enough. Choosing relational DB was a matter of being at least familiar with them.
In this iteration DB structure looks like this:
+---------+ +--------+ +-------+
| Project |------------->| Layer |--------------->| Image |
+---------+ hasMany +--------+ hasMany +-------+
| ^ | ^
| belongsTo | | belongsTo | belongsTo
+--------------------+ +----------------------+
In the next iterations new tables will be introduced to store generated and saved image variants.
The decision to introduce ORM to the project has been inspired mainly by my desire to practice some real world practices. As I bonus I get:
- Easier initial setup
- Easier migrations.
Just run the project npm run start
or yarn run start
.
On the initial load db will be created.
Run npm run test
or yarn run test
for tests.
NFTRone project's shared dir is a way to sync Typescript types between Backend part (this repo) and Frontend. To push Types from here to top level project:
yarn run push-shared-types
To pull it from Frontend:
cd ../your-frontend-dir
yarn run pull-shared-types
This dir contains are accessible on /source-images
It contains assets user is uploading to their project.
Dirs structure:
projectId -> layerId -> filename(+ hash if filename is already taken)