Concepts, value, and typical clone scenarios — less code.
Concepts, value, and typical clone scenarios — less code.
Підготовка контенту платформи Ring
Підготовка контенту платформи Ring
Підготовка контенту платформи Ring
Manage the dual-nature opportunity marketplace with 7 endpoints supporting both offers and requests across multiple opportunity types.
The Ring Platform opportunity system supports a unique dual-nature approach:
7 Opportunity Types:
GET /api/opportunitiesList opportunities with role-aware pagination (limit, startAfter).
POST /api/opportunitiesCreate an opportunity. JSON body validated by createOpportunityBodySchema, then features/opportunities/services/create-opportunity. Returns { opportunity } with 201.
Required fields: title, briefDescription, organizationId, category, location, visibility, contactInfo.linkedEntity, contactInfo.contactAccount.
GET /api/opportunities/{id}Get opportunity details by ID.
GET /api/opportunities/searchSearch opportunities (query parameters per route implementation).
PUT /api/opportunities/{id} / PATCH /api/opportunities/{id}Update opportunity by ID (canonical HTTP path). Prefer Server Actions for UI flows in alpha.
DELETE /api/opportunities/{id}Delete opportunity.
POST /api/opportunities/uploadUpload opportunity attachments.
REST create is POST /api/opportunities (shared schema with MCP). The add-opportunity UI may still use the createOpportunity Server Action (app/_actions/opportunities.ts) for FormData; both call the same service.
API and server services use types from features/opportunities/types. Responses and server actions expose SerializedOpportunity — date fields are ISO strings (safe for JSON and React client components). The legacy Opportunity interface still documents Firestore Timestamp shapes for DB_BACKEND_MODE=firebase-full only.
DatabaseService query rows { id, data } are mapped with mapDbQueryRowToSerializedOpportunity() in features/opportunities/lib/opportunity-db-mapper.ts. Do not use lib/converters/opportunity-converter.ts on the Postgres path — that module is a Firestore-only legacy FirestoreDataConverter.
Creates, updates, deletes, and status changes call syncOpportunityDiscovery() which:
revalidateTag — invalidates unstable_cache opportunity lists (lib/cached-data.ts)revalidatePath — refreshes /[locale]/opportunities, /[locale]/opportunities/[id], and /[locale]/opportunities/myopportunity:created|updated|deleted on the opportunities channelThere is no separate search-index reindex command; discovery queries run against PostgreSQL JSONB. Tunnel publish is shared via lib/discovery/sync-discovery.ts (see Discovery mutation sync).
Use the add-opportunity form pattern with useActionState and createOpportunity from app/_actions/opportunities.ts — see API integration examples.
createOpportunity)PUT|PATCH /api/opportunities/{id}, DELETE /api/opportunities/{id}/apply REST route in alpha)Ready to post your first opportunity? Start with our Getting Started guide.
Manage the dual-nature opportunity marketplace with 7 endpoints supporting both offers and requests across multiple opportunity types.
The Ring Platform opportunity system supports a unique dual-nature approach:
7 Opportunity Types:
GET /api/opportunitiesList opportunities with role-aware pagination (limit, startAfter).
POST /api/opportunitiesCreate an opportunity. JSON body validated by createOpportunityBodySchema, then features/opportunities/services/create-opportunity. Returns { opportunity } with 201.
Required fields: title, briefDescription, organizationId, category, location, visibility, contactInfo.linkedEntity, contactInfo.contactAccount.
GET /api/opportunities/{id}Get opportunity details by ID.
GET /api/opportunities/searchSearch opportunities (query parameters per route implementation).
PUT /api/opportunities/{id} / PATCH /api/opportunities/{id}Update opportunity by ID (canonical HTTP path). Prefer Server Actions for UI flows in alpha.
DELETE /api/opportunities/{id}Delete opportunity.
POST /api/opportunities/uploadUpload opportunity attachments.
REST create is POST /api/opportunities (shared schema with MCP). The add-opportunity UI may still use the createOpportunity Server Action (app/_actions/opportunities.ts) for FormData; both call the same service.
API and server services use types from features/opportunities/types. Responses and server actions expose SerializedOpportunity — date fields are ISO strings (safe for JSON and React client components). The legacy Opportunity interface still documents Firestore Timestamp shapes for DB_BACKEND_MODE=firebase-full only.
DatabaseService query rows { id, data } are mapped with mapDbQueryRowToSerializedOpportunity() in features/opportunities/lib/opportunity-db-mapper.ts. Do not use lib/converters/opportunity-converter.ts on the Postgres path — that module is a Firestore-only legacy FirestoreDataConverter.
Creates, updates, deletes, and status changes call syncOpportunityDiscovery() which:
revalidateTag — invalidates unstable_cache opportunity lists (lib/cached-data.ts)revalidatePath — refreshes /[locale]/opportunities, /[locale]/opportunities/[id], and /[locale]/opportunities/myopportunity:created|updated|deleted on the opportunities channelThere is no separate search-index reindex command; discovery queries run against PostgreSQL JSONB. Tunnel publish is shared via lib/discovery/sync-discovery.ts (see Discovery mutation sync).
Use the add-opportunity form pattern with useActionState and createOpportunity from app/_actions/opportunities.ts — see API integration examples.
createOpportunity)PUT|PATCH /api/opportunities/{id}, DELETE /api/opportunities/{id}/apply REST route in alpha)Ready to post your first opportunity? Start with our Getting Started guide.
Manage the dual-nature opportunity marketplace with 7 endpoints supporting both offers and requests across multiple opportunity types.
The Ring Platform opportunity system supports a unique dual-nature approach:
7 Opportunity Types:
GET /api/opportunitiesList opportunities with role-aware pagination (limit, startAfter).
POST /api/opportunitiesCreate an opportunity. JSON body validated by createOpportunityBodySchema, then features/opportunities/services/create-opportunity. Returns { opportunity } with 201.
Required fields: title, briefDescription, organizationId, category, location, visibility, contactInfo.linkedEntity, contactInfo.contactAccount.
GET /api/opportunities/{id}Get opportunity details by ID.
GET /api/opportunities/searchSearch opportunities (query parameters per route implementation).
PUT /api/opportunities/{id} / PATCH /api/opportunities/{id}Update opportunity by ID (canonical HTTP path). Prefer Server Actions for UI flows in alpha.
DELETE /api/opportunities/{id}Delete opportunity.
POST /api/opportunities/uploadUpload opportunity attachments.
REST create is POST /api/opportunities (shared schema with MCP). The add-opportunity UI may still use the createOpportunity Server Action (app/_actions/opportunities.ts) for FormData; both call the same service.
API and server services use types from features/opportunities/types. Responses and server actions expose SerializedOpportunity — date fields are ISO strings (safe for JSON and React client components). The legacy Opportunity interface still documents Firestore Timestamp shapes for DB_BACKEND_MODE=firebase-full only.
DatabaseService query rows { id, data } are mapped with mapDbQueryRowToSerializedOpportunity() in features/opportunities/lib/opportunity-db-mapper.ts. Do not use lib/converters/opportunity-converter.ts on the Postgres path — that module is a Firestore-only legacy FirestoreDataConverter.
Creates, updates, deletes, and status changes call syncOpportunityDiscovery() which:
revalidateTag — invalidates unstable_cache opportunity lists (lib/cached-data.ts)revalidatePath — refreshes /[locale]/opportunities, /[locale]/opportunities/[id], and /[locale]/opportunities/myopportunity:created|updated|deleted on the opportunities channelThere is no separate search-index reindex command; discovery queries run against PostgreSQL JSONB. Tunnel publish is shared via lib/discovery/sync-discovery.ts (see Discovery mutation sync).
Use the add-opportunity form pattern with useActionState and createOpportunity from app/_actions/opportunities.ts — see API integration examples.
createOpportunity)PUT|PATCH /api/opportunities/{id}, DELETE /api/opportunities/{id}/apply REST route in alpha)Ready to post your first opportunity? Start with our Getting Started guide.