Skip to content

Commit 3f0276f

Browse files
committed
add demo guide
1 parent ace0964 commit 3f0276f

File tree

1 file changed

+30
-3
lines changed

1 file changed

+30
-3
lines changed

Diff for: README.md

+30-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,23 @@
1-
## Plain ruby code application
1+
## Plain ruby code application with Rails taste
22

3-
We usually have to create plain ruby code or microservices using a database dependency. This code is an starting point for this. The magic in this repo consists in including the power of Rake tasks and ActiveRecord library.
3+
We usually have to create plain ruby code a database dependency. This code is an starting point for this.
44

5-
E.g., whether you need to create an API, you can start with the code in `bin/serve` where you will find a sinatra web endpoint responding the content of a database table.
5+
The magic in this repo consists in:
6+
7+
* You configure your database in a `config/database.yml` file like when you are on Rails.
8+
* You add your migrations in the folder `db/migrate/` like when you are on Rails.
9+
* You can add your __seeds__ in the file `db/seeds.rb` like when you are on Rails
10+
* It includes the power of database Rake tasks for ActiveRecord library so you can run `rake db:migrate` and an automatic `schema.rb` file will be created.
11+
12+
BUT you will be using just PLAIN ruby code!
13+
14+
### Also, a Microservice starting point
15+
16+
Furthermore, whether you need to create an API, you can use this repo as an starting point.
17+
18+
In fact, the demo prepared in this repo consists in a web microservice including a __sinatra__ endpoint which will respond with data persisted in the database.
19+
20+
Follow next steps to start the web microservice.
621

722
### Instalation
823

@@ -12,6 +27,18 @@ docker-compose run app rake db:create db:migrate
1227
docker-compose run app rake db:seed
1328
```
1429

30+
#### Run demo
31+
32+
Follow the instalation steps and then:
33+
34+
```sh
35+
docker-compose up
36+
```
37+
38+
Open a web browser and visit http://localhost:8888/
39+
40+
You will receive a JSON response with the data created throw the `db/seeds.rb` file.
41+
1542
### Take a look at the available rake tasks
1643

1744
```sh

0 commit comments

Comments
 (0)