Skip to content

Commit 6eb6c82

Browse files
committed
Add docs pages
1 parent 6e4c385 commit 6eb6c82

13 files changed

Lines changed: 284 additions & 145 deletions

File tree

.vitepress/config.mts

Lines changed: 37 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,51 @@ export default defineConfig({
55
title: 'Drivebase',
66
description:
77
'Next-generation cloud-agnostic file management application that empowers users to organize, upload, and access files across multiple cloud providers.',
8-
base: '/docs/',
9-
head: [['link', { rel: 'icon', href: '/favicon.ico' }]],
8+
head: [
9+
['link', { rel: 'icon', href: '/favicon.ico' }],
10+
[
11+
'script',
12+
{
13+
src: 'https://analytics.monawwar.io/script.js',
14+
'data-website-id': '3def49a3-cbce-4f3b-acb4-bd46421e9a2b',
15+
},
16+
],
17+
],
1018
themeConfig: {
11-
// https://vitepress.dev/reference/default-theme-config
1219
nav: [
1320
{ text: 'Home', link: '/' },
14-
{ text: 'Examples', link: '/markdown-examples' },
21+
{ text: 'Providers', link: '/providers' },
1522
],
1623

1724
sidebar: [
1825
{
19-
text: 'Examples',
26+
text: 'Getting Started',
27+
items: [
28+
{ text: 'Introduction', link: '/docs/introduction' },
29+
{ text: 'How it works', link: '/docs/how-it-works' },
30+
{
31+
text: 'Quickstart',
32+
link: '/docs/quick-start',
33+
},
34+
{
35+
text: 'Providers',
36+
link: '/docs/providers',
37+
},
38+
],
39+
},
40+
{
41+
text: 'Installation',
42+
items: [
43+
{ text: 'Docker', link: '/docs/installation/docker' },
44+
{ text: 'Manual', link: '/docs/installation/manual' },
45+
],
46+
},
47+
{
48+
text: 'Providers',
2049
items: [
21-
{ text: 'Getting Started', link: '/getting-started' },
22-
{ text: 'Markdown Examples', link: '/markdown-examples' },
23-
{ text: 'Runtime API Examples', link: '/api-examples' },
50+
{ text: 'Google Drive', link: '/docs/providers/google-drive' },
51+
{ text: 'Dropbox', link: '/docs/providers/dropbox' },
52+
{ text: 'OneDrive', link: '/docs/providers/one-drive' },
2453
],
2554
},
2655
],

api-examples.md

Lines changed: 0 additions & 49 deletions
This file was deleted.

docs/how-it-works.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
outline: deep
3+
---
4+
5+
# How it works
6+
7+
8+
## Overview
9+
10+
Drivebase is a tool that allows you to manage your files across multiple cloud providers. It uses OAuth to authenticate with the cloud providers and then uses the cloud provider's API to upload, download, and delete files.
11+
12+
::: info
13+
You use your own API keys to authenticate with the cloud providers. In this way, you are in control of your own data.
14+
And the data is stored in your own database.
15+
:::
16+
17+
18+
## Step 1: Connect to a cloud provider
19+
20+
From the available providers, you select the one you want to connect to by entering the required credentials.
21+
After that, you add your account to Drivebase by clicking the "Add account" button. You will be redirected to the cloud provider's website to authorize Drivebase to access your files.
22+
23+
You can check [this page](/docs/providers/) for a list of supported providers.
24+
25+
## Step 2: Create a folder structure
26+
27+
You create a folder structure on Drivebase and they are stored in the connected database.
28+
29+
## Step 3: Upload files
30+
31+
You can upload files to Drivebase by dragging and dropping them into the application or by using the upload button.
32+
Before the files are uploaded, you will be asked to select the provider you want to upload the files to.

docs/installation/docker.md

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
---
2+
outline: deep
3+
---
4+
5+
# Docker Installation
6+
7+
You can run Drivebase using Docker on your local machine or on a server. This is the recommended way to run Drivebase.
8+
There are two ways to run Drivebase using Docker:
9+
10+
1. Using Docker Compose
11+
2. Using Docker Run
12+
13+
### Using Docker Compose
14+
15+
Create a `docker-compose.yml` file and paste the following code into it:
16+
17+
```yaml
18+
version: '3'
19+
20+
services:
21+
drivebase:
22+
image: ghcr.io/drivebase/drivebase:latest
23+
ports:
24+
- 8000:8000
25+
environment:
26+
- DATABASE_URL=postgresql://postgres:postgres@postgres:5432/postgres
27+
- AUTH_SECRET=your-secret-key
28+
depends_on:
29+
- postgres
30+
31+
postgres:
32+
image: postgres:latest
33+
environment:
34+
- POSTGRES_PASSWORD=postgres
35+
volumes:
36+
- postgres_data:/var/lib/postgresql/data
37+
38+
volumes:
39+
postgres_data:
40+
```
41+
42+
Then, run the following command to start the containers:
43+
44+
```bash
45+
docker-compose up -d
46+
```
47+
48+
You can now access Drivebase at `http://localhost:8000`.
49+
50+
### Using Docker Run
51+
52+
To run Drivebase using Docker Run, you need to create a `.env` file and a running PostgreSQL instance.
53+
54+
Create a `.env` file and paste the following code into it:
55+
56+
```bash
57+
DATABASE_URL=postgresql://postgres:postgres@localhost:5432/postgres
58+
AUTH_SECRET=your-secret-key
59+
```
60+
61+
Then, run the following command to start the container:
62+
63+
```bash
64+
docker run -d -p 8000:8000 --env-file .env ghcr.io/drivebase/drivebase:latest
65+
```
66+
67+
You can now access Drivebase at `http://localhost:8000`.

docs/installation/manual.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
---
2+
outline: deep
3+
---
4+
5+
# Manual Installation
6+
7+
You can install Drivebase manually on your local machine or on a server.
8+
9+
## Prerequisites
10+
11+
- Node.js (20+)
12+
- pnpm (9+)
13+
- PostgreSQL
14+
15+
## Installation
16+
17+
1. Clone the repository
18+
19+
```bash
20+
git clone https://github.com/drivebase/drivebase.git
21+
```
22+
23+
2. Install the dependencies
24+
25+
```bash
26+
pnpm install
27+
```
28+
29+
3. Create a `.env` file and paste the following code into it:
30+
31+
```bash
32+
DATABASE_URL=postgresql://postgres:postgres@localhost:5432/postgres
33+
AUTH_SECRET=your-secret-key
34+
```
35+
36+
4. Run the following command to migrate the database:
37+
38+
```bash
39+
pnpm prisma migrate dev
40+
```
41+
42+
5. And finally, run the following command to start the server:
43+
44+
```bash
45+
pnpm nx run-many -t serve -p backend,frontend
46+
```
47+
48+
You can now access Drivebase at `http://localhost:8000`.

docs/introduction.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
outline: deep
3+
---
4+
5+
# Introduction
6+
7+
Drivebase is a cloud-agnostic file management application. It allows you to manage your files across multiple cloud providers in your own folder structure.
8+
9+
Imagine your digital life scattered across multiple clouds. Your family photos on **Google Drive**, work documents on **Dropbox**, creative projects on **OneDrive**, and archives on **Amazon S3**. Each with its own login, interface, folder structure, and pricing model.
10+
11+
You've likely experienced this frustration:
12+
**"Where did I save that file again? Was it on Drive or Dropbox?"**
13+
14+
This fragmentation creates real challenges:
15+
16+
- **Mental Overhead**: Constantly switching between services and remembering where files are stored
17+
- **Organizational Chaos**: Maintaining different folder structures across multiple platforms
18+
- **Provider Lock-In**: The painful process of migrating when a provider changes pricing or policies
19+
- **Storage Inefficiency**: Paying for premium tiers on one service while having free space on another
20+
- **Inconsistent Experience**: Learning different interfaces, search capabilities, and sharing mechanics
21+
22+
What if your files could live anywhere while appearing exactly where you want them in your own unified organizational system?
23+
24+
This is the promise of Drivebase—a single folder structure you control, with the freedom to choose where each file physically resides. You decide the storage provider. You break free from cloud fragmentation.

docs/providers.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
---
2+
outline: deep
3+
---
4+
5+
# Providers
6+
7+
Drivebase currently supports the following providers:
8+
9+
- [Google Drive](/docs/providers/google-drive.md)
10+
- [OneDrive](/docs/providers/onedrive.md)
11+
- [Dropbox](/docs/providers/dropbox.md)
12+
- [WebDAV](/docs/providers/webdav.md)
13+
14+
15+
## Adding a new provider
16+
17+
To add a new provider, you need to create a new provider in the `shared/internal/src/providers/providers` directory.
18+
19+
All the OAuth providers implement the `OAuthProvider` interface.
20+
You can always refer to the existing providers to see how to implement a new one.
21+
22+
Here is the interface of the `OAuthProvider` class:
23+
24+
```typescript
25+
export interface OAuthProvider {
26+
config: OAuthConfig;
27+
28+
// Authentication
29+
getAuthUrl(state?: string): string;
30+
getAccessToken(code: string): Promise<AuthToken>;
31+
refreshAccessToken(refreshToken: string): Promise<AuthToken>;
32+
setCredentials(credentials: Record<string, string>): Promise<void>;
33+
getUserInfo(): Promise<UserInfo>;
34+
35+
// Drivebase folder
36+
hasFolder(id: string): Promise<boolean>;
37+
createDrivebaseFolder(): Promise<string>;
38+
39+
// File operations
40+
uploadFile(folderId: string, file: Express.Multer.File): Promise<string>;
41+
downloadFile(fileId: string): Promise<Readable>;
42+
getFileMetadata(fileId: string): Promise<any>;
43+
deleteFile(path: string): Promise<boolean>;
44+
}
45+
```
46+
47+
## Pull Request
48+
49+
When you are done implementing the new provider, please create a pull request and wait for it to be merged.
50+
51+
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,4 @@
22
outline: deep
33
---
44

5-
# Getting Started
6-
5+
# Dropbox

docs/providers/google-drive.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
outline: deep
3+
---
4+
5+
# Google Drive

docs/providers/onedrive.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
outline: deep
3+
---
4+
5+
# OneDrive

0 commit comments

Comments
 (0)