Updated readme and first time running

This commit is contained in:
FrederikBaerentsen 2024-12-26 18:17:54 +01:00
parent e372018a2c
commit ba2138a1af
2 changed files with 12 additions and 1 deletions

View File

@ -23,6 +23,7 @@ A web application for organizing and tracking LEGO sets, parts, and minifigures.
```bash
git clone https://gitea.baerentsen.space/FrederikBaerentsen/LEGOOrganizer.git
cd LEGOOrganizer
mkdir static/{sets,instructions,parts}
```
2. Create a `.env` file with your configuration:
@ -31,6 +32,8 @@ REBRICKABLE_API_KEY=your_api_key_here
DOMAIN_NAME=https://your.domain.com
```
If using locally, set `DOMAIN_NAME` to `http://localhost:3333`.
3. Deploy with Docker Compose:
```bash
docker compose up -d

10
app.py
View File

@ -508,7 +508,15 @@ def generate_unique_set_unique():
@app.route('/',methods=['GET','POST'])
def index():
set_list = []
theme_file = np.loadtxt("themes.csv",delimiter=",",dtype="str")
try:
theme_file = np.loadtxt("themes.csv",delimiter=",",dtype="str")
except: #First time running, no csvs.
initialize_database()
urls = ["themes","sets","colors"]
for i in urls:
download_and_unzip("https://cdn.rebrickable.com/media/downloads/"+i+".csv.gz")
get_nil_images()
return redirect('/create')
if request.method == 'GET':