Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/eatonphil/dbcore
Generate applications powered by your database.
https://github.com/eatonphil/dbcore
Last synced: 13 days ago
JSON representation
Generate applications powered by your database.
- Host: GitHub
- URL: https://github.com/eatonphil/dbcore
- Owner: eatonphil
- License: mit
- Created: 2020-05-21T03:49:02.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-01-06T08:16:13.000Z (almost 2 years ago)
- Last Synced: 2024-10-13T04:12:46.016Z (27 days ago)
- Language: Go
- Homepage:
- Size: 773 KB
- Stars: 501
- Watchers: 10
- Forks: 11
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
- awesome-go - DBCore (ALPHA) - code generator build around database schemas and an API specification. Included with DBCore are templates for generating a Go REST API and React UI. (RESTful API Server builders & generators)
README
# DBCore (ALPHA)
DBCore is a code generator build around database schemas and an API
specification. Included with DBCore are templates for generating a Go
REST API and React UI.## Features and API specification
While the DBCore project can build any templates from your
database. It also defines an API specification with useful
functionality for rapidly standing up an API around your database.Because DBCore does code generation, it can build well-typed code. The
built-in Go API templates are a great example of this.But since the API specification is language-agnostic, all these
features are supported no matter what language you use to generate a
DBCore API.Major features include:
* Get one, get many, create, edit, delete endpoints
* Filtering, sorting, pagination
* JWT-based authentication, per-endpoint/method SQL filter-based authorizationUpcoming features include:
* Lua-based hooks and transformations
* SSO integration[See the docs site for more detail.](https://www.dbcore.org)
## Example
![Screenshot of list view with pagination](docs/screenshot.png)
There's a built-in notes application with non-trivial
authorization. Users belong to an org. Notes belong to a user. Notes
that are marked public don't need a session. Otherwise they can only
be viewed by other users within the same org. Only org admins or the
notes creator can modify a note.```bash
$ git clone [email protected]:eatonphil/dbcore
$ cd dbcore
$ make example-notes
$ cd ./examples/notes/api
$ ./main
INFO[0000] Starting server at :9090 pkg=server struct=Server
... in a new window ...
$ curl -X POST -d '{"username": "alex", "password": "alex", "name": "Alex"}' localhost:9090/users/new
{"id":1,"username":"alex","password":"alex","name":"Alex"}
$ curl 'localhost:9090/users?limit=25&offset=0&sortColumn=id&sortOrder=desc' | jq
{
"total": 1,
"data": [
{
"id": 1,
"username": "alex",
"password": "alex",
"name": "Alex"
},
]
}
```And to build the UI:
```
$ cd examples/notes/browser
$ yarn start
```Log in with any of the following credentials:
* admin:admin (Org 1)
* notes-admin:admin (Org 2)
* editor:editor (Org 2)## Dependencies
* Go
* PostgreSQL, MySQL or SQLite3
* .NET Core## Restrictions
There are a bunch of restrictions! Here are a few known ones. You will
discover more and you may fix them!* Only tables supported (i.e. no views)
* Only single-column foreign keys supported
* Only Go API, React UI templates provided