Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,10 @@ docker-compose.*
**/*.test.ts*
renovate.json
Dockerfile*
*.bat
*.bat
.idea
.vscode


!data/.gitignore
!images/.gitignore
2 changes: 0 additions & 2 deletions .env

This file was deleted.

11 changes: 10 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -199,4 +199,13 @@ $RECYCLE.BIN/
*.db
*.sqlite
*.jpg
*.webp
*.webp


# project files
data/

!data/.gitkeep

images/
!images/demo.*
27 changes: 27 additions & 0 deletions .markdownlint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Example markdownlint configuration with all properties set to their default value

# Default state for all rules
default: true

# Path to configuration file to extend
extends: null

# MD013/line-length : Line length : https://github.com/DavidAnson/markdownlint/blob/v0.37.0/doc/md013.md
MD013:
# Number of characters
line_length: 140
# Number of characters for headings
heading_line_length: 140
# Number of characters for code blocks
code_block_line_length: 140
# Include code blocks
code_blocks: true
# Include tables
tables: true
# Include headings
headings: true
# Strict length checking
strict: false
# Stern length checking
stern: false

47 changes: 23 additions & 24 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,35 +1,34 @@
FROM python:alpine3.20
ARG BASE_IMAGE=docker.io/library/python:alpine3.20
FROM ${BASE_IMAGE}

# Metadata params
ARG VCS_REF
ARG BUILD_DATE

ARG GIT_COMMIT=${GITHUB_HEAD_REF}
ARG GIT_SOURCE=${GITHUB_REPOSITORY}
ENV MIMOSA_VERSION=V4-2024.09.1dev
ENV MIMOSA_DOCKER_VERSION=2024.09.2dev
WORKDIR /app
EXPOSE 5000
COPY /setup.sh /setup.sh
RUN chmod +x /setup.sh
COPY requirements.txt ./

RUN apk add --no-cache bash git curl && \
apk upgrade && \
cd /app && \
pip install --upgrade pip && \
pip install waitress && \
pip install --no-cache-dir -r requirements.txt

COPY . .

RUN /setup.sh

RUN rm -rf /setup.sh /app/setup.sh
RUN echo "$(date "+%d.%m.%Y %T") Spotlight Storage Docker ${MIMOSA_DOCKER_VERSION} Built from Spotlight Storage ${MIMOSA_VERSION}" >> /build_date.info
LABEL org.opencontainers.image.description="Mellow_Labs Inventory Management and Organization System Apparatus"
LABEL org.opencontainers.image.revision="${GIT_COMMIT}"
LABEL org.opencontainers.image.source="${GIT_SOURCE}"
LABEL org.opencontainers.image.url="https://github.com/FireMarshmellow/Spotlight_Storage"
LABEL org.opencontainers.image.licenses="MIT"
LABEL org.opencontainers.image.authors="Tomasz Burzy"

# hadolint ignore=DL3013,DL3018
RUN apk upgrade && \
apk add --no-cache bash git curl && \
pip install --no-cache-dir --upgrade pip

COPY /entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
WORKDIR /app
COPY . .
RUN pip install --no-cache-dir -r requirements.txt \
&& echo "$(date "+%d.%m.%Y %T") Spotlight Storage Docker ${MIMOSA_DOCKER_VERSION} Built from Spotlight Storage ${MIMOSA_VERSION}" >> /build_date.info

#HEALTHCHECK CMD curl --fail http://localhost:5000 || exit 1
EXPOSE 5000
HEALTHCHECK --interval=60s --timeout=5s \
CMD curl --fail http://localhost:5000 || exit 1

ENTRYPOINT ["/entrypoint.sh"]
USER nobody
ENTRYPOINT ["python", "./app.py"]
18 changes: 0 additions & 18 deletions Dockerfile.old

This file was deleted.

66 changes: 37 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,54 +1,63 @@
# Spotlight Storage - The easy way to find your parts
![Spotlight-stor](https://github.com/user-attachments/assets/65a8ce23-b271-433b-a8d6-596360a2be69)



![Spotlight-stor](https://github.com/user-attachments/assets/65a8ce23-b271-433b-a8d6-596360a2be69)

## Spotlight Storage is from [Mellow Labs](https://github.com/FireMarshmellow/M.I.M.O.S.A)
On this repo you get a ready to install on windows docker container for the MIMOSA storage system.

On this repo you get a ready to install on windows docker container for the MIMOSA storage system.
Setup time is less then 10 minutes even for beginner users.

With this you can use any WS2812 or other led's that run [WLED](https://kno.wled.ge/)
With this you can use any WS2812 or other led's that run [WLED](https://kno.wled.ge/)

## Videos
The videos are not up to date and the content in them do not match the current Spotlight Storage (old: M.I.M.O.S.A) version. But they are a good starting point to see it working and how to setup the esp and ws2812 leds.
##
[Main video](https://youtu.be/7C4i-2IqSS4)

[Step by step video](https://youtu.be/QOd1apc0Lpo)
The videos are not up to date and the content in them do not match the current Spotlight Storage (old: M.I.M.O.S.A) version.
But they are a good starting point to see it working and how to setup the esp and ws2812 leds.

* [Main video](https://youtu.be/7C4i-2IqSS4)
* [Step by step video](https://youtu.be/QOd1apc0Lpo)

## Hardware i used

[ESP32-C3](https://www.amazon.de/Waveshare-Development-ESP32-S3FH4R2-Castellated-Applications/dp/B0CHYHGYRH/ref=sr_1_3?__mk_de_DE=%C3%85M%C3%85%C5%BD%C3%95%C3%91&crid=3HT19BBR039GT&dib=eyJ2IjoiMSJ9.yV2RTYatG7l54mT4TmFs41gUutfrpBPcC-gNcJjW5yrX18ynT5ARl4Q363-yduVYFbXaiIDiG0O_OKJwcpUODORDJywTWMIIUHu_6GFNiXwqHgM4ZCQqe2FDi0h_BT4InKffRyJEq28FkhdjnfdLetRaF4Uk4hTL-Brc5Qjb8kmWcPcPNoRb4uG-FDWQU1Nj3aow_Y54AF_bpCq7385eE0SDKwWei3MRFSzsHGJvdIg.XqcFwKVecXx0t8aSXZ8k-3qn2ApPvE-6qe_Vg8m5CO4&dib_tag=se&keywords=esp32-s3+mini&qid=1723273994&sprefix=esp32-s3+mini%2Caps%2C92&sr=8-3)
* [ESP32-C3](https://www.amazon.de/Waveshare-Development-ESP32-S3FH4R2-Castellated-Applications/dp/B0CHYHGYRH/ref=sr_1_3?__mk_de_DE=%C3%85M%C3%85%C5%BD%C3%95%C3%91&crid=3HT19BBR039GT&dib=eyJ2IjoiMSJ9.yV2RTYatG7l54mT4TmFs41gUutfrpBPcC-gNcJjW5yrX18ynT5ARl4Q363-yduVYFbXaiIDiG0O_OKJwcpUODORDJywTWMIIUHu_6GFNiXwqHgM4ZCQqe2FDi0h_BT4InKffRyJEq28FkhdjnfdLetRaF4Uk4hTL-Brc5Qjb8kmWcPcPNoRb4uG-FDWQU1Nj3aow_Y54AF_bpCq7385eE0SDKwWei3MRFSzsHGJvdIg.XqcFwKVecXx0t8aSXZ8k-3qn2ApPvE-6qe_Vg8m5CO4&dib_tag=se&keywords=esp32-s3+mini&qid=1723273994&sprefix=esp32-s3+mini%2Caps%2C92&sr=8-3)

[LEDs](https://www.amazon.de/BTF-LIGHTING-Individuell-adressierbar-Vollfarbiger-DIY-Projekte/dp/B088BPGMXB/ref=sr_1_1_sspa?dib=eyJ2IjoiMSJ9.PnDQdOUPg0UohlqZWxHQ8xYtwlm0N3cqEYbM29-REkcFFp9UB1Dpmwter90G4I3xpW5k3PxKchdsn5po5skd0NmraUfUk1Z0m6hhIzBw8DHe135MoTHnt8yXO20BuzfVKimMGoHR81c-6jKIZwOG8GXNTYY077dAJ_CyzHpVEKXWE1WTF9WiD2xEmnyKsdQoKSUqKqMxmGJsM9DwHy0iucC5qQfnJrEKCsChlFBLzvCyiBcP6sdf3W7pgMddlRcIAkP-XPp3WV2RBak6UxZTPv49qdQzKoJFiCnQfBfhBgY.qLxtFwyIAQ7sA-UBBsXBx2MR-kBGaU0054Z07bD3TGg&dib_tag=se&keywords=Ws2812b+Led+Strip&qid=1723274094&sr=8-1-spons&sp_csd=d2lkZ2V0TmFtZT1zcF9hdGY&psc=1)
* [LEDs](https://www.amazon.de/BTF-LIGHTING-Individuell-adressierbar-Vollfarbiger-DIY-Projekte/dp/B088BPGMXB/ref=sr_1_1_sspa?dib=eyJ2IjoiMSJ9.PnDQdOUPg0UohlqZWxHQ8xYtwlm0N3cqEYbM29-REkcFFp9UB1Dpmwter90G4I3xpW5k3PxKchdsn5po5skd0NmraUfUk1Z0m6hhIzBw8DHe135MoTHnt8yXO20BuzfVKimMGoHR81c-6jKIZwOG8GXNTYY077dAJ_CyzHpVEKXWE1WTF9WiD2xEmnyKsdQoKSUqKqMxmGJsM9DwHy0iucC5qQfnJrEKCsChlFBLzvCyiBcP6sdf3W7pgMddlRcIAkP-XPp3WV2RBak6UxZTPv49qdQzKoJFiCnQfBfhBgY.qLxtFwyIAQ7sA-UBBsXBx2MR-kBGaU0054Z07bD3TGg&dib_tag=se&keywords=Ws2812b+Led+Strip&qid=1723274094&sr=8-1-spons&sp_csd=d2lkZ2V0TmFtZT1zcF9hdGY&psc=1)

## Features
- inventory management
- search
- locate items
- sort items in groups
- set up multible storage locations in different rooms, only wifi is needed.

* inventory management
* search
* locate items
* sort items in groups
* set up multible storage locations in different rooms, only wifi is needed.

## Install WLED on ESP devices
1. Go to WLED [installation page ](https://install.wled.me/) and select the latest release and intall it on the esp device.

1. Go to WLED [installation page](https://install.wled.me/) and select the latest release and intall it on the esp device.
2. Put in your wifi data.
3. Go to the ip address of your esp, to `Config -> LED Preferences` and set up your led's like in the video.
4. Make note of the esp ip address, you will need it later to put into your MIMOSA settings.

## Installation of Spotlight Storage with `Installation.bat` file

1. Download this Repo as zip and extract it to the location you want to install MIMOSA on your pc. (you can put it anywhere you want e.g. Downloads,Documents,Desktop,C it doesn's matter)
1. Download this Repo as zip and extract it to the location you want to install MIMOSA on your pc.
(you can put it anywhere you want e.g. Downloads,Documents,Desktop,C it doesn's matter)

2. Install and start the Docker Desktop https://www.docker.com/products/docker-desktop/
3. Docker Desktop must be startet at least once before, to set it up for the next step.
4. In the location where you have put the MIMOSA folder, open that folder, then doubble click on the file `install.bat` and let the magic happen.
5. Now if everything is correct, it will start a terminal, open Docker Desktop when it is not allready running, build the Spotlight Storage V4-Container and start it.
7. The terminal closes after 5 second automatically
8. That's it, go to `localhost:5000` in any browser, you can now enjoy the easy life with Spotlight Storage.
5. Now if everything is correct, it will start a terminal, open Docker Desktop when it is not allready running,
build the Spotlight Storage V4-Container and start it.
6. The terminal closes after 5 second automatically
7. That's it, go to `localhost:5000` in any browser, you can now enjoy the easy life with Spotlight Storage.

- To get access to Spotlight Storage over other browsers in your network e.g. with your smartphone you need to find the ip address of your computer, mine is for example 192.168.1.20 and behind the ip adress you need to put in the port 5000 and this is what you put into the browser `http://yourcomputerip:5000`
* To get access to Spotlight Storage over other browsers in your network e.g. with your smartphone
you need to find the ip address of your computer, mine is for example 192.168.1.20 and behind the ip adress
you need to put in the port 5000 and this is what you put into the browser `http://yourcomputerip:5000`

- Remove or turn off Spotlight Storage System with the `uninstall.bat`, no data will be lost. It just turns off docker container and removes it. If you hit `install.bat` after the `uninstall.bat` it will turn on docker container, build it and you can reach the same page and data as before.
* Remove or turn off Spotlight Storage System with the `uninstall.bat`, no data will be lost.
It just turns off docker container and removes it. If you hit `install.bat` after the `uninstall.bat`
it will turn on docker container, build it and you can reach the same page and data as before.

## Installation of Spotlight Storage with docker-compose

Expand All @@ -60,14 +69,14 @@ Spotlight Storage requires Docker Compose version 2.x or higher.

Create a new directory to hold the `docker-compose.yml` file.

```bash
```shell
mkdir Spotlight_Storage
cd Spotlight_Storage
```

Download the [docker-compose.yml](https://raw.githubusercontent.com/FireMarshmellow/Spotlight_Storage/main/docker-compose.yml) file.

```bash
```shell
wget -O docker-compose.yml https://raw.githubusercontent.com/FireMarshmellow/Spotlight_Storage/main/docker-compose.yml
```

Expand All @@ -77,11 +86,10 @@ or download the files manually from the repository.

From the directory where the `docker-compose.yml` file is located, run the following command:

```bash
```shell
docker compose up -d
```

## Dependencies

## dependencies:

- python 3.6
* python 3.6 at least, 3.10 is recommended
14 changes: 8 additions & 6 deletions app.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
# Importing necessary modules and packages
import db

import json
import os
import re
from flask import Flask, render_template, jsonify, request, send_from_directory, redirect, url_for, flash, Response

from requests import Timeout
import db
import requests
import time
import os

from flask import Flask, render_template, jsonify, request, send_from_directory, redirect, url_for, flash, Response
from requests import Timeout
from werkzeug.utils import secure_filename


# Creating a Flask application instance
app = Flask(__name__)
app.config['JSON_SORT_KEYS'] = False
Expand All @@ -20,7 +22,7 @@
app.timeout = 5
app.standbyColor = "#00ff00"
app.locateColor = "#00ff00"
app.config['UPLOAD_FOLDER'] = './images'
app.config['UPLOAD_FOLDER'] = os.path.join('.','images')
app.previous_positions = []
app.request_amount = 0

Expand Down
4 changes: 2 additions & 2 deletions db.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from collections import Counter

# Define the path for the combined database
COMBINED_DATABASE = 'data/combined_data.db'
COMBINED_DATABASE = os.path.join('data','combined_data.db')


def create_combined_db():
Expand Down Expand Up @@ -492,7 +492,7 @@ def perform_migration():

def move_db_to_data_dir():
main_dir_db = 'combined_data.db' # The original path in the main directory
data_dir_db = 'data/combined_data.db' # The new path inside the data directory
data_dir_db = os.path.join('data', 'combined_data.db') # The new path inside the data directory

# Check if the database exists in the main directory
if os.path.exists(main_dir_db):
Expand Down
8 changes: 5 additions & 3 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
services:
spotlight-storage:
read_only: true
stop_signal: SIGINT # https://github.com/docker/compose/issues/4199#issuecomment-426109482
environment:
- TRANSLATIONS_DIR=/app/static/translations
image: mellowlabs/spotlight_storage:dev
ports:
- "5000:5000"
restart: on-failure
volumes:
- ./data:/app/data
- ./images:/app/images
- ./logs:/app/logs
- ./data:/app/data:rw
- ./images:/app/images:rw
- ./logs:/app/logs:rw
- ./static/translations:/app/static/translations:ro
9 changes: 0 additions & 9 deletions entrypoint.sh

This file was deleted.

Empty file added logs/.gitkeep
Empty file.
25 changes: 0 additions & 25 deletions setup.py

This file was deleted.

6 changes: 0 additions & 6 deletions setup.sh

This file was deleted.