@@ -34,45 +34,121 @@ If you like this repo or found it helpful, please give it a star. Thanks!
34
34
35
35
## How to run
36
36
37
- ### Docker start
37
+ ### Run on local system
38
38
39
+ #### Start dependencies on docker
40
+ ``` bash
41
+ docker compose -f " docker/docker-compose.yml" up -d setup elasticsearch kibana filebeat postgres pgadmin redis prometheus node-exporter alertmanager grafana
39
42
```
40
- docker compose -f "docker/docker-compose.yml" up -d --build
43
+
44
+ #### Install swagger and run app
45
+ ``` bash
46
+ cd src
47
+ go install github.com/swaggo/swag/cmd/swag@latest
48
+ cd src/cmd
49
+ go run main.go
50
+ ```
51
+
52
+ ##### Address: [ http://localhost:5005 ] ( http://localhost:5005 )
53
+
54
+ #### Stop
55
+ ```
56
+ docker compose -f "docker/docker-compose.yml" down
57
+ ```
58
+
59
+ #### Examples
60
+
61
+ ##### Login
41
62
```
63
+ curl -X 'POST' \
64
+ 'http://localhost:5005/api/v1/users/login-by-username' \
65
+ -H 'accept: application/json' \
66
+ -H 'Content-Type: application/json' \
67
+ -d '{
68
+ "password": "12345678",
69
+ "username": "admin"
70
+ }'
71
+ ```
72
+
73
+ ##### Sample filters request body
42
74
43
- #### Web API
75
+ ###### City filter and sort
76
+
77
+ ```
78
+ {
79
+ "filter": {
80
+ "Name": {
81
+ "filterType": "text",
82
+ "from": "t",
83
+ "type": "contains"
84
+ }
85
+ },
86
+ "pageNumber": 1,
87
+ "pageSize": 10,
88
+ "sort": [
89
+ {
90
+ "colId": "name",
91
+ "sort": "desc"
92
+ }
93
+ ]
94
+ }
95
+ ```
44
96
45
- ##### Run local manually [ http://localhost:5005 ] ( http://localhost:5005 )
46
97
47
- ##### Run in docker [ http://localhost:9001 ] ( http://localhost:9001 )
98
+ ###### City in range filter
48
99
49
100
```
50
- Token Url: http://localhost:5005/api/v1/users/login-by-username
101
+ {
102
+ "filter": {
103
+ "Id": { // Column name
104
+ "filterType": "number", // number, text,...
105
+ "from": "1",
106
+ "to": "7",
107
+ "type": "inRange" // contains, equals,...
108
+ }
109
+ },
110
+ "pageNumber": 1,
111
+ "pageSize": 10,
112
+ "sort": [
113
+ {
114
+ "colId": "name",
115
+ "sort": "desc"
116
+ }
117
+ ]
118
+ }
119
+ ```
120
+
121
+ ### Run project with dependencies on Docker
122
+
123
+ ```
124
+ docker compose -f "docker/docker-compose.yml" up -d --build
125
+ ```
126
+
127
+ #### Web API Run in docker [ http://localhost:9001 ] ( http://localhost:9001 )
128
+
129
+ ```
130
+ Token Url: http://localhost:9001/api/v1/users/login-by-username
51
131
Username: admin
52
132
Password: 12345678
53
133
```
54
134
55
- #### Kibana
56
-
57
- ##### [ http://localhost:5601 ] ( http://localhost:5601 )
135
+ #### Kibana [ http://localhost:5601 ] ( http://localhost:5601 )
58
136
59
137
```
60
138
Username: elastic
61
139
Password: @aA123456
62
140
```
63
141
64
- #### Grafana
142
+ #### Prometheus [ http://localhost:9090 ] ( http://localhost:9090 )
65
143
66
- ##### [ http://localhost:3000 ] ( http://localhost:3000 )
144
+ #### Grafana [ http://localhost:3000 ] ( http://localhost:3000 )
67
145
68
146
```
69
147
Username: admin
70
148
Password: foobar
71
149
```
72
150
73
- #### PgAdmin
74
-
75
- ##### [ http://localhost:8090 ] ( http://localhost:8090 )
151
+ #### PgAdmin [ http://localhost:8090 ] ( http://localhost:8090 )
76
152
77
153
```
78
154
Username: h.naimaei@gmail.com
@@ -88,14 +164,10 @@ Username: postgres
88
164
Password: admin
89
165
```
90
166
91
- #### Prometheus
92
-
93
- ##### [ http://localhost:9090 ] ( http://localhost:9090 )
94
-
95
167
### Docker Stop
96
168
97
169
```
98
- docker compose --file 'docker/docker-compose.yml' --project-name 'docker' down
170
+ docker compose -f 'docker/docker-compose.yml' --project-name 'docker' down
99
171
```
100
172
101
173
### Linux
0 commit comments