19
19
20
20
## Beginning
21
21
22
- ** Step 1:** Download project.
23
- ``` bash
24
- git clone https://github.com/adrianmarino/points.git; cd points
25
- ```
26
- ** Step 2:** Install dependencies.
27
- ``` bash
28
- mix deps.get
29
- ```
30
- ** Step 3:** Create your dev database.
31
- ``` bash
32
- mix ecto.create
33
- mix ecto.migrate
34
- MIX_ENV=dev mix ecto.reset
35
- ```
36
- ** Step 4:** Start server.
37
- ``` bash
38
- mix phoenix.server
39
- ```
22
+ ** Step 1:** Download project.
23
+ ``` bash
24
+ git clone https://github.com/adrianmarino/points.git; cd points
25
+ ```
26
+
27
+ ** Step 1** : Install dependencies.
28
+ ``` bash
29
+ $ mix deps.get
30
+ ```
31
+
32
+ ** Step 2** : Create and populate points database.
33
+ ``` bash
34
+ $ MIX_ENV=dev mix ecto.reset
35
+ ```
36
+
37
+ ** Step 3** : Start server.
38
+ ``` bash
39
+ $ mix phoenix.server
40
+ ```
41
+
42
+ ## Beginning with docker
43
+
44
+ ``` bash
45
+ $ ./docker-server-init
46
+ ```
40
47
41
48
## Guide
42
49
43
50
This guide introduces you how can interact with points platform through easy examples. Adicionally, I'll show you how to configure the server.
44
51
45
52
### Client Tasks
46
53
47
- You can interact with the rest api through mix tasks without need to use curl or any rest client. This tasks actually use a rest client as we'll see later.
54
+ You can interact with the rest api through mix tasks without need to use curl or any rest client. This tasks actually use a rest client as we'll see later.
48
55
49
- What can you do with points api?
56
+ What can you do with points api?
50
57
Run next on points directory:
51
58
``` bash
52
59
$ mix help | grep cli
@@ -63,7 +70,7 @@ mix cli.entities # Show entities. Params: token
63
70
mix cli.entities.create # Create an entity. Params: token code name
64
71
mix cli.entities.delete # Delete an entity. Params: token code
65
72
mix cli.entities.partners # Show entity partners. Params: token entity_code
66
- mix cli.entities.partners.create # Create an entity partner. Params: token partner_code entity_code
73
+ mix cli.entities.partners.create # Create an entity partner. Params: token partner_code entity_code
67
74
mix cli.entities.partners.delete # Delete an entity partner. Params: token partner_code entity_code
68
75
mix cli.entities.show # Show an entity. Params: token code
69
76
mix cli.entities.update # Update entity name. Params: token code name
@@ -125,7 +132,7 @@ $ mix cli.currencies.show OHpIUENHak9FTTAzUCtwaHB1dnk3dz09 XPT
125
132
``` bash
126
133
$ mix help | grep cli.users.create
127
134
mix cli.users.create # Create a user. Params: session_token email password first_name last_name
128
- $ mix cli.users.create OHpIUENHak9FTTAzUCtwaHB1dnk3dz09
[email protected] 1234567890
" Adrian Norberto" Marino
135
+ $ mix cli.users.create OHpIUENHak9FTTAzUCtwaHB1dnk3dz09
[email protected] 1234567890
" Adrian Norberto" Marino
129
136
22:20:53.900 [info] Response - Status: 201, Body: {
130
137
131
138
" first_name" : " Adrian Norberto" ,
@@ -252,3 +259,11 @@ To complete
252
259
253
260
### Custom Transactions
254
261
To complete
262
+
263
+ ## Docker
264
+
265
+ * docker-server-init: create/poulate database and run server in docker-compose env.
266
+ * docker-server: Run server on docker-compose env.
267
+ * docker-test: Run test on docker-compose env.
268
+ * docker-reset: Reset(drop/create/migrate/populate) database in docker-compose env.
269
+ * docker-clean: Clean(drop/create/migrate) database in docker-compose env.
0 commit comments