Skip to content

Commit

Permalink
docs: app readme
Browse files Browse the repository at this point in the history
  • Loading branch information
kareemmahlees committed Oct 5, 2023
1 parent 98b93dc commit 703105b
Show file tree
Hide file tree
Showing 4 changed files with 141 additions and 2 deletions.
43 changes: 43 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
Thank you for being interested in contributing to MySQL Meta ✨

## Local Development

Start by cloning the repo:

```shell
git clone --depth=1 https://github.com/kareemmahlees/mysql-meta.git
```

the `--depth` flag specifies the number of commits you want to clone with the repo.

You will find in the [Makefile](Makefile) some useful scripts:

- watch: will start the database container and run the application in watch mode
- swag: will generate the required swagger documentation
- generate: will generate the required graphql code, e.g resolvers.

## Testing

You can setup the testing containers by running the following:

```shell
make setup_test
```

then run the tests:

```shell
make test
```

or, for verbose output:

```shell
make testv
```

after your are done, remember to cleanup afterwards:

```shell
make cleanup_test
```
96 changes: 96 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
<h1 align='center'>
MySQL Meta
</h1>
<p align='center'>
RESTfull & GraphQL API to manage your MySQL Database
</p>

<div align='center'>

![GitHub go.mod Go version (subdirectory of monorepo)](https://img.shields.io/github/go-mod/go-version/kareemmahlees/mysql-meta)
![Codecov](https://img.shields.io/codecov/c/github/kareemmahlees/mysql-meta)
![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/kareemmahlees/mysql-meta/lint.yml)

</div>

## What does it introduce

MySQL Meta introduces a RESTFull and GraphQL API that allows you to control your MySQL database through http requests, i.e creating tables and databases, adding columns and deleting columns.

![Screen shot of running application](./docs/screenshot.png)

## Installation

- ### Download the binary

You can download the binary from the [releases page](https://github.com/kareemmahlees/mysql-meta/releases).

Make sure you add the executable to your `PATH` environment variable.

- ### Go Install

You can use the `go install` command to install like so:

```shell
go install github.com/kareemmahlees/mysql-meta
```

## Running

#### Environment Variables Setup

Before starting the application, MySQL Meta expects some env vars to be set, you can find them also in the [.env.example](.env.example) file

Once you [installed](#installation) the application you can run it like so:

```shell
mysql-meta
```

MySQL Meta by default serves on port 4000, you can configure the port by passing the `--port` flag:

```shell
mysql-meta --port 4444
```

## Documentation

The API is fully documented, the REST version is documented using **Swagger Docs** and is served on `http://localhost:4000/swagger`

Regarding the GraphQL version, you can run the application and then use the GraphQL endpoint `http://localhost:4000/graphql` to introspect the schema with your favorite tool, e.g postman, insomnia, hoppscotch.

Additionally, you can playaround with the GraphQL version by jumping into the playground at `http://localhost:4000/playground`

## With Postman

MySQL Meta is well integrated with postman, you can import the collection along side it's documentation from the REST specification in the [postman collection folder](postman/collections/)

## Progress Track

- Databases
- [x] list databases
- [x] create database
- Tables
- [x] list tables
- [x] table info
- [x] create table
- [x] delete table
- [x] update table
- Queries
- [ ] execute single query
- [ ] execute multiple queries in transaction
- Views
- [ ] list views
- [ ] create views
- [ ] delete views
- [ ] query by views
- Config
- [ ] get mysql version

## Contributing

We strongly encourage anyone who wants to contribute to go ahead, not matter what skill level your are.

Contributions can be as small as suggesting a feature, reporting a bug or enhancing the docs.

For more details, please visit [CONTRIBUTING.md]()
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: "3.2"
services:
mysql-meta:
container_name: mysql-meta
mysql-meta-db:
container_name: mysql-meta-db
image: mysql:latest
restart: always
environment:
Expand Down
Binary file added docs/screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 703105b

Please sign in to comment.