Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Rubick65/calenderyBack/llms.txt

Use this file to discover all available pages before exploring further.

What is a Publication?

A Publication is a calendar-linked post that connects a media file, a text message, and a specific calendar date. Each publication is tied to a single user and stored as a record in the database, while its associated media file lives in Supabase Storage — CalenderyBack never buffers media through the Java application server. Publications expose social counters (likesAmount, commentaryAmount) and a per-request like boolean that indicates whether the currently authenticated user has already liked the post. Dates are split into two concepts: calendarDate (the date the user assigns on their calendar) and uploadDate (the wall-clock timestamp when the record was created).

Publication Domain Entity

FieldTypeDescription
idLongUnique publication identifier
userUserOwner of the publication
publicationFileNameStringSupabase Storage object key / signed URL for the media file
messageStringText caption attached to the post
commentaryAmountintTotal number of comments on this publication
likesAmountintTotal number of likes on this publication
publicationDatePublicationDateWrapper holding calendarDate (LocalDate) and uploadDate (LocalDateTime)
likebooleantrue if the requesting user has liked this publication

Three-Step Post Creation Flow

Creating a publication is a three-step process. The media file is uploaded directly from the client to Supabase Storage using a short-lived signed URL; the Java server only coordinates the handshake and stores the metadata.
Signed URLs keep media traffic off the Java application server entirely. The client receives a pre-authorised Supabase URL and uploads the file straight to object storage, which improves throughput and avoids unnecessary load on the API tier.
1

Request a signed upload URL

Call GET /api/publication/app/getPostUrl. CalenderyBack creates a placeholder Publication row in the database and returns a SignedUrlPostDto containing:
  • url — a short-lived Supabase Storage signed upload URL
  • idPost — the ID of the newly created placeholder publication
Hold onto idPost; you will need it in step 3.
2

Upload the file directly to Supabase

Use the url from the previous response to upload your media file with an HTTP PUT (or the method indicated by Supabase). This request goes directly to Supabase Storage — do not route it through the CalenderyBack API.
3

Attach metadata to the publication

Call PUT /api/publication/app/putPublicationData with a PostDataDto body that references the placeholder publication created in step 1:
{
  "idPost": 42,
  "message": "Beautiful sunset hike 🌄",
  "idUsuario": 7,
  "calendarDate": "2024-08-15"
}
CalenderyBack looks up the placeholder publication, attaches the message, owner, and calendar date, and marks the record as complete. The endpoint returns 200 OK with an empty body.

Endpoint Summary

MethodPathDescription
GET/api/publication/app/getPostUrlGenerate a Supabase signed upload URL and a placeholder publication ID
PUT/api/publication/app/putPublicationDataAttach message, owner, and calendar date to a placeholder publication
GET/api/publication/app/getHomePublicationsPaginated feed of publications from followed users
GET/api/publication/app/getProfilePostsPaginated calendar posts for a specific user filtered by month and year
DELETE/api/publication/app/deletePublicationDelete a publication owned by the authenticated user
Full request/response details for every endpoint are documented in the Feed page.

Build docs developers (and LLMs) love