Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Petr Nikolas Prokop committed Dec 29, 2018
1 parent 967b37e commit ac2138f
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 80 deletions.
5 changes: 5 additions & 0 deletions DEPLOYMENT.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
# Deployment

## How to Deploy

* Assuming you have downloaded and installed the Heroku command-line utility and have initialized the app, you will need to tell Heroku to use both buildpacks via the command-line:

```shell
heroku buildpacks:set heroku/ruby
```

## CI/CD

All files are in `.ci` folder

### Gitlab CI

* You need configure `.gitlab-ci.yml` file with your Heroku credentials.

### Travis CI

* You need configure `.travis.yml` file with your Travis and Heroku credentials.
95 changes: 15 additions & 80 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
# Flick
Flick is a fullstack development platform to generate, develop and deploy web applications and microservices.

Flick is a fullstack development platform to generate, develop and deploy web applications and microservices.

* Version 0.0.1

## Table of Contents

* [Prerequisites](#prerequisites)
* [Setup](#setup)
* [Resources](#resources)
Expand All @@ -12,112 +14,45 @@ Flick is a fullstack development platform to generate, develop and deploy web ap
* [Test API with Postman](#test-api-with-postman)

## Prerequisites

* [Ruby](https://www.ruby-lang.org/en/downloads/)
* [Hanami](https://guides.hanamirb.org/introduction/getting-started/)
* [RVM](https://rvm.io/)
* [PostgreSQL](https://www.postgresql.org/docs/)

## Setup

How to run tests:
```

```bash
% bundle exec rake
```

How to run the development console:
```

```bash
% bundle exec hanami console
```

How to run the development server:
```

```bash
% bundle exec hanami server
```

How to prepare (create and migrate) DB for `development` and `test` environments:
```

```bash
% bundle exec hanami db prepare

% HANAMI_ENV=test bundle exec hanami db prepare
```

## Resources

Explore Hanami [guides](http://hanamirb.org/guides/), [API docs](http://docs.hanamirb.org/1.3.0/), or jump in [chat](http://chat.hanamirb.org) for help. Enjoy! 🌸

## Deployment

* Mainly for Heroku hosting.
* See [documentation](./DEPLOYMENT.md).

## Docker
* Basic configuration of Docker image is in Dockerfile and docker-compose.yml files in root of project.

### Docker Compose useful commands
```shell
# Builds, (re)creates, starts, and attaches to containers for a service:
$ docker-compose up

# Lists containers:
$ docker-compose ps

# Managing containers lifecycle:
$ docker-compose [start|stop|kill|restart|pause|unpause|rm] SERVICE

# Displays log output from services.:
$ docker-compose logs [SERVICE...]

# Run arbitrary commands in your services:
$ docker-compose exec SERVICE COMMAND

# Runs a one-time command against a service.:
$ docker-compose run SERVICE [COMMAND]

# Rebuilding a Docker Image:
$ docker-compose build [SERVICE...]
```

## Test API with Postman
### GraphQL
```shell
headers: "accept: application/json", "Authorization: token='OllBS57MeAW041dgR7xolpZaiO87kjnMVVK3qrtgtTbcBolB7K3TugZBuM6'"
method: POST

# Get all News
url: `/api/v1/graphql?query={allNews{id, title, content, description, errors}}`

# Get specific News
url: `/api/v1/graphql?query={news(id:1){id, title, content, description, errors}}`
```

### REST
```shell
headers: "accept: application/json", "Authorization: token='OllBS57MeAW041dgR7xolpZaiO87kjnMVVK3qrtgtTbcBolB7K3TugZBuM6'"

# Get all News
url: `/api/v1/news`
method: GET

# Get specific News
url: `/api/v1/news/:id`
method: GET

# Create News
url: `/api/v1/news`
method: POST
body: {
"title": "Title",
"description": "My news",
"content": "News content"
}

# Update News
url: `/api/v1/news/:id`
method: PUT
body: {
"title": "New Title",
"description": "My news",
"content": "Updated content"
}

# Delete News
url: `/api/v1/news/:id`
method: DELETE
```

0 comments on commit ac2138f

Please sign in to comment.