Skip to content

EKI-INDRADI/eki-latihan-nestjs-sqlite-portable-file-upload

Repository files navigation

Nest Logo

A progressive Node.js framework for building efficient and scalable server-side applications.

NPM Version Package License NPM Downloads CircleCI Coverage Discord Backers on Open Collective Sponsors on Open Collective Support us

Description

Nest framework TypeScript starter repository.

Installation

$ npm install

Running the app

# development
$ npm run start

# watch mode
$ npm run start:dev

# production mode
$ npm run start:prod

Test

# unit tests
$ npm run test

# e2e tests
$ npm run test:e2e

# test coverage
$ npm run test:cov

Support

Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please read more here.

Stay in touch

License

Nest is MIT licensed.

EKI NOTE :

1. installation Docker, Postgresql

install vm alpine + docker
https://github.com/EKI-INDRADI/eki-latihan-vm-alpine-docker-portable

install Docker, Postgresql
https://github.com/EKI-INDRADI/eki-latihan-docker-postgresql

create database simple_pos

2. install nodejs & nestjs

install nodejs   (https://nodejs.org)

npm i -g @nestjs/cli
nest --version

==== STAGE 13 = PORTABLE FILE UPLOAD UP TO 274k GB

20220117-0048-SQLITE-EXPRESS-CRUD-FILE-UPLOAD
database client menggunakan
"Database Client for Visual Studio Code cweijan"
cari extention "cweijan" pada extention visual studio code
atau menggunakan "SQLite Studio" https://sqlitestudio.pl/

npm install @nestjs/serve-static (public folder)
npm install sqlite3 --save


https://www.sqlite.org/limits.html


Maximum Database Size

Every database consists of one or more "pages". Within a single database, every page is the same size, but different database can have page sizes that are powers of two between 512 and 65536, inclusive. The maximum size of a database file is 4294967294 pages. At the maximum page size of 65536 bytes, this translates into a maximum database size of approximately 1.4e+14 bytes (281 terabytes, or 256 tebibytes, or 281474 gigabytes or 256,000 gibibytes).

This particular upper bound is untested since the developers do not have access to hardware capable of reaching this limit. However, tests do verify that SQLite behaves correctly and sanely when a database reaches the maximum file size of the underlying filesystem (which is usually much less than the maximum theoretical database size) and when a database is unable to grow due to disk space exhaustion.


Note : 
1 GiB = 1.073741824 GB
256.000 GiB = -+ 274.878 GB

keungulan database SQLite berbentuk file dah mudah dibuat synology server (auto backup)


ketika di running selesai 
file database akan otomatis terbuat dengan nama simple_pos 
pada direktory ./simple_pos

.env

SQLITE_DATABASE = 'simple_pos'
JWT_SECRET_KEY= 'eki-secret-key'

20220123-0048-SQLITE-EXPRESS-CRUD-FILE-UPLOAD-001
PUBLIC FOLDER

update rnd-nestjs-sqlite\src\app.module.ts

    ServeStaticModule.forRoot({
      rootPath: join(__dirname, '..', 'assets' , 'files'),
    }),

example call public file :
http://localhost:3000/1.png
http://localhost:3000/folder/2.png


reference : https://github.com/nestjs/nest/blob/master/sample/24-serve-static/src/app.module.ts

==== /STAGE 13 = PORTABLE FILE UPLOAD UP TO 274k GB

REFERENSI :

https://github.com/EKI-INDRADI/eki-latihan-vm-alpine-docker-portable

https://github.com/EKI-INDRADI/eki-latihan-docker-phpmyadmin-mariadb
https://github.com/EKI-INDRADI/eki-latihan-nestjs-mysql
https://github.com/EKI-INDRADI/eki-latihan-nestjs-fastify-mysql

https://github.com/EKI-INDRADI/eki-latihan-docker-postgresql
https://github.com/EKI-INDRADI/eki-latihan-nestjs-postgresql
https://github.com/EKI-INDRADI/eki-latihan-nestjs-fastify-postgresql 

https://github.com/EKI-INDRADI/eki-latihan-docker-mongodb
https://github.com/EKI-INDRADI/eki-latihan-nestjs-mongodb
https://github.com/EKI-INDRADI/eki-latihan-nestjs-fastify-mongodb

https://github.com/EKI-INDRADI/eki-latihan-nestjs-http-module-rxjs-8

https://github.com/EKI-INDRADI/eki-latihan-docker-rabbitmq
https://github.com/EKI-INDRADI/eki-latihan-nestjs-rabbitmq

https://github.com/EKI-INDRADI/eki-latihan-nestjs-sqlite-portable-file-upload

EKI INDRADI

"TIME > KNOWLEDGE > MONEY". #STILL_ONE_DIGIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages