Skip to content

Commit

Permalink
feat: Web UI documentation and final tweaks for 0.1.4 (#39)
Browse files Browse the repository at this point in the history
* docs: preparing README for next release

* feat: added web only Dockerfile

* feat: updated UI with bug fixes

* chore: updated oxide-ui build

* docs: updated screenshot

* docs: added video to README

* chore: preparing 0.1.4
  • Loading branch information
fcoury authored Jul 29, 2022
1 parent 6830cf7 commit dc67b97
Show file tree
Hide file tree
Showing 7 changed files with 191 additions and 145 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
description = "A database compatible with MongoDB Wire Protocol that uses PostgreSQL for backend storage."
edition = "2021"
name = "oxide"
version = "0.1.3"
version = "0.1.4"

[dependencies]
autoincrement = {version = "1", features = ["derive", "async"]}
Expand Down
11 changes: 11 additions & 0 deletions Dockerfile.web
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
ARG DATABASE_URL

FROM rust:1.62 AS builder
COPY . .
RUN cargo build --release

FROM debian:buster-slim
COPY --from=builder ./target/release/oxide ./target/release/oxide

EXPOSE 8087
CMD ["/target/release/oxide", "web", "--listen-addr", "0.0.0.0"]
51 changes: 43 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ document store, without any sharding features
On the other hand, if your use-case leverages MongoDB as a distributed database, then unfortunately this project might
not be for you. At least right now supporting multi-sharding and scale-out deployments is not part of the roadmap.

![Web UI](docs/assets/screenshot.png)

## Current status

The project was heavily inspired by [FerretDB](https://ferretdb.io) and is on its early days. The main difference is that
Expand All @@ -26,23 +28,20 @@ You can check it out here: [mongodb-language-model-rust](https://github.com/fcou
At this moment, it's being developed as a personal project, but contributors are highly welcomed. If that something you'd
be interested on, be more than welcome to contact me.

## Online demo

There's an online demo of the Web Interface live at https://demo.oxidedb.com/.

## Quickstart

Download the [latest binary](https://github.com/fcoury/oxide/releases/latest) and run it. You will need to point it to a running PostgreSQL for Oxide to use as its backend.

```
> $ ./oxide
[2022-07-13T02:56:15Z ERROR oxide] No PostgreSQL URL specified.
Use --postgres-url <url> or env var DATABASE_URL to set the connection URL and try again.
For more information use --help.
> $ ./oxide --postgres-url "postgres://postgres:postgres@localhost:5432/test"
[2022-07-13T02:57:46Z INFO oxide::server] Connecting to PostgreSQL database...
[2022-07-13T02:57:46Z INFO oxide::server] Connecting to postgres://*****:*****@localhost:5432/test...
[2022-07-13T02:57:46Z INFO oxide::server] OxideDB listening on 127.0.0.1:27017...
```

You can also set the `DATABASE_URL` environment variable or even use a `.env` file.

And with the database configuration set, you can use any [MongoDB](https://www.mongodb.com) client to connect to OxideDB, like [mongosh](https://www.mongodb.com/docs/mongodb-shell/):

```
Expand Down Expand Up @@ -74,6 +73,26 @@ test> db.col.find({ "name": "Fernanda" })
[ { _id: ObjectId("62ce3536d10f489bc82520c6"), name: 'Fernanda' } ]
```

## Quick intro

[![Intro to OxideDB](docs/assets/video.png)](https://youtu.be/kAtjBVmB1GA)

## Web interface

If you want to perform quick queries on your database, you can use the built in web interface, just start oxide with the `--web` flag:

```
> $ ./oxide --postgres-url postgres://postgres:postgres@localhost:5432/oxide
[2022-07-29T00:20:11Z INFO oxide::server] Connecting to postgres://*****:*****@localhost:5432/oxide...
[2022-07-29T00:20:11Z INFO oxide::server] OxideDB listening on 0.0.0.0:27017...
```

Now just navigate to http://localhost:5432 and you'll be able to perform quick queries.

## Running options

You can also set the `DATABASE_URL` environment variable or even use a `.env` file.

By default oxide will bind to 127.0.0.1 and port 27017. You can change those settings using the following parameters:

```
Expand All @@ -93,6 +112,15 @@ OPTIONS:
-V, --version Print version information
```

### Running with Docker

Assuming you're running a local PostgreSQL instance, you can run OxideDB with Docker with the command below.

```
docker build -t oxide .
docker run -d -p 27017:27017 -p 8087:8087 -e DATABASE_URL=postgres://postgres:[email protected]:5432/test --name oxide oxide
```

### Running from source

```shell
Expand All @@ -101,3 +129,10 @@ cd oxide
export DATABASE_URL="postgres://postgres:postgres@localhost:5432/test"
make start
```

## Web interface

![Screenshot](docs/assets/screenshot.png)

If you want to perform quick queries on your database, you can use the built in web interface.

Binary file added docs/assets/screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/video.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
270 changes: 135 additions & 135 deletions public/index.js

Large diffs are not rendered by default.

0 comments on commit dc67b97

Please sign in to comment.