[doc] add frontend README.md, update python README.md
Browse files- README.md +25 -5
- static/README.md +17 -27
README.md
CHANGED
@@ -8,6 +8,10 @@ pinned: false
|
|
8 |
license: mit
|
9 |
---
|
10 |
|
|
|
|
|
|
|
|
|
11 |
## Segment Anything models
|
12 |
|
13 |
It's possible to prepare the model files using <https://github.com/vietanhdev/samexporter/> or using the ones
|
@@ -49,7 +53,7 @@ Test it with curl using a json payload:
|
|
49 |
|
50 |
```bash
|
51 |
URL=http://localhost:7860/infer_samgis
|
52 |
-
curl -d@./events/payload_point_eolie.json -H '
|
53 |
```
|
54 |
|
55 |
or better visiting the swagger page on <http://localhost:7860/docs>
|
@@ -80,7 +84,7 @@ Test it with curl using a json payload:
|
|
80 |
|
81 |
```bash
|
82 |
URL=http://localhost:8080/2015-03-31/functions/function/invocations
|
83 |
-
curl -d@./events/payload_point_eolie.json -H '
|
84 |
```
|
85 |
|
86 |
### Publish the aws lambda docker image
|
@@ -88,10 +92,26 @@ curl -d@./events/payload_point_eolie.json -H 'accept: application/json' ${URL}
|
|
88 |
Login on aws ECR with the correct aws profile (change the example `example-docker-namespace/` repository url with the one from
|
89 |
the [ECR push command instructions page](https://eu-west-1.console.aws.amazon.com/ecr/repositories/)).
|
90 |
|
91 |
-
### Dependencies installation and local tests
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
92 |
|
93 |
-
|
94 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
95 |
|
96 |
### Tests
|
97 |
|
|
|
8 |
license: mit
|
9 |
---
|
10 |
|
11 |
+
# About this README
|
12 |
+
|
13 |
+
I tested these instructions on MacOS, but should work on linux as well.
|
14 |
+
|
15 |
## Segment Anything models
|
16 |
|
17 |
It's possible to prepare the model files using <https://github.com/vietanhdev/samexporter/> or using the ones
|
|
|
53 |
|
54 |
```bash
|
55 |
URL=http://localhost:7860/infer_samgis
|
56 |
+
curl -d@./events/payload_point_eolie.json -H 'content-type: application/json' ${URL}
|
57 |
```
|
58 |
|
59 |
or better visiting the swagger page on <http://localhost:7860/docs>
|
|
|
84 |
|
85 |
```bash
|
86 |
URL=http://localhost:8080/2015-03-31/functions/function/invocations
|
87 |
+
curl -d@./events/payload_point_eolie.json -H 'content-type: application/json' ${URL}
|
88 |
```
|
89 |
|
90 |
### Publish the aws lambda docker image
|
|
|
92 |
Login on aws ECR with the correct aws profile (change the example `example-docker-namespace/` repository url with the one from
|
93 |
the [ECR push command instructions page](https://eu-west-1.console.aws.amazon.com/ecr/repositories/)).
|
94 |
|
95 |
+
### Dependencies installation, local execution and local tests
|
96 |
+
|
97 |
+
The docker build process needs only the base dependency group plus the `aws_lambda` or `fastapi` optional one (right now I use almost only the `fastapi` version). Install also the `test` and/or `docs` groups if needed.
|
98 |
+
|
99 |
+
#### Local execution
|
100 |
+
|
101 |
+
If you need to use the SPA frontend follow the frontend instruction [here](/static/README.md).
|
102 |
+
|
103 |
+
You can run the local server using this python command:
|
104 |
|
105 |
+
```python
|
106 |
+
uvicorn wrappers.fastapi_wrapper:app --host 127.0.0.1 --port 7860
|
107 |
+
```
|
108 |
+
|
109 |
+
Change the port and/or the host ip if needed. Test it with curl using a json payload:
|
110 |
+
|
111 |
+
```bash
|
112 |
+
URL=http://localhost:7860/infer_samgis
|
113 |
+
curl -d@./events/payload_point_eolie.json -H 'content-type: application/json' ${URL}
|
114 |
+
```
|
115 |
|
116 |
### Tests
|
117 |
|
static/README.md
CHANGED
@@ -1,36 +1,26 @@
|
|
1 |
-
#
|
2 |
|
3 |
-
|
4 |
|
5 |
-
|
6 |
|
7 |
-
1.
|
8 |
-
2.
|
9 |
|
10 |
-
|
11 |
|
12 |
-
```
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
In case of problem:
|
17 |
-
|
18 |
-
1. try executing again the command `deno run -A --node-modules-dir npm:vite`
|
19 |
-
|
20 |
-
If this don't solve the problems try to
|
21 |
-
|
22 |
-
1. delete the node_modules folder
|
23 |
-
2. reinstall the npm packages with `pnpm install`
|
24 |
-
3. Run again the local development server, this time with the standard command
|
25 |
-
|
26 |
-
Before to commit try also to build using
|
27 |
-
|
28 |
-
```bash
|
29 |
pnpm build
|
|
|
30 |
```
|
31 |
|
32 |
-
|
33 |
|
34 |
-
|
35 |
-
|
36 |
-
|
|
|
|
|
|
|
|
1 |
+
# SamGIS frontend
|
2 |
|
3 |
+
This is the [SPA](https://wikipedia.org/wiki/Single-page_application) frontend for [SamGIS](https://github.com/trincadev/samgis-be).
|
4 |
|
5 |
+
## Requirements
|
6 |
|
7 |
+
1. a recent nodejs version (I'm using nodejs 20 now)
|
8 |
+
2. `pnpm`
|
9 |
|
10 |
+
Then execute from this folder (`static/`):
|
11 |
|
12 |
+
```nodejs
|
13 |
+
npm install -g pnpm
|
14 |
+
pnpm install
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
pnpm build
|
16 |
+
pnpm tailwindcss -i $PWD/src/input.css -o $PWD/dist/output.css
|
17 |
```
|
18 |
|
19 |
+
## Dependencies
|
20 |
|
21 |
+
- [driver.js](https://github.com/trincadev/driver.js/)
|
22 |
+
- [leaflet](https://leafletjs.com/)
|
23 |
+
- [tailwind](https://tailwindcss.com/)
|
24 |
+
- [typescript](https://www.typescriptlang.org/)
|
25 |
+
- [vuejs](https://vuejs.org/)
|
26 |
+
- [vite](https://vitejs.dev/)
|