A backend implementation for storing and displaying commissioned artworks. This project started as a personal project for storing my commissions but after several others had asked me about the project (and an extensive refactoring effort), I decided to publish the entire backend for my site to allow others to get some use out of my code!
This backend requires several services to be connected to the application to properly work
- Minio
- Minio is selfhosted S3 instance for object storage. This could be replaced with any other service that implements the S3 protocol.
- Postgres
- Relational database used to store all information regarding commissions, entities, and files
- Redis
- Session manager for authentication
These are required environment variables
DATABASE_URL
-> postgres connection URIMINIO_ACCESS_KEY
-> stringMINIO_SECRET_KEY
-> stringMINIO_HOST
-> stringMINIO_PORT
-> numberREDIS_URL
-> redis connection URI
To setup the project once you have cloned it
- Install all project dependencies with
pnpm i
- Generate necessary database data with
pnpx prisma migrate dev
- Run
pnpm dev
to start the development server
The most direct way to interface with the data is via the data controllers. Stored in controllers
, these include methods for CRUD operations for commissions, entities, and users.
The API layer uses the controllers mentioned above, but abstracted through a set of network requests. This is useful for making raw network requests to modify the database state.
Bundled in hooks
is a set of stateful react components for modifying the database and information therein. For doing any types of queries on the frontend, this is the recommended
method for interaction.