_ _ _____ ____ _____ _ ____
_/||\_ / \ /|/ \ /|/ __// __\/ __/ / \/ ___\ _/||\_
\ / | | ||| |_||| \ | \/|| \ | || \ \ /
/ \__ | |/\||| | ||| /_ | /| /_ | |\___ | __/ \
\||/ \/_\_/ \|\_/ \|\____\\_/\_\\____\ \_/\____/_\/ \||/
|/ |/
_ _ ___ _ ____ _____ _ _____ _____/\_
_/||\_\|/ \__/|\ \// / ___\/__ __\/ \ /\/ // / \|_/||\_
\ / | |\/|| \ / | \ / \ | | ||| __\| __\ \ /
/ \ | | || / / \___ | | | | \_/|| | | | / \
\||/ \_/ \|/_/ \____/ \_/ \____/\_/ \_/ \||/
You might know your stuff, but do you know mine?
Where Is My Stuff (German: Wo is' mein Scheiß?) is a makerspace inventory tool designed for use by people who may not know what is available or where it is located.
Pair a reader -> scan rfid tag -> browser opens item page
Important
Current State / Disclaimer: WIMS is currently in a minimum viable product-phase. This means it will lack a lot of quality of life features, presents a rudimentary design and might contain several bugs.
This project is quite young and depends on your input, please consider contributing! ❤️
Since this is a monorepo, so here is an overview:
- Vue Frontend The frontend is the accessed via mobile devices by scanning the displayed qr code on the reader or on a desktop
- FastAPI Backend The backend mainly acts as a link between the frontend, database and mqtt broker. It has minimal logic.
- Reader The 3D printed reader features a rfid reader and display and is a minimal frontend on its own. It sends scanned rfid tags to the broker to forward the client to the scanned item page. Powered by battery pack of a popular drill brand.
The provided docker-compose.yml includes all necessary startup configurations. Adapt it to your liking.
- Start with
docker compose up. - Visit localhost:8080
There are several ways to configure the application. These are, ordered:
-
Default configuration, which should be left as is and is overwritten by
-
config.yml, which is overwritten by-
To make changes to the
config.yml:- Copy the backend configuration:
cp docker/config.dist.yml docker/config.yml. - Make changes to
config.yml. - Use
config.ymlin the backend service mount.
- Copy the backend configuration:
-
-
Environment variables (ie. given in docker-compose.yml). These are dot-notated strings of their corresponding yml-paths, i.e.:
server: host: port: 8080
is overwritten by the env variable
server.host.port=1234
Visit the frontend and check the backend connection (default: [localhost:8080]).
To start developing, use the provided devcontainer. To start it, follow the vscode documentation on dev containers.
Configure the backend service in backend/src/config.yml. Note the linked config.dist.yml file in the /docker folder.
Then start the backend and frontend services using the provided profiles in .vscode/launch.json:
backendandfrontendfor a native environment, orbuild-servicesfor full docker setup
To run full integration tests of all services together using playwright, you have multiple options:
- Manual Native Services (Recommended atm):
- run
cd integration && npx playwright install --with-deps - run the "backend" "frontend" and "integration-tests" launch command
- run
- Native (might be useful for debugging or bugged docker setups) (WIP):
- run the "integration-tests" launch command or
docker compose -f docker-compose.yml -f integration/docker-compose.tests.yml up --build --force-recreate cd integration && npx playwright install --with-deps && npx playwright test`
- Note: currently, a playwright container is started with it, which is failing. Ignore or fix it
- Container (WIP):
- the playwright container image executes all tests and prints out results.
docker compose -f docker-compose.yml -f integration/docker-compose.tests.yml up --abort-on-container-exit --exit-code-from playwright --build docker compose -f docker-compose.yml -f integration/docker-compose.tests.yml logs playwright
- CI/CD (WIP):
- on push, tests are run automatically inside the playwright container
- Native Services (WIP)
- Add
integration/start-services.shas to the playwright config. Then run option 1.
- Add
When using the docker compose setup (all first three options), the volume of the database is reset each time the db container is restarted.
Pull requests are very much welcome! Also, consider opening an issue after looking into our open issues.
graph TD
subgraph Docker
subgraph Frontend
A[Vue Frontend]
end
subgraph Backend
B[FastAPI Backend]
end
subgraph Database
C[MongoDB]
end
subgraph MQTT
D[MQTT Broker]
end
subgraph Proxy
E[nginx]
end
end
subgraph Reader
M[MQTT Client]
end
subgraph Client
N[Web Client]
end
A --> |HTTP| B
B --> |MongoDB| C
B <--> |MQTT| D
M <--> |MQTT| D
N --> |HTTP| E
E -.-> |HTTP| A
E -.-> |HTTP| B
B --> |Server Stream| A
sequenceDiagram
participant Reader as Reader Device
participant MQTT as MQTT Broker
participant Backend as FastAPI Backend
participant DB as MongoDB
participant Frontend as Vue Frontend
Reader-->>Frontend: QR Code Scan
Frontend->>Backend: Request SSE /stream/{client-id}
Backend-->>Frontend: Server Stream
Frontend->>Backend: Request Reader SSE /stream/{reader-id}
Backend-->>Frontend: Server Stream
Reader->>MQTT: Scan Tag and Send Data
MQTT->>Backend: Forward Tag Data
Backend->>DB: Query Item Details by Tag
DB-->>Backend: Return Item Details
Backend->>MQTT: Send Item Details
MQTT->>Reader: Display Item Details
Backend->>Frontend: Send Server Stream Event with Scan Event
Frontend->>Backend: Request /items/{rfid}
Backend->>DB: Query Item Details by Tag
DB-->>Backend: Return Item Details
Backend-->>Frontend: Response
Frontend->>Frontend: Update UI with Item Details
