Skip to content

Web application to manage Leihladen, also known as Borrow Stores.

Notifications You must be signed in to change notification settings

ArcoMul/leihbase

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Leihbase

Web application to manage Leihladen, also known as Borrow Stores.

Important

This software is still in active development. It is being used in production for the Leihbar in Cologne, but might be lacking some (for you) critical features.

Features

  • 🏪 A webshop front-end showing borrowable products
  • 🏙️ Manage multiple borrow locations
  • 🏷️ Product category filtering
  • 🧑‍🤝‍🧑 User sign-up/login
  • 🎫 Product reservations
  • 👷 A back-end to manage reservations

Screenshots

Tech

  • Back-end and API using PocketBase
  • Front-end with server-side rendering using NuxtJS

Deployment

The repository contains fly.toml files to deploy the service as fly.io applications, but can be deployed to any server where Docker containers can run.

Development

Setup

Requirements: Docker

  • $ docker compose build
  • $ docker compose up

Initial content

After starting the service using the setup steps above. Enter some initial data to be able to use the application:

  1. Browse to http://localhost:8080/\_/ to visit the Pocketbase admin interface
  2. Create an admin account
  3. Create a location in the locations collection (make sure to set the location to as 'active')
  4. Create a product in the products collection (make sure to set the product to as 'active')
  5. Now you should be able to visit http://localhost:3000 to visit the front-end

E-mail

When starting the service with docker-compose, a mailhog container starts as well. In Pocketbase (http://localhost:8080/\_/ > Settings > Mail settings) the following SMTP values can be configured:

  • SMTP server host: mailhog
  • Port: 1025
  • Username: <empty>
  • Password: <empty>

Any sent e-mail can then be viewed in the mailhog web interface at http://localhost:8025.

Tests

Tests are configured and run using Playwright.

Setup

  • $ cd tests
  • $ pnpm install
  • pnpm exec playwright install

Run

  • pnpm run test

Configuration

Pocketbase Admin

Location

Notifications

Using the following JSON format the e-mail addresses which should receives notifications of this location can be configured:

Opening Hours

Using the following JSON format the opening hours of a location can be configured:

{
  "days": {
    "tuesday": [
      {
        "from": "18:00",
        "to": "19:00"
      },
    ],
    "friday": [
      {
        "from": "17:00",
        "to": "19:00"
      }
    ],
  },
  "except": {
    "dates": ["25-12-2024", "26-12-2024", "31-12-2024", "01-01-2025"]
  }
}

Config field

In the config JSON field of a location are the following configurations available:

config.allow_same_day_reservations - Allows a reservation to start on the same day as that another reservation ends