API Specification Overview¶
This page summarizes the backend API surface used by the Gezen mobile app.
Runtime Configuration¶
The app reads backend URLs from .env through app.config.ts and app/config/runtimeConfig.ts. Axios uses them in app/services/apiClient.ts.
| Variable | Used for | Example |
|---|---|---|
EXPO_PUBLIC_API_URL |
Main backend | http://192.168.10.135:8000/api |
EXPO_PUBLIC_TASK_PHOTO_API_URL |
Legacy task-photo backend | http://192.168.10.135:8000/api/v1 |
Rules:
- Use full URLs including the path suffix. The app calls relative paths such as
/auth/tokenagainstEXPO_PUBLIC_API_URL. - Do not configure backend URLs in
app/constants.ts; that file is legacy and unused for API calls. - After changing
.env, stop Metro and restart withnpx expo start -c. - Production sample values used in tests include
https://sales.iqvizyon.com/apiandhttps://api.iqv.com.tr/api/v1, but your environment values come from your own.env.
Setup details: setup.md
Authentication¶
All protected requests use a Bearer token from expo-secure-store:
Authorization: Bearer <token>
Auth endpoints¶
POST /auth/token- Form-encoded username/password login
GET /users/me- Returns the current authenticated user
Auth tokens are stored under user_token.
Main Resource Groups¶
Factories¶
GET /factoriesPOST /factoriesPUT /factories/{factoryId}
The current frontend derives a single factory detail from the list response when needed instead of relying on a dedicated detail endpoint.
Machines¶
GET /machinesGET /machines/{machineId}POST /machinesPUT /machines/{machineId}DELETE /machines/{machineId}GET /machines/{machineId}/images/POST /machines/{machineId}/images/DELETE /machines/{machineId}/images/{imageId}
Machine image URLs are also composed on the client from the main backend host and the legacy /uploads/machine_images/{machineId}/{fileName} path.
Machine Reference Data¶
GET /machine-brandsPOST /machine-brandsGET /machine-modelsPOST /machine-modelsGET /machine-typesPOST /machine-typesPUT /machine-types/{id}DELETE /machine-types/{id}GET /control-panel-brandsPOST /control-panel-brandsGET /control-panel-modelsPOST /control-panel-models
Tasks¶
GET /tasksGET /tasks/{taskId}POST /tasksPUT /tasks/{taskId}DELETE /tasks/{taskId}PUT /tasks/{taskId}/statusPOST /tasks/{taskId}/notes
Quotes¶
GET /devicesGET /quotesGET /quotes/{quoteId}POST /quotesPUT /quotes/{quoteId}GET /quotes/{quoteId}/proforma/POST /quotes/{quoteId}/send-proforma/GET /quote-itemsGET /quote-items/{id}POST /quote-itemsPUT /quote-items/{id}DELETE /quote-items/{id}POST /quotes/{quoteId}/create-followup-event
Calendar¶
GET /calendar-eventsGET /calendar-events/{eventId}POST /calendar-eventsPUT /calendar-events/{eventId}DELETE /calendar-events/{eventId}
Notifications¶
GET /notificationsGET /notifications/unread-countPUT /notifications/{notificationId}/readPUT /notifications/mark-all-readPOST /user/push-token
Production Catalog¶
GET /sectorsPOST /sectorsGET /production-categoriesPOST /production-categoriesGET /production-areasPOST /production-areasGET /production-modulesPOST /production-sub-modules
Users¶
GET /users
ROI and Solution Center¶
POST /simple-roi-analysis/{factoryId}- Uses a longer client timeout
POST /solution-center
Legacy Task-Photo Backend¶
Task photo operations are handled through a separate client and base URL:
POST /tasks/{taskId}/photosDELETE /tasks/{taskId}/photos/{photoId}
This backend is intentionally isolated in app/services/taskPhotoService.ts.
Frontend Compatibility Wrappers¶
The codebase still contains a few thin compatibility layers:
app/services/calendarEventApi.tswraps the canonical calendar clientapp/services/mobileApi.tsexposes older list helpers for machines and factoriesapp/services/machineApi.tsexposes a small mobile machine helper used by older screens
The canonical API modules now live under app/services/api/*.