Skip to content

Commit 3457530

Browse files
committed
fix: package description improvement
1 parent 4b74339 commit 3457530

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+3233
-578
lines changed

README.MD

+12-145
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<p align="center">
2-
<img src="https://cdn.jsdelivr.net/gh/trust0-project/ridb@latest/docs/logo.svg" alt="JavaScript Database" />
2+
<img src="https://cdn.jsdelivr.net/gh/trust0-project/ridb@latest/logo.svg" alt="JavaScript Database" />
33
<br />
44
<br />
55
<h3 align="center">A secure light-weight and dependency free database wrapper for the web.</h3>
@@ -16,6 +16,16 @@
1616
<a href="https://www.npmjs.com/package/@trust0/ridb"><img src="https://img.shields.io/npm/dm/@trust0/ridb?color=c63a3b&style=flat-square"></a>
1717
</p>
1818

19+
20+
### Packages
21+
Our project consists of three main packages, each designed to enhance your database experience:
22+
23+
| Package Name | Description | Link |
24+
|--------------|-------------|------|
25+
| **wasm** | The rust source for DB, contains its core logic, optimisations, algorithms and cryptography functionality. | [View on GitHub](https://github.com/trust0-project/ridb-wasm) |
26+
| **ridb** | Main project with RIDB core functionality. | [View on GitHub](https://github.com/trust0-project/ridb) |
27+
| **ridb-level** | An Storage for level-based storage (NODEJS). | [View on GitHub](https://github.com/trust0-project/ridb-level) |
28+
1929
### Security
2030
We take security very seriously and have implemented robust measures to ensure data protection. Below are the specifications for our security features:
2131

@@ -25,6 +35,7 @@ We take security very seriously and have implemented robust measures to ensure d
2535
| **Encryption** | Data is encrypted using AES-256-GCM (Advanced Encryption Standard with Galois/Counter Mode), which provides both confidentiality and integrity. [Learn more about AES-GCM](https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-38d.pdf) |
2636
| **Integrity** | We ensure data integrity by hashing data with SHA3-512 and comparing it with the stored hash to detect any tampering. [Learn more about SHA-3](https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.202.pdf) |
2737

38+
2839
### Supported features
2940
By default RIDB is bundled with a default InMemory storage with support for write, create, update, fetch one, remove, find and count operations.
3041

@@ -39,147 +50,3 @@ By default RIDB is bundled with a default InMemory storage with support for writ
3950
| **Integrity Plugin** | Support for data has not been tampered with |
4051
| **IndexDB Storage** | Robust type safe replacement for Dexie
4152

42-
## Documentation
43-
For detailed API documentation, please visit the [RIDB Documentation](docs/README.md).
44-
45-
## Install
46-
In order to install simply run the following command
47-
npm:
48-
```
49-
npm i @trust0/ridb --save
50-
```
51-
52-
yarn:
53-
54-
```
55-
yarn add @trust0/ridb
56-
```
57-
58-
## Usage
59-
Creating your own database is pretty straight forward.
60-
61-
```javascript
62-
import {
63-
RIDB,
64-
SchemaFieldType
65-
} from '@trust0/ridb';
66-
67-
(async () => {
68-
const db = new RIDB({
69-
demo: {
70-
version: 0,
71-
primaryKey: 'id',
72-
type: SchemaFieldType.object,
73-
properties: {
74-
id: {
75-
type: SchemaFieldType.string,
76-
maxLength: 60
77-
}
78-
}
79-
}
80-
});
81-
console.log("Starting the database");
82-
await db.start({dbName: "demo"});
83-
console.log("Ok :)");
84-
})()
85-
```
86-
87-
Use with custom storage (IndexDB and InMemory)
88-
89-
```javascript
90-
import {
91-
RIDB,
92-
SchemaFieldType,
93-
StorageType
94-
} from '@trust0/ridb';
95-
96-
(async () => {
97-
const db = new RIDB({
98-
demo: {
99-
version: 0,
100-
primaryKey: 'id',
101-
type: SchemaFieldType.object,
102-
properties: {
103-
id: {
104-
type: SchemaFieldType.string,
105-
maxLength: 60
106-
}
107-
}
108-
}
109-
});
110-
console.log("Starting the database");
111-
await db.start({dbName: "demo", storage: StorageType.IndexDB //or StorageType.InMemory});
112-
console.log("Ok :)");
113-
})()
114-
```
115-
116-
## Specification
117-
118-
### Storage
119-
A valid storage must extend [BaseStorage class](https://github.com/trust0-project/RIDB/blob/main/docs/namespaces/RIDBTypes/classes/BaseStorage.md)
120-
here's some example:
121-
122-
```typescript
123-
export class InMemory<T extends SchemaTypeRecord> extends BaseStorage<T> {
124-
125-
static create<SchemasCreate extends SchemaTypeRecord>(
126-
name: string,
127-
schemas: SchemasCreate,
128-
options: any
129-
): Promise<
130-
BaseStorage<
131-
SchemasCreate
132-
>
133-
> {
134-
throw new Error("Method not implemented.");
135-
}
136-
137-
constructor(name: string, schemas: T, options: any) {
138-
super(name, schemas, options);
139-
}
140-
141-
findDocumentById(collectionName: keyof T, id: string): Promise<Doc<T[keyof T]> | null> {
142-
throw new Error("Method not implemented.");
143-
}
144-
find(collectionName: keyof T, query: QueryType<T[keyof T]>): Promise<Doc<T[keyof T]>[]> {
145-
throw new Error("Method not implemented.");
146-
}
147-
write(op: Operation<T[keyof T]>): Promise<Doc<T[keyof T]>> {
148-
throw new Error("Method not implemented.");
149-
}
150-
count(collectionName: keyof T, query: QueryType<T[keyof T]>): Promise<number> {
151-
throw new Error("Method not implemented.");
152-
}
153-
start(): Promise<void> {
154-
throw new Error("Method not implemented.");
155-
}
156-
close(): Promise<void> {
157-
throw new Error("Method not implemented.");
158-
}
159-
160-
}
161-
```
162-
163-
### Plugins
164-
Plugins extend the functionality of the database by hooking into the database lifecycle.
165-
166-
```typescript
167-
/**
168-
* A simple plugin that overrides the docCreateHook and docRecoverHook methods.
169-
*/
170-
class MySimplePlugin extends BasePlugin {
171-
constructor() {
172-
super();
173-
this.docCreateHook = (
174-
schema,
175-
migration,
176-
docs
177-
) => docs;
178-
this.docRecoverHook = (
179-
schema,
180-
migration,
181-
docs
182-
) => docs;
183-
}
184-
}
185-
```

docs/README.md

-23
This file was deleted.

docs/ridb/src/README.md

-44
This file was deleted.

0 commit comments

Comments
 (0)