diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..8d50abc --- /dev/null +++ b/CONTRIBUTING.md @@ -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 +``` diff --git a/README.md b/README.md new file mode 100644 index 0000000..dc21445 --- /dev/null +++ b/README.md @@ -0,0 +1,96 @@ +

+ MySQL Meta +

+

+ RESTfull & GraphQL API to manage your MySQL Database +

+ +
+ +![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) + +
+ +## 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]() diff --git a/docker-compose.yml b/docker-compose.yml index 6787a45..9d29c07 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -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: diff --git a/docs/screenshot.png b/docs/screenshot.png new file mode 100644 index 0000000..59e8d18 Binary files /dev/null and b/docs/screenshot.png differ