You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-**[Redis OM](https://redis.io/docs/stack/get-started/tutorials/stack-python/)** for ORM
43
40
-**[Docker Compose](https://docs.docker.com/compose/)** for development
44
41
-**[MaterialUI](https://material-ui.com/)** for some UI elements
45
42
-**[React-Bootstrap](https://react-bootstrap.github.io/)** for some UI elements
46
-
-**[react-admin](https://github.com/marmelab/react-admin)** for the admin dashboard
47
-
- Using the same token based authentication as FastAPI backend (JWT)
48
43
-**[Pytorch/Img2Vec](https://github.com/christiansafka/img2vec)** and **[Huggingface Sentence Transformers](https://huggingface.co/sentence-transformers)** for vector embedding creation
49
44
50
45
Some inspiration was taken from this [Cookiecutter project](https://github.com/Buuntu/fastapi-react)
51
46
and turned into a SPA application instead of a separate front-end server approach.
52
47
48
+
### General Project Structure
49
+
50
+
Much inspiration taken from [tiangelo/full-stack-fastapi-template](https://github.com/tiangolo/full-stack-fastapi-template)
51
+
52
+
```
53
+
/backend
54
+
/productsearch
55
+
/api
56
+
/routes
57
+
product.py # primary API logic lives here
58
+
/db
59
+
load.py # seeds Redis DB
60
+
redis_helpers.py # redis util
61
+
/schema
62
+
# pydantic models for serialization/validation from API
63
+
/tests
64
+
/utils
65
+
config.py
66
+
spa.py # logic for serving compiled react project
67
+
main.py # entrypoint
68
+
/frontend
69
+
/public
70
+
# index, manifest, logos, etc.
71
+
/src
72
+
/config
73
+
/styles
74
+
/views
75
+
# primary components live here
76
+
77
+
api.ts # logic for connecting with BE
78
+
App.tsx # project entry
79
+
Routes.tsk # route definitions
80
+
...
81
+
/data
82
+
# folder mounted as volume in Docker
83
+
# load script auto populates initial data from S3
84
+
85
+
```
86
+
53
87
### Datasets
54
88
55
89
The dataset was taken from the the following Kaggle links.
@@ -58,12 +92,10 @@ The dataset was taken from the the following Kaggle links.
Before running the app, install [Docker Desktop](https://www.docker.com/products/docker-desktop/).
63
97
64
-
65
-
66
-
#### Redis Cloud (recommended)
98
+
#### Using Redis Cloud (recommended)
67
99
68
100
1.[Get your Redis Cloud Database](https://app.redislabs.com/) (if needed).
69
101
@@ -81,34 +113,39 @@ Before running the app, install [Docker Desktop](https://www.docker.com/products
81
113
82
114
> The benefit of this approach is that the db will persist beyond application runs. So you can make updates and re run the app without having to provision the dataset or create another search index.
83
115
84
-
#### Redis Docker
116
+
#### Using Redis Docker
85
117
```bash
86
118
$ docker compose -f docker-local-redis.yml up
87
119
```
88
120
89
-
### Customizing (optional)
90
-
You can use the Jupyter Notebook in the `data/` directory to create product embeddings and product metadata JSON files. Both files will end up stored in the `data/` directory and used when creating your own container.
91
-
92
-
Create your own containers using the `build.sh` script and then make sure to update the `.yml` file with the right image name.
121
+
## Running without docker-compose
93
122
123
+
### Run frontend
94
124
95
-
### Using a React development env
96
-
It's typically easier to write front end code in an interactive environment, testing changes in realtime.
97
-
98
-
1. Deploy the app using steps above.
99
-
2. Install NPM packages (you may need to use `npm` to install `yarn`)
125
+
1. Install NPM packages
100
126
```bash
101
-
$ cd gui/
102
-
$ yarn install --no-optional
127
+
$ cdfrontend/
128
+
$ npm install
103
129
````
104
-
4. Use `yarn` to serve the application from your machine
130
+
2. Use `npm` to serve the application from your machine
105
131
```bash
106
-
$ yarn start
132
+
$ npm run start
107
133
```
108
-
5. Navigate to `http://localhost:3000` in a browser.
134
+
3. Navigate to `http://localhost:3000`in a browser.
109
135
110
136
All changes to your local code will be reflected in your display in semi realtime.
0 commit comments