Boxes-api is an api server for a box management program.
Go to file
Steve White f5a953763a added some individual scripts to test things 2024-10-08 17:34:49 -05:00
config Updated to tests.bash, moved config.yaml to config/config.yaml for docker mount in /app/config/config.yaml 2024-10-07 10:28:16 -05:00
data Removed DB from git and updated .gitignore again 2024-10-06 14:30:16 -05:00
.gitignore Updated to tests.bash, moved config.yaml to config/config.yaml for docker mount in /app/config/config.yaml 2024-10-07 10:28:16 -05:00
ApplicationDescription.md added some individual scripts to test things 2024-10-08 17:34:49 -05:00
Dockerfile Updated to tests.bash, moved config.yaml to config/config.yaml for docker mount in /app/config/config.yaml 2024-10-07 10:28:16 -05:00
README.md added some individual scripts to test things 2024-10-08 17:34:49 -05:00
addItemToBox.bash added some individual scripts to test things 2024-10-08 17:34:49 -05:00
api_specification.md Removed front end and fixed tests 2024-10-06 12:24:39 -05:00
boxes-api Updated to tests.bash, moved config.yaml to config/config.yaml for docker mount in /app/config/config.yaml 2024-10-07 10:28:16 -05:00
config.go Initial Commit 2024-10-04 20:10:35 -05:00
db.go fixed image upload, patched up tests.bash 2024-10-06 18:02:38 -05:00
deleteItemsInBox.bash added some individual scripts to test things 2024-10-08 17:34:49 -05:00
getitems.bash added some individual scripts to test things 2024-10-08 17:34:49 -05:00
getitemsinbox.bash added some individual scripts to test things 2024-10-08 17:34:49 -05:00
go.mod Updated to tests.bash, moved config.yaml to config/config.yaml for docker mount in /app/config/config.yaml 2024-10-07 10:28:16 -05:00
go.sum Added CORS middleware 2024-10-04 22:05:30 -05:00
handlers.go added some individual scripts to test things 2024-10-08 17:34:49 -05:00
main.go added some individual scripts to test things 2024-10-08 17:34:49 -05:00
test2.bash added react frontend 2024-10-04 22:03:50 -05:00
tests.bash fixed image upload, patched up tests.bash 2024-10-06 18:02:38 -05:00

README.md

Boxes API

Overview

This is a back-end application written in Go that provides an API for managing boxes and items stored within those boxes. It uses SQLite3 as its database and supports JWT-based authentication.

Features

  • Box Management: Create, retrieve, and delete boxes.
  • Item Management: Add, retrieve, update, and delete items within boxes.
  • Image Storage: Store images associated with items.
  • JWT Authentication: Secure API access with JSON Web Tokens.
  • Configuration: Manage settings via a config.yaml file.
  • Logging: Logs user logins and box/item actions to a file.

API Documentation

See the API Specification for detailed information on endpoints, request/response formats, and authentication.

Getting Started

  1. Clone the repository:

    
    git clone https://github.com/your-username/boxes-api.git
    
    
  2. Configuration:

    • Create a config.yaml file in the project root directory.
    • Refer to the config.yaml.example file for available settings.
  3. Database Setup:

    • The database will be automatically created if it doesn't exist.
    • Configure the database path in the config.yaml file.
  4. Running the Application:

    • Build and run the Go application:
    
    go run boxes-api .
    
    
  5. Run the test script:

    
    ./tests.bash
    
    

Podman Support

Build the podman image:


podman build -t boxes-api  .

Run the podman container:


podman run  \       
  -e CONFIG="/app/config/config.yaml" \
  -v /Users/stwhite/CODE/boxes/data:/app/data \
  -v /Users/stwhite/CODE/boxes/images:/app/images \
  -v /Users/stwhite/CODE/boxes/config:/app/config \
  -p 8080:8080 \
  --name boxes-api-container \
  localhost/boxes-api
  
  ```