Vinylventory is a simple iOS application that lets you take inventory of these vinyls.
Note: This project is now out of date, as version 2.0 of the iOS application supports iCloud.
This project is the server you need to store and use the iOS app.
The Docker image can be pulled from Docker Hub, here (ghcr.io) or Quay.io:
# Docker Hub
docker pull canardconfit/vinylventory-backend
# ghcr.io
docker pull ghcr.io/canardconfit/vinylventory-backend
# Quay.io
docker pull quay.io/canardconfit/vinylventory-backendDocker compose file:
version: '3'
services:
vinylventory-backend:
image: canardconfit/vinylventory-backend:latest
container_name: vinylventory-backend
restart: always
env_file:
- "./environment.env"Note: Create
environment.envfile with a copy of .env.example
The script will check for necessary directories and files, run build and generate commands if needed, prompt you to initialize migrations and seed the database, and finally start the server.
Ensure you have all necessary Node.js packages installed by running:
yarnTo generate the Prisma client, run:
yarn generateThis should create a node_modules/@generated directory.
After installing the dependencies, compile the project by running:
yarn buildThis will create a dist directory containing the compiled files.
Check if the prisma/migrations directory exists. If it does not, you need to initialize the migrations to set up the database:
yarn migrate <name>You will be prompted to provide a name for the initial migration.
(Optional) If you wish to seed the database after the migration, run:
yarn seedEnsure there is a .env file in the root directory with all necessary environment variables. If this file is missing, create it and populate it with the required variables.
Once all the above steps are complete, you can start the server with:
yarn startA UUID will be generated when the server is first launched, and it will be added to the .env file. This UUID serves as an authentication token for the server. It must be updated in the .env file. You need to provide it with each request using a header like this:
Authorization: Bearer <token>Here is a cURL example:
curl --location 'http://localhost:4000/graphql' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <token>' \
--data '{"query":"query GetVinyls {\n vinyls {\n idVinyl\n catNumber\n }\n}","variables":{}}'
When you launch the iOS app, go to the settings and fill in the server URL (without a / at the end!) and the token obtained during the server startup.