Skip to content

Commit

Permalink
fix: readme update
Browse files Browse the repository at this point in the history
  • Loading branch information
elribonazo committed Nov 2, 2024
1 parent 28241ea commit cd3a4e4
Showing 1 changed file with 47 additions and 69 deletions.
116 changes: 47 additions & 69 deletions ts/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,25 +1,30 @@
/**
* @packageDocumentation
*
* RIDB is a storage agnostic secure database wrapper for the web, written in rust.
* ## Package Description
* RIDB secure database wrapper for the web with multiple storage engines, written in rust.
* The project started after years of experience working with web projects in both browser and nodejs platforms, the project was born with some rules / objectives:
* 1. Strong types + proper validation
* 2. Declarative schemas & documents
* 3. Configurable storages, inMemory, monogoDB, sqlite, indexdb
* 4. Secure encryption
* 5. Work seamlessly in browsers or nodejs applications.
*
* ## Supported features for InMemory Storage
* ### Supported features for InMemory Storage
* The inMemory storage is used by default and is currently supporting the following features:
* 1. Schemas: Creation of declararive schemas with required fields
* 2. Schemas: Implement validation across all the flows extracting properties and required fields when needed
* 3. Schemas: Manage Primary keys
* 4. Internal Storage: write operation, create, update, fetch one, remove, find and count
* 5. Internal Storage: Rust inMemory implementation
* 6. Database default InMemory plugged in
* 7. Plugin engine
* 8. Encryption
*
* ## Install
*
* ## Documentation
*
* ### Install
* In order to install simply run the following command
* npm:
* ```
* npm i @elribonazo/ridb --save
Expand All @@ -31,40 +36,9 @@
* yarn add @elribonazo/ridb
* ```
*
* ## Usage
*
* ### Database
*
* In CommonJS Modules:
*
* ```javascript
* const {
* RIDB,
* SchemaFieldType
* } = require('@elribonazo/ridb');
*
* (async () => {
* const db = new RIDB({
* demo: {
* version: 0,
* primaryKey: 'id',
* type: SchemaFieldType.object,
* properties: {
* id: {
* type: SchemaFieldType.string,
* maxLength: 60
* }
* }
* }
* });
* console.log("Starting the database");
* await db.start();
* console.log("Ok :)");
* })()
* ```
*
* In ES Modules, TypeScript, etc:
*
* ### Usage
* Creating your own database is pretty straight forward.
*
* ```javascript
* import {
* RIDB,
Expand All @@ -90,38 +64,10 @@
* console.log("Ok :)");
* })()
* ```
*
* ## How to run tests
*
* ```bash
* cd ts
* npm i
* npm run test
* ```
*
* ## How to build this project
* Build requirements:
* * Bash
* * Have Rust ([cargo](https://doc.rust-lang.org/cargo/getting-started/installation.html)) and [wasm-pack](https://rustwasm.github.io/wasm-pack/installer/)) installed.
* * Node JS Version (20/LTS Recommended)
*
* ```bash
* cd ts
* npm i
* npm run build
* ```
*
* ## How to test the project
* For now, we have enabled the implementation of the whole wasm + javascript integration.
* In order to run it, write the following:
*
* ```bash
* cd ts
* npm i
* npm run test
* ```
*
* ## Create your own storage
* ### Specification
*
* #### Storage
* A valid storage must extend [BaseStorage class](https://github.com/atala-community-projects/RIDB/blob/main/namespaces/RIDBTypes/classes/BaseStorage.md)
* here's some example:
*
Expand Down Expand Up @@ -154,6 +100,38 @@
* ```
*
*
* ## Build & Testing
* ### How to run tests
*
* ```bash
* cd ts
* npm i
* npm run test
* ```
*
* ## How to build this project
* Build requirements:
* * Bash
* * Have Rust ([cargo](https://doc.rust-lang.org/cargo/getting-started/installation.html)) and [wasm-pack](https://rustwasm.github.io/wasm-pack/installer/)) installed.
* * Node JS Version (20/LTS Recommended)
*
* ```bash
* cd ts
* npm i
* npm run build
* ```
*
* ## How to test the project
* For now, we have enabled the implementation of the whole wasm + javascript integration.
* In order to run it, write the following:
*
* ```bash
* cd ts
* npm i
* npm run test
* ```
*
*
*/
import wasmBuffer from "../../pkg/ridb_rust_bg.wasm";

Expand Down

0 comments on commit cd3a4e4

Please sign in to comment.