• 01 - Overview
    • 02 - User Guide
    • 03 - Technical Guide
    • 04 - Operations
    • App
      • Get application hello response
        GET
    • Users
      • Kullanıcı profili
        GET
      • Update current user profile
        PATCH
      • Opsiyonel kimlik doğrulama
        GET
      • Tüm kullanıcıları listele
        GET
      • Get user by id (Admin)
        GET
      • Kullanıcı sil
        DELETE
      • Update user profile by id (Admin)
        PATCH
      • Update user email by id (Admin)
        PATCH
      • Update user role by id (Superadmin)
        PATCH
    • Auth
      • Token yenileme
        POST
      • Kullanıcı çıkışı
        POST
      • Request OTP (Login or Register)
        POST
      • Verify OTP (Login or Register)
        POST
      • Complete registration
        POST
      • Get registration status
        GET
    • Courses
      • Create a new course (Admin only)
        POST
      • Get all courses
        GET
      • Duplicate an existing course
        POST
      • Kurs detayını görüntüle
        GET
      • Update an existing course (Admin only)
        PATCH
      • Delete a course (Admin only)
        DELETE
    • Storage
      • Upload a file to storage
    • Proficiency Tests
      • Create a new proficiency test
      • List available proficiency tests
      • Duplicate an existing proficiency test
      • Update an existing proficiency test
      • Get test details
      • Delete proficiency test (Admin)
      • Get available target languages
      • Get detailed test result (Admin)
      • Delete test result (Admin)
      • Get all test results (Admin)
      • Get test results for a specific user (Admin)
      • Get current user results
      • Get detailed test result
      • Check if user has completed the test
      • Submit a proficiency test
    • Settings
      • Get setting by key
      • Create or update a setting (Admin)
    • Education Materials
      • Create a new education material with multiple PDFs and videos
      • List all education materials with optional locale filtering
      • Assign an education material to one or more users (Admin)
      • Get assigned education materials for current user
      • Get assigned education materials for a specific user (Admin)
      • Get detailed information about a specific education material
      • Update education material details and/or add new PDFs
      • Delete an education material
    • Contact
      • Submit a contact request
      • Get contact requests (Admin)
      • Reply to a contact request (Admin)
      • Delete a contact request (Admin)
      • Update contact status (Admin)
    • Admin Dashboard
      • Get aggregated dashboard metrics for admin panel
    • Schemas
      • UserDocument
      • BaseResponseDto
      • RequestOtpDto
      • VerifyOtpDto
      • HelloResponseDto
      • AuthResponseDto
      • UserProfileDto
      • UserProfileResponseDto
      • UserResponseDto
      • UpdateMeProfileDto
      • OptionalAuthResponseDto
      • PaginationDto
      • AdminUpdateUserProfileDto
      • AdminUpdateUserEmailDto
      • OtpResponseDto
      • UpdateUserRoleDto
      • DeleteResponseDto
      • RefreshTokenDto
      • LogoutResponseDto
      • RequestOtpUnifiedDto
      • VerifyOtpUnifiedDto
      • CompleteRegistrationResponseDto
      • CompleteRegistrationDto
      • RegistrationStatusResponseDto
      • CourseResponseDto
      • UploadFileResponseDto
      • LevelRangeResponseDto
      • ProficiencyOptionResponseDto
      • ProficiencyQuestionResponseDto
      • ProficiencyTestDetailResponseDto
      • OptionDto
      • QuestionDto
      • LevelRangeDto
      • CreateProficiencyTestDto
      • UpdateProficiencyTestDto
      • ProficiencyTestListResponseDto
      • TargetLanguagesResponseDto
      • UserTestAnswerResponseDto
      • UserTestResultUserSummaryDto
      • UserTestResultTestSummaryDto
      • UserTestResultResponseDto
      • DeleteUserTestResultResponseDto
      • UserTestResultListResponseDto
      • UserTestStatusSummaryDto
      • UserTestStatusResponseDto
      • DeleteProficiencyTestResponseDto
      • AnswerDto
      • SubmitTestDto
      • SettingValueResponseDto
      • SettingResponseDto
      • UpsertSettingDto
      • MaterialPdfResponseDto
      • MaterialVideoResponseDto
      • EducationMaterialResponseDto
      • CreateEducationMaterialDto
      • AssignEducationMaterialSummaryDto
      • AssignEducationMaterialDto
      • AssignedByResponseDto
      • AssignedEducationMaterialResponseDto
      • MyAssignedEducationMaterialsResponseDto
      • UserSummaryForAssignmentsDto
      • AdminUserAssignedMaterialsResponseDto
      • UpdateEducationMaterialDto
      • DeleteEducationMaterialResponseDto
      • ContactResponseDto
      • CreateContactRequestDto
      • ReplyContactRequestDto
      • UpdateContactStatusRequestDto
      • DashboardUsersOverviewDto
      • DashboardCoursesOverviewDto
      • DashboardTestsOverviewDto
      • DashboardContactsOverviewDto
      • DashboardMaterialsOverviewDto
      • DashboardOverviewDto
      • DashboardTrendDto
      • DashboardDistributionItemDto
      • DashboardLevelDistributionItemDto
      • DashboardLanguageDistributionItemDto
      • DashboardDistributionsDto
      • DashboardRecentContactDto
      • DashboardRecentResultDto
      • DashboardRecentActivityDto
      • AdminDashboardStatsResponseDto

    03 - Technical Guide

    1) Teknik Mimari#

    1.1 Frontend#

    Framework: Next.js App Router (next@16.1.1)
    Durum/Sorgu: TanStack Query
    API doğrulama: Zod contract katmanı (api/contracts/*.ts)
    Çok dil: next-intl + locale prefix (/tr, /en, /es, /de)
    Kanıt dosyaları:
    englishcamplanding/package.json
    englishcamplanding/app/[locale]/layout.tsx
    englishcamplanding/i18n/routing.ts
    englishcamplanding/api/services/*.ts

    1.2 Backend#

    Framework: NestJS (@nestjs/common@11)
    Veri katmanı: Mongoose (MongoDB)
    Auth: JWT + refresh token + blacklist
    API docs: Swagger (/api/docs, /swagger/json)
    Dosya depolama: Cloudflare R2 (S3 client)
    Kanıt dosyaları:
    englishcampbackend/package.json
    englishcampbackend/src/main.ts
    englishcampbackend/src/database/database.module.ts
    englishcampbackend/src/storage/storage.service.ts

    1.3 Global API davranışı#

    Tüm controller dönüşleri global interceptor ile standart response formatına sarılır.
    {
      "isSuccess": true,
      "statusCode": 200,
      "data": {},
      "errors": [],
      "timestamp": "2026-02-13T10:00:00.000Z"
    }
    Kanıt dosyaları:
    englishcampbackend/src/common/interceptors/response.interceptor.ts
    englishcampbackend/src/common/dto/app-base-response.ts

    2) Env Değişkenleri (Tam Liste)#

    2.1 Backend (englishcampbackend)#

    DeğişkenZorunluVarsayılan/FallbackKullanımKanıt
    PORTHayır3000API dinleme portuenglishcampbackend/src/main.ts
    NODE_ENVHayırYokException mesaj seviyesi (prod/dev)englishcampbackend/src/app/exception-filters/translation-validation-exception-filter.ts
    MONGODB_URIEvet (prod)mongodb://localhost:27017/englishcampMongo bağlantısıenglishcampbackend/src/config/mongodb.config.ts
    JWT_SECRETEvet (prod)your-secret-key-change-in-productionJWT imzalamaenglishcampbackend/src/config/jwt.config.ts
    JWT_EXPIRATIONHayır150dAccess token TTLenglishcampbackend/src/config/jwt.config.ts
    JWT_REFRESH_EXPIRATIONHayır150dRefresh token TTLenglishcampbackend/src/config/jwt.config.ts
    MAIL_HOSTEvet (mail için)YokSMTP hostenglishcampbackend/src/config/mail.config.ts
    MAIL_PORTHayır587SMTP portenglishcampbackend/src/config/mail.config.ts
    MAIL_USEREvet (mail için)YokSMTP userenglishcampbackend/src/config/mail.config.ts
    MAIL_PASSEvet (mail için)YokSMTP passenglishcampbackend/src/config/mail.config.ts
    MAIL_FROM_NAMEEvet (mail için)YokGönderen adıenglishcampbackend/src/config/mail.config.ts
    MAIL_FROM_EMAILEvet (mail için)YokGönderen e-postaenglishcampbackend/src/config/mail.config.ts
    FRONTEND_BASE_URLHayır''Materyal atama maili link base URLenglishcampbackend/src/config/mail.config.ts, englishcampbackend/src/education-materials/use-cases/assign-education-material-to-users.use-case.ts
    R2_ACCESS_KEY_IDEvet (upload için)YokR2 kimlikenglishcampbackend/src/config/r2.config.ts
    R2_SECRET_ACCESS_KEYEvet (upload için)YokR2 secretenglishcampbackend/src/config/r2.config.ts
    R2_BUCKETEvet (upload için)YokBucket adıenglishcampbackend/src/config/r2.config.ts
    R2_ENDPOINTEvet (upload için)YokR2 endpointenglishcampbackend/src/config/r2.config.ts
    R2_BUCKET_CUSTOM_DOMAINHayırYokPublic URL üretimienglishcampbackend/src/config/r2.config.ts, englishcampbackend/src/storage/storage.service.ts
    R2_ACCOUNT_IDHayırYokR2 hesap idenglishcampbackend/src/config/r2.config.ts

    2.2 Frontend (englishcamplanding)#

    DeğişkenZorunluVarsayılan/FallbackKullanımKanıt
    NEXT_PUBLIC_API_URLHayır (local fallback var)http://localhost:3000Axios base URLenglishcamplanding/api/http/axios.ts
    NEXT_PUBLIC_SITE_URLHayırhttps://englishcamplanding.vercel.appSEO/canonical/sitemap/robotsenglishcamplanding/lib/seo.ts, englishcamplanding/app/sitemap.ts, englishcamplanding/app/robots.ts
    NEXT_PUBLIC_UMAMI_WEBSITE_IDHayırKod içi default UUIDUmami analyticsenglishcamplanding/components/analytics/analytics-loader.tsx
    NEXT_PUBLIC_GA_MEASUREMENT_IDHayırYok (GA kapalı)Google Analytics scriptenglishcamplanding/components/analytics/google-analytics.tsx
    API_URLTBDTBDKodda referans bulunamadıArama: englishcamplanding içinde rg "\bAPI_URL\b"

    3) API Endpointleri (Tam Özet)#

    3.1 App#

    MethodPathAuthRequestResponse data
    GET/Public-string ("Hello World!")

    3.2 Auth (/auth)#

    MethodPathAuthRequest DTOResponse data
    POST/auth/refreshPublicRefreshTokenDtoAuthResponseDto
    POST/auth/logoutJWTRefreshTokenDto (opsiyonel body)LogoutResponseDto
    POST/auth/otp/requestPublicRequestOtpUnifiedDtoOtpResponseDto
    POST/auth/otp/verifyPublicVerifyOtpUnifiedDtoAuthResponseDto + registrationComplete
    POST/auth/complete-registrationJWTCompleteRegistrationDto{ message, user }
    GET/auth/registration-statusJWT-RegistrationStatusResponseDto

    3.3 Users / Profile#

    MethodPathAuthRequest DTO/QueryResponse data
    GET/meJWT-UserProfileResponseDto
    PATCH/me/profileJWTUpdateMeProfileDtoUserProfileResponseDto
    GET/optionalOptional JWT-{ authenticated: boolean }
    GET/usersAdminGuardGetAllUsersQueryDtoUserListResponseDto
    GET/users/:idAdminGuardPath paramUser detail object
    PATCH/admin/users/:id/profileAdminGuardAdminUpdateUserProfileDtoUserProfileResponseDto
    PATCH/admin/users/:id/emailAdminGuardAdminUpdateUserEmailDtoUserProfileResponseDto
    PATCH/users/:id/roleSuperAdminGuardUpdateUserRoleDtoUpdated user object
    DELETE/users/:idJWTPath paramvoid

    3.4 Courses (/courses)#

    MethodPathAuthRequest DTOResponse data
    POST/coursesAdminGuardCreateCourseDto + image + pdfs[] (multipart)CourseResponseDto
    POST/courses/:id/duplicateAdminGuardPath paramCourseResponseDto
    GET/coursesPublicGetAllCoursesQueryDtoCourseListResponseDto
    GET/courses/:idPublicPath paramCourseResponseDto
    PATCH/courses/:idAdminGuardUpdateCourseDto + file alanları (multipart)CourseResponseDto
    DELETE/courses/:idAdminGuardPath paramCourseResponseDto

    3.5 Proficiency Tests (/proficiency-tests)#

    MethodPathAuthRequest DTO/QueryResponse data
    POST/proficiency-testsAdminGuardCreateProficiencyTestDto + coverImage (multipart)Proficiency test dokümanı
    POST/proficiency-tests/:id/duplicateAdminGuardPath paramProficiency test dokümanı
    PATCH/proficiency-tests/:idAdminGuardUpdateProficiencyTestDto + coverImage (multipart)Proficiency test dokümanı
    GET/proficiency-testsPublicGetProficiencyTestsQueryDtoProficiency test listesi
    GET/proficiency-tests/target-languagesPublic-TargetLanguage[]
    GET/proficiency-tests/admin/results/:idAdminGuardPath paramSonuç detay (populate)
    DELETE/proficiency-tests/admin/results/:idAdminGuardPath param{ success: boolean }
    GET/proficiency-tests/admin/resultsAdminGuardpage, limit{ list, pagination }
    GET/proficiency-tests/admin/results/user/:userIdAdminGuardPath paramKullanıcı sonuç listesi
    GET/proficiency-tests/results/meJWT-Kullanıcının sonuç listesi
    GET/proficiency-tests/results/:resultIdJWTPath paramSonuç detay
    GET/proficiency-tests/:id/statusJWTPath param{ completed, result? }
    GET/proficiency-tests/:idPublicPath paramTest detay
    DELETE/proficiency-tests/:idAdminGuardPath paramboolean
    POST/proficiency-tests/:id/submitJWTSubmitTestDtoUserTestResult

    3.6 Education Materials (/education-materials)#

    MethodPathAuthRequest DTOResponse data
    POST/education-materialsJWT + AdminGuardCreateEducationMaterialDto + files[] (multipart)EducationMaterialResponseDto
    GET/education-materialsJWT + AdminGuardGetEducationMaterialsQueryDtoEducationMaterialResponseDto[]
    POST/education-materials/:id/assignJWT + AdminGuardAssignEducationMaterialDtoAssignEducationMaterialSummaryDto
    GET/education-materials/my-materialsJWT-AssignedEducationMaterialResponseDto[]
    GET/education-materials/admin/users/:userId/materialsJWT + AdminGuardPath paramAdminUserAssignedMaterialsResponseDto
    GET/education-materials/:idPublicPath paramEducationMaterialResponseDto
    PATCH/education-materials/:idJWT + AdminGuardUpdateEducationMaterialDto + files[] (multipart)EducationMaterialResponseDto
    DELETE/education-materials/:idJWT + AdminGuardPath param{ success: boolean }

    3.7 Contact (/contact)#

    MethodPathAuthRequestResponse data
    POST/contactPublicPartial<Contact>ContactDocument
    GET/contact/adminJWT + AdminGuardpage, limit{ items, total }
    POST/contact/admin/:id/replyJWT + AdminGuard{ message: string }ContactDocument
    DELETE/contact/admin/:idJWT + AdminGuardPath paramvoid
    PATCH/contact/admin/:id/statusJWT + AdminGuard{ status: ContactStatus }ContactDocument

    3.8 Settings / Admin Dashboard / Storage#

    MethodPathAuthRequest DTOResponse data
    GET/settings/:keyPublicPath param{ value: string }
    PUT/settingsJWT + AdminGuardUpsertSettingDtoSettingDocument
    GET/admin/dashboardJWT + AdminGuardGetAdminDashboardQueryDtoAdminDashboardStatsResponse
    POST/storage/uploadPublicmultipart (file, folder){ success: true, data: { key, url } }

    4) DTO Bazlı Örnek Request/Response#

    Not: Aşağıdaki response örneklerinde global BaseResponseDto wrapper kullanılmıştır.

    4.1 OTP isteği#

    {
      "email": "user@example.com",
      "language": "tr"
    }
    {
      "isSuccess": true,
      "statusCode": 200,
      "data": {
        "message": "Verification code has been sent to your email address",
        "email": "user@example.com"
      },
      "errors": [],
      "timestamp": "2026-02-13T10:00:00.000Z"
    }

    4.2 OTP doğrulama#

    {
      "email": "user@example.com",
      "code": "123456"
    }
    {
      "isSuccess": true,
      "statusCode": 200,
      "data": {
        "accessToken": "<jwt>",
        "refreshToken": "<jwt>",
        "user": {
          "id": "507f1f77bcf86cd799439011",
          "email": "user@example.com",
          "role": "user",
          "isRegistrationComplete": false
        },
        "registrationComplete": false
      },
      "errors": [],
      "timestamp": "2026-02-13T10:00:00.000Z"
    }

    4.3 Kayıt tamamlama#

    {
      "name": "John Doe",
      "age": 25,
      "gender": "female",
      "city": "Istanbul",
      "country": "Turkey",
      "countryCode": "TR",
      "phoneNumber": "+905551234567"
    }
    {
      "isSuccess": true,
      "statusCode": 200,
      "data": {
        "message": "Registration completed",
        "user": {
          "_id": "507f1f77bcf86cd799439011",
          "email": "user@example.com",
          "name": "John Doe",
          "isRegistrationComplete": true,
          "age": 25,
          "gender": "female",
          "city": "Istanbul",
          "country": "Turkey",
          "countryCode": "TR",
          "phoneNumber": "+905551234567"
        }
      },
      "errors": [],
      "timestamp": "2026-02-13T10:00:00.000Z"
    }

    4.4 Kendi profilini güncelleme#

    {
      "age": 29,
      "phone": "+905559999999",
      "gender": "other",
      "city": "Ankara",
      "country": "Turkey"
    }
    {
      "isSuccess": true,
      "statusCode": 200,
      "data": {
        "user": {
          "id": "507f1f77bcf86cd799439011",
          "email": "user@example.com",
          "age": 29,
          "gender": "other",
          "city": "Ankara",
          "country": "Turkey",
          "phoneNumber": "+905559999999"
        }
      },
      "errors": [],
      "timestamp": "2026-02-13T10:00:00.000Z"
    }

    4.5 Kurs oluşturma (multipart)#

    4.6 Proficiency test submit#

    {
      "answers": [
        { "questionIndex": 0, "selectedOptionIndex": 1 },
        { "questionIndex": 1, "selectedOptionIndex": 0 }
      ]
    }
    {
      "isSuccess": true,
      "statusCode": 201,
      "data": {
        "_id": "67abf0e7d4d26f5d9b246e99",
        "userId": "507f1f77bcf86cd799439011",
        "testId": "65abc123def4567890ab1234",
        "totalScore": 60,
        "level": "B1",
        "answers": [
          { "questionId": "0", "selectedOptionId": "1", "isCorrect": true },
          { "questionId": "1", "selectedOptionId": "0", "isCorrect": false }
        ],
        "message": "Intermediate level",
        "completedAt": "2026-02-13T10:00:00.000Z"
      },
      "errors": [],
      "timestamp": "2026-02-13T10:00:00.000Z"
    }

    4.7 Materyal atama#

    {
      "userIds": [
        "507f1f77bcf86cd799439011",
        "507f1f77bcf86cd799439012"
      ]
    }
    {
      "isSuccess": true,
      "statusCode": 200,
      "data": {
        "materialId": "65abc123def4567890ab1234",
        "requestedUserCount": 2,
        "assignedUserCount": 2,
        "skippedUserCount": 0,
        "assignedUserIds": ["507f1f77bcf86cd799439011", "507f1f77bcf86cd799439012"],
        "skippedUserIds": [],
        "emailFailedUserIds": []
      },
      "errors": [],
      "timestamp": "2026-02-13T10:00:00.000Z"
    }

    5) Veri Modeli#

    5.1 Mermaid ER#

    5.2 Koleksiyon Bazlı Özet#

    Koleksiyon/SınıfAmaçDosya
    UserKimlik, rol, profil alanlarıenglishcampbackend/src/users/schemas/user.schema.ts
    OtpOTP doğrulama kodu/TTLenglishcampbackend/src/users/schemas/otp.schema.ts
    RefreshTokenRefresh token saklamaenglishcampbackend/src/users/schemas/refresh-token.schema.ts
    BlacklistedTokenLogout sonrası access token blacklistenglishcampbackend/src/users/schemas/blacklisted-token.schema.ts
    CourseKurs içeriğienglishcampbackend/src/courses/schemas/course.schema.ts
    ProficiencyTestSınav soruları/level aralıklarıenglishcampbackend/src/proficiency-tests/schemas/proficiency-test.schema.ts
    UserTestResultKullanıcı sınav sonucuenglishcampbackend/src/proficiency-tests/schemas/user-test-result.schema.ts
    EducationMaterialPDF/video materyalenglishcampbackend/src/education-materials/schemas/education-material.schema.ts
    UserEducationMaterialAssignmentUser-material ilişki tablosuenglishcampbackend/src/education-materials/schemas/user-education-material-assignment.schema.ts
    Contactİletişim taleplerienglishcampbackend/src/common/schemas/contact.schema.ts
    SettingKey-value ayarenglishcampbackend/src/settings/schemas/setting.schema.ts

    6) Rol Matrisi (Endpoint Seviyesi)#

    Endpoint GrubuPublicUserAdminSuperadmin
    /auth/otp/*, /auth/refreshEvetEvetEvetEvet
    /auth/logout, /me, /me/profile, /auth/complete-registration, /auth/registration-statusHayırEvetEvetEvet
    /users ve /admin/users/*HayırHayırEvetEvet
    /users/:id/roleHayırHayırHayırEvet
    /courses create/update/delete/duplicateHayırHayırEvetEvet
    /proficiency-tests create/update/delete/admin-resultsHayırHayırEvetEvet
    /proficiency-tests/:id/submit, /proficiency-tests/results/*, /:id/statusHayırEvetEvetEvet
    /education-materials admin CRUD/assignHayırHayırEvetEvet
    /education-materials/my-materialsHayırEvetEvetEvet
    /contact/admin/*, /admin/dashboard, /settings PUTHayırHayırEvetEvet

    7) Rate Limiting#

    KuralLimitPencereKapsamKanıt
    DEFAULT1201 dakikaTüm endpointler (override edilmediyse)englishcampbackend/src/common/constants/rate-limit.constants.ts, englishcampbackend/src/app/app.module.ts
    AUTH_REFRESH301 dakikaPOST /auth/refreshenglishcampbackend/src/common/constants/rate-limit.constants.ts, englishcampbackend/src/auth/auth.controller.ts
    AUTH_OTP_REQUEST55 dakikaPOST /auth/otp/requestenglishcampbackend/src/common/constants/rate-limit.constants.ts, englishcampbackend/src/auth/auth.controller.ts
    AUTH_OTP_VERIFY125 dakikaPOST /auth/otp/verifyenglishcampbackend/src/common/constants/rate-limit.constants.ts, englishcampbackend/src/auth/auth.controller.ts
    CONTACT_CREATE61 saatPOST /contactenglishcampbackend/src/common/constants/rate-limit.constants.ts, englishcampbackend/src/common/controllers/contact.controller.ts
    STORAGE_UPLOAD2010 dakikaPOST /storage/uploadenglishcampbackend/src/common/constants/rate-limit.constants.ts, englishcampbackend/src/storage/storage.controller.ts
    Not:
    Rate-limit tracker x-forwarded-for öncelikli, yoksa req.ip kullanır.
    Kanıt: englishcampbackend/src/app/app.module.ts
    Modified at 2026-02-14 10:36:56
    Previous
    02 - User Guide
    Next
    04 - Operations
    Built with