### Client Development Setup Source: https://github.com/devclad-inc/devclad/blob/main/CONTRIBUTING.md Commands to install dependencies and start the local development server. ```bash npm install --global yarn ``` ```bash yarn install ``` ```bash vercel dev ``` ```bash pre-commit run -a ``` -------------------------------- ### Server Environment Setup with Docker Source: https://github.com/devclad-inc/devclad/blob/main/CONTRIBUTING.md Commands to build and start the server using Docker Compose. ```bash docker-compose build ``` ```bash docker-compose up ``` -------------------------------- ### Server Environment Setup with Poetry Source: https://github.com/devclad-inc/devclad/blob/main/CONTRIBUTING.md Commands for managing Python versions with pyenv and installing dependencies via Poetry. ```bash pyenv install 3.10.6 ``` ```bash pyenv shell 3.10.6 ``` ```bash poetry config virtualenvs.in-project true ``` ```bash poetry self update ``` ```bash poetry env use python3.10.6 ``` ```bash poetry install ``` ```bash poetry export --without-hashes --format=requirements.txt > requirements.txt ``` -------------------------------- ### Refresh Token CURL Example Source: https://github.com/devclad-inc/devclad/blob/main/_autodocs/api-reference/authentication.md Example request to the token refresh endpoint using cURL. ```bash curl -X POST -H "Content-Type: application/json" \ -d '{"refresh": ""}' \ https://api.devclad.com/auth/token/refresh/ ``` -------------------------------- ### Start the development server Source: https://github.com/devclad-inc/devclad/blob/main/apps/landing/README.md Use these commands to launch the local development environment. ```bash npm run dev # or yarn dev ``` -------------------------------- ### Login via cURL Source: https://github.com/devclad-inc/devclad/blob/main/_autodocs/api-reference/authentication.md Example command to authenticate a user using cURL. ```bash curl -X POST -H "Content-Type: application/json" \ -d '{"email": "user@example.com", "password": "securepass123"}' \ https://api.devclad.com/auth/login/ ``` -------------------------------- ### Pre-commit Hook Management Source: https://github.com/devclad-inc/devclad/blob/main/CONTRIBUTING.md Commands to install and execute pre-commit hooks. ```bash pre-commit install ``` ```bash pre-commit run -a ``` -------------------------------- ### Get Matches Response Format Source: https://github.com/devclad-inc/devclad/blob/main/_autodocs/endpoints.md The expected JSON structure returned by the GET /social/one-one/ endpoint. ```json { "matches_this_week": [{ SocialProfile objects }] } ``` -------------------------------- ### Initialize Gitpod Environment Source: https://github.com/devclad-inc/devclad/blob/main/apps/server/readme.md Commands to configure the Python environment and start the server within a Gitpod workspace. ```bash 1. pyenv install 3.10.6 2. pyenv shell 3.10.6 3. poetry env use python3.10 4. poetry shell 5. poetry install 6. python manage.py migrate 7. python manage.py runserver ``` -------------------------------- ### GET /health/ Source: https://github.com/devclad-inc/devclad/blob/main/_autodocs/endpoints.md Performs a system health check and returns an OK status. ```APIDOC ## GET /health/ ### Description Performs a system health check to verify service availability. ### Method GET ### Endpoint /health/ ### Response #### Success Response (200) - **body** (string) - "OK" ``` -------------------------------- ### Create Meeting via cURL Source: https://github.com/devclad-inc/devclad/blob/main/_autodocs/api-reference/meetings-endpoints.md Example request to create a meeting using the cURL command-line tool. ```bash curl -X PATCH -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{ "name": "DevClad 1:1 Meeting", "organizer": "alice_dev", "invites": ["bob_dev"], "type_of": "1:1 Match", "time": "2024-03-20T15:00:00Z" }' \ https://api.devclad.com/social/meetings/ ``` -------------------------------- ### GET api/getpic/ Source: https://github.com/devclad-inc/devclad/blob/main/apps/userpics/README.md Retrieves a URL for a random avatar. ```APIDOC ## GET api/getpic/ ### Description Retrieves a URL for a random avatar. ### Method GET ### Endpoint api/getpic/ ``` -------------------------------- ### GET /users/is-complete/ Source: https://github.com/devclad-inc/devclad/blob/main/_autodocs/api-reference/users-endpoints.md Check if the authenticated user's profile is complete. ```APIDOC ## GET /users/is-complete/ ### Description Check if the authenticated user's profile is complete (has non-empty "about" field). ### Method GET ### Endpoint /users/is-complete/ ### Response #### Success Response (200) - **is_complete** (boolean) - Whether the profile is complete ``` -------------------------------- ### GET /oauth/ Source: https://github.com/devclad-inc/devclad/blob/main/_autodocs/api-reference/authentication.md Initiates the GitHub OAuth login flow to authenticate or link a user account. ```APIDOC ## GET /oauth/ ### Description Redirects the user to the GitHub OAuth flow to perform social login. This endpoint creates or links a Django user account and stores GitHub tokens upon successful authentication. ### Method GET ### Endpoint /oauth/ ``` -------------------------------- ### Check Profile Completion Status Source: https://github.com/devclad-inc/devclad/blob/main/_autodocs/api-reference/errors-patterns.md Redirects the user to the profile setup flow if the profile is incomplete. ```typescript // Check if profile is complete const response = await fetch('/users/is-complete/', { headers: { 'Authorization': `Bearer ${token}` }, }); const { is_complete } = await response.json(); if (!is_complete) { // Redirect to profile setup redirectToProfileSetup(); } ``` -------------------------------- ### Example Error Response (JSON) Source: https://github.com/devclad-inc/devclad/blob/main/_autodocs/api-reference/errors-patterns.md A sample JSON payload demonstrating field-specific validation errors. ```json { "detail": "Invalid input", "email": ["Enter a valid email address."], "password": ["This password is too common."] } ``` -------------------------------- ### GET /users/profile/ Source: https://github.com/devclad-inc/devclad/blob/main/_autodocs/api-reference/users-endpoints.md Retrieve the authenticated user's profile information. ```APIDOC ## GET /users/profile/ ### Description Retrieve the authenticated user's profile information. ### Method GET ### Endpoint /users/profile/ ### Response #### Success Response (200) - **uid** (string) - UUID of the user - **avatar** (string) - URL of the avatar - **pronouns** (string) - User pronouns - **about** (string) - About section - **website** (string) - Optional website URL - **linkedin** (string) - Optional LinkedIn URL - **calendly** (string) - Optional Calendly URL ### Response Example { "uid": "string (UUID)", "avatar": "string (URL)", "pronouns": "string", "about": "string", "website": "string (URL, optional)", "linkedin": "string (URL, optional)", "calendly": "string (URL, optional)" } ``` -------------------------------- ### GET /media/{path} Source: https://github.com/devclad-inc/devclad/blob/main/_autodocs/endpoints.md Retrieve media files. Note that this endpoint is served only in development environments; production environments utilize S3. ```APIDOC ## GET /media/{path} ### Description Retrieve media files. This endpoint is intended for development use only. ### Method GET ### Endpoint /media/{path} ### Parameters #### Path Parameters - **path** (string) - Required - The file path of the media resource. ``` -------------------------------- ### GET /social/one-one/ Source: https://github.com/devclad-inc/devclad/blob/main/_autodocs/README.md Retrieves or generates weekly matches for the user. ```APIDOC ## GET /social/one-one/ ### Description Fetches the current list of matched users for the week. ### Method GET ### Endpoint /social/one-one/ ### Response #### Success Response (200) - **matches** (array) - List of matched users ``` -------------------------------- ### GET /users/status/ Source: https://github.com/devclad-inc/devclad/blob/main/_autodocs/api-reference/users-endpoints.md Retrieve the authenticated user's submission and approval status. ```APIDOC ## GET /users/status/ ### Description Retrieve the authenticated user's submission and approval status. ### Method GET ### Endpoint /users/status/ ### Request Body - None ### Response #### Success Response (200) - **status** (string) - Submitted | Not Submitted - **approved** (boolean) - Approval status #### Response Example { "status": "Submitted", "approved": true } ``` -------------------------------- ### Retrieve User Circle via GET Source: https://github.com/devclad-inc/devclad/blob/main/_autodocs/api-reference/social-endpoints.md Fetches the list of connections for a specified user. Requires a valid JWT in the Authorization header. ```json { "circle": ["username1", "username2", ...] } ``` ```bash curl -H "Authorization: Bearer " \ https://api.devclad.com/social/circle/alice_dev/get/ ``` -------------------------------- ### Retrieve 1-on-1 matches via cURL Source: https://github.com/devclad-inc/devclad/blob/main/_autodocs/api-reference/social-endpoints.md Example request to fetch weekly matches using a JWT bearer token. ```bash curl -H "Authorization: Bearer " \ https://api.devclad.com/social/one-one/ ``` -------------------------------- ### GET /users/profile/{username}/ Source: https://github.com/devclad-inc/devclad/blob/main/_autodocs/README.md View another user's profile by their username. ```APIDOC ## GET /users/profile/{username}/ ### Description View another user's profile. ### Method GET ### Endpoint /users/profile/{username}/ ### Parameters #### Path Parameters - **username** (string) - Required - The username of the profile to view ``` -------------------------------- ### GET /social/shadow/ Source: https://github.com/devclad-inc/devclad/blob/main/_autodocs/api-reference/social-endpoints.md Retrieve the list of users shadowed by the authenticated user. ```APIDOC ## GET /social/shadow/ ### Description Retrieve the list of users shadowed by the authenticated user. ### Method GET ### Endpoint /social/shadow/ ### Response #### Success Response (200) - **shadowed** (array) - List of usernames shadowed by the user. #### Response Example { "shadowed": ["username1", "username2"] } ``` -------------------------------- ### GET /{ADMIN_URL} Source: https://github.com/devclad-inc/devclad/blob/main/_autodocs/endpoints.md Access the administrative panel. The URL path is configurable via the ADMIN_URL environment variable, defaulting to /admin/. ```APIDOC ## GET /{ADMIN_URL} ### Description Access the administrative panel for the application. This endpoint is restricted to admin users only. ### Method GET ### Endpoint /{ADMIN_URL} ``` -------------------------------- ### GET /users/subscription/ Source: https://github.com/devclad-inc/devclad/blob/main/_autodocs/api-reference/users-endpoints.md Retrieve the authenticated user's subscription status and Stripe identifiers. ```APIDOC ## GET /users/subscription/ ### Description Retrieve the authenticated user's subscription status and Stripe identifiers. ### Method GET ### Endpoint /users/subscription/ ### Response #### Success Response (200) - **status** (string) - Subscription status (Free Trial | Starter | X) - **subscription_id** (string) - Stripe subscription ID (nullable) - **customer_id** (string) - Stripe customer ID (nullable) #### Response Example { "status": "Free Trial", "subscription_id": "sub_123", "customer_id": "cus_456" } ``` -------------------------------- ### GET /social/additional-prefs/ Source: https://github.com/devclad-inc/devclad/blob/main/_autodocs/api-reference/social-endpoints.md Retrieve the authenticated user's 1-on-1 meeting preferences. ```APIDOC ## GET /social/additional-prefs/ ### Description Retrieve the authenticated user's 1-on-1 meeting preferences (preferred_day, preferred_time, video_call_friendly). ### Method GET ### Endpoint /social/additional-prefs/ ### Response #### Success Response (200) - **preferred_day** (string) - Day of week - **preferred_time** (string) - Time range - **video_call_friendly** (boolean) - Video call preference #### Response Example { "preferred_day": "Monday", "preferred_time": "6AM - 12PM", "video_call_friendly": true } ``` -------------------------------- ### Retrieve 1-on-1 matches response format Source: https://github.com/devclad-inc/devclad/blob/main/_autodocs/api-reference/social-endpoints.md The expected JSON structure for a successful GET request to the one-on-one matching endpoint. ```json { "matches_this_week": [ { "id": "integer", "user": "integer", "username": "string", ... } ] } ``` -------------------------------- ### Retrieve Added Users List via GET Source: https://github.com/devclad-inc/devclad/blob/main/_autodocs/api-reference/social-endpoints.md Retrieves the list of users the authenticated user has added. This is a unidirectional relationship. ```json { "added": ["username1", "username2", ...] } ``` ```bash curl -H "Authorization: Bearer " \ https://api.devclad.com/social/added/ ``` -------------------------------- ### GET /social/one-one/ Source: https://github.com/devclad-inc/devclad/blob/main/_autodocs/endpoints.md Retrieves existing matches or generates new ones for the current user. ```APIDOC ## GET /social/one-one/ ### Description Returns existing matches if available, or generates new matches if the user is available. Note that this endpoint sets the user's availability to false after match creation. ### Method GET ### Endpoint /social/one-one/ ### Response #### Success Response (200) - **matches_this_week** (array) - A list of SocialProfile objects. ``` -------------------------------- ### GET api/avatar/ Source: https://github.com/devclad-inc/devclad/blob/main/apps/userpics/README.md Retrieves an avatar with configurable parameters. Supports streaming the SVG directly. ```APIDOC ## GET api/avatar/ ### Description Retrieves an avatar based on provided query parameters. Can return an SVG stream if the stream parameter is set to True. ### Method GET ### Endpoint api/avatar/ ### Parameters #### Query Parameters - **name** (string) - Optional - Your username. Defaults to 'Cactus Jack'. - **size** (int) - Optional - Size of the avatar. Default is 128. - **variant** (string) - Optional - Variant of the avatar (marble, pixel, beam, sunset, ring, bauhaus). Default is 'beam'. - **stream** (bool) - Optional - Stream the SVG instead of returning a URL. Default is False. ``` -------------------------------- ### GET /social/meetings/upcoming/ Source: https://github.com/devclad-inc/devclad/blob/main/_autodocs/api-reference/meetings-endpoints.md Retrieve all upcoming meetings for the authenticated user where they are either the organizer or an invitee. ```APIDOC ## GET /social/meetings/upcoming/ ### Description Retrieve all upcoming meetings for the authenticated user (as organizer or invitee). Meetings are ordered by time in ascending order. ### Method GET ### Endpoint /social/meetings/upcoming/ ### Response #### Success Response (200) - **meetings** (array) - List of meeting objects #### Response Example { "meetings": [ { "id": 1, "uid": "550e8400-e29b-41d4-a716-446655440000", "name": "Project Sync", "organizer": "user1", "invites": ["user2"], "type_of": "1:1 Match", "time": "2023-10-27T10:00:00Z", "attended": false } ] } ``` -------------------------------- ### GET /social/is-complete/ Source: https://github.com/devclad-inc/devclad/blob/main/_autodocs/api-reference/social-endpoints.md Check if the authenticated user's social profile has all required fields completed. ```APIDOC ## GET /social/is-complete/ ### Description Check if the authenticated user's social profile has all required fields completed. ### Method GET ### Endpoint /social/is-complete/ ### Response #### Success Response (200) - **is_complete** (boolean) - Whether the profile is complete ``` -------------------------------- ### Run Server with Nixpacks and Docker Source: https://github.com/devclad-inc/devclad/blob/main/apps/server/readme.md Steps to build and run the server container using Nixpacks. ```bash 0. Install using brew install railwayapp/tap/nixpacks. 1. cd apps/server 2. nixpacks build ./ --name devclad 3. docker run -it -p 127.0.0.1:8000:8000/tcp devclad ``` -------------------------------- ### GET /users/change-email/ Source: https://github.com/devclad-inc/devclad/blob/main/_autodocs/api-reference/users-endpoints.md Check if the authenticated user's email has been verified. ```APIDOC ## GET /users/change-email/ ### Description Check if the authenticated user's email has been verified. ### Method GET ### Endpoint /users/change-email/ ### Response #### Success Response (200) - **verified** (boolean) - Verification status #### Response Example { "verified": true } ``` -------------------------------- ### Configure ASGI Channel Layers Source: https://github.com/devclad-inc/devclad/blob/main/_autodocs/configuration.md Sets up the ASGI application and default in-memory channel layer for real-time features. ```python ASGI_APPLICATION = 'devclad.asgi.application' CHANNEL_LAYERS = { 'default': { 'BACKEND': 'channels.layers.InMemoryChannelLayer' } } ``` -------------------------------- ### Configure environment variables Source: https://github.com/devclad-inc/devclad/blob/main/apps/userpics/README.md Retrieves necessary credentials for Cloudflare R2 storage from environment variables. ```go accountId := os.Getenv("ACCOUNT_ID") bucketName := os.Getenv("BUCKET_NAME") accessKeyId := os.Getenv("API_ACCESS_KEY") accessKeySecret := os.Getenv("API_SECRET_KEY") ``` -------------------------------- ### GET /social/skipped/ Source: https://github.com/devclad-inc/devclad/blob/main/_autodocs/api-reference/social-endpoints.md Retrieve the list of users skipped by the authenticated user. ```APIDOC ## GET /social/skipped/ ### Description Retrieve the list of users skipped by the authenticated user. This list is cleared every 4 weeks. ### Method GET ### Endpoint /social/skipped/ ### Response #### Success Response (200) - **skipped** (array) - List of usernames skipped by the user. #### Response Example { "skipped": ["username1", "username2"] } ``` -------------------------------- ### POST /auth/login/ Source: https://github.com/devclad-inc/devclad/blob/main/_autodocs/README.md Login with credentials to receive an authentication token. ```APIDOC ## POST /auth/login/ ### Description Login with credentials. ### Method POST ### Endpoint /auth/login/ ``` -------------------------------- ### POST /auth/registration/ Source: https://github.com/devclad-inc/devclad/blob/main/_autodocs/endpoints.md Registers a new user account. ```APIDOC ## POST /auth/registration/ ### Description Creates a new user account with the provided details. ### Method POST ### Endpoint /auth/registration/ ### Request Body - **first_name** (string) - Required - **last_name** (string) - Required - **email** (string) - Required - **password1** (string) - Required - **password2** (string) - Required ### Response #### Success Response (201) - **user** (object) - Created user object - **access_token** (string) - Access token - **refresh_token** (string) - Refresh token ``` -------------------------------- ### GET /social/block/ Source: https://github.com/devclad-inc/devclad/blob/main/_autodocs/api-reference/social-endpoints.md Retrieve the list of users blocked by the authenticated user. ```APIDOC ## GET /social/block/ ### Description Retrieve the list of users blocked by the authenticated user. ### Method GET ### Endpoint /social/block/ ### Response #### Success Response (200) - **blocked** (array) - List of usernames blocked by the user. #### Response Example { "blocked": ["username1", "username2"] } ``` -------------------------------- ### GET /social/meetings/{uid}/ Source: https://github.com/devclad-inc/devclad/blob/main/_autodocs/api-reference/meetings-endpoints.md Retrieve details for a specific meeting by its UUID. ```APIDOC ## GET /social/meetings/{uid}/ ### Description Retrieve a specific meeting by UUID. The authenticated user must be in the meeting's invites list. ### Method GET ### Endpoint /social/meetings/{uid}/ ### Parameters #### Path Parameters - **uid** (string) - Required - A valid UUID string ### Response #### Success Response (200) - **meetings** (object) - The meeting details #### Response Example { "meetings": { "id": 1, "uid": "550e8400-e29b-41d4-a716-446655440000", "name": "Project Sync", "organizer": "user1", "invites": ["user2"], "type_of": "1:1 Match", "time": "2023-10-27T10:00:00Z", "attended": false } } ``` -------------------------------- ### Configure Graphene-Django for GraphQL Source: https://github.com/devclad-inc/devclad/blob/main/_autodocs/configuration.md Sets the schema path and middleware for GraphQL support using Graphene-Django. ```python GRAPHENE = { 'SCHEMA': 'devclad.schema.schema', 'MIDDLEWARE': [ 'graphene_django.debug.DjangoDebugMiddleware', ] } ``` -------------------------------- ### GET /users/profile/{username}/ Source: https://github.com/devclad-inc/devclad/blob/main/_autodocs/api-reference/users-endpoints.md Retrieve a public profile for a specific user by username. ```APIDOC ## GET /users/profile/{username}/ ### Description Retrieve a public profile for a specific user by username. ### Method GET ### Endpoint /users/profile/{username}/ ### Parameters #### Path Parameters - **username** (string) - Required - The username of the user to retrieve ### Response #### Success Response (200) - **uid** (string) - UUID - **avatar** (string) - URL - **pronouns** (string) - Pronouns - **about** (string) - About - **website** (string) - Website - **linkedin** (string) - LinkedIn - **calendly** (string) - Calendly - **first_name** (string) - First name - **last_name** (string) - Last name ``` -------------------------------- ### POST /auth/login/ Source: https://github.com/devclad-inc/devclad/blob/main/_autodocs/endpoints.md Authenticates a user and returns access and refresh tokens. ```APIDOC ## POST /auth/login/ ### Description Authenticates a user using username or email and password. Returns access and refresh tokens. ### Method POST ### Endpoint /auth/login/ ### Request Body - **username** (string) - Optional - User username - **email** (string) - Optional - User email - **password** (string) - Required - User password ### Request Example { "username": "jdoe", "password": "secret123" } ### Response #### Success Response (200) - **user** (object) - User object - **access_token** (string) - JWT access token - **refresh_token** (string) - JWT refresh token - **access_token_expiration** (datetime) - Optional - **refresh_token_expiration** (datetime) - Optional ``` -------------------------------- ### GET /social/circle/{username}/get/ Source: https://github.com/devclad-inc/devclad/blob/main/_autodocs/api-reference/social-endpoints.md Retrieve the circle (connections) of a specific user. ```APIDOC ## GET /social/circle/{username}/get/ ### Description Retrieve the circle (connections) of a specific user. ### Method GET ### Endpoint /social/circle/{username}/get/ ### Parameters #### Path Parameters - **username** (string) - Required - The username of the user whose circle is being retrieved. - **operation** (string) - Required - Must be "get". ### Response #### Success Response (200) - **circle** (array) - List of usernames in the circle. #### Response Example { "circle": ["username1", "username2"] } ``` -------------------------------- ### Registration Endpoint Request Source: https://github.com/devclad-inc/devclad/blob/main/_autodocs/endpoints.md Use this endpoint to register a new user account. Requires first name, last name, email, and password confirmation. ```json { "first_name": "string (required)", "last_name": "string (required)", "email": "string (required)", "password1": "string (required)", "password2": "string (required)" } ``` -------------------------------- ### Authenticate and Request API with httpie Source: https://github.com/devclad-inc/devclad/blob/main/_autodocs/api-reference/errors-patterns.md Uses httpie to perform authentication and manage tokens via environment variables. ```bash http POST api.devclad.com/auth/login/ \ email=user@example.com password=pass # Store token in env export TOKEN=$(http api.devclad.com/auth/login/ \ email=user@example.com password=pass | jq -r '.access_token') # Use token http GET api.devclad.com/users/profile/ \ Authorization:"Bearer $TOKEN" ``` -------------------------------- ### Fetch a random avatar in Python Source: https://github.com/devclad-inc/devclad/blob/main/apps/userpics/README.md Demonstrates how to retrieve a random avatar URL from the API and save the image locally. ```python def random_avatar(): name = str(uuid.uuid4())[:8] with open(f"media/avatars/{name}.png", "wb+") as f: url = requests.get("https://userpics.devclad.com/api/getpic") response = requests.get(url.text, stream=True) if not response.ok: raise Exception("Could not get avatar") for block in response.iter_content(1024): if not block: break f.write(block) return f"avatars/{name}.png" ``` -------------------------------- ### POST /auth/password/reset/confirm/// Source: https://github.com/devclad-inc/devclad/blob/main/_autodocs/api-reference/authentication.md Completes the password reset process using a token. ```APIDOC ## POST /auth/password/reset/confirm/// ### Description Updates the user's password using the provided reset token and user ID. ### Method POST ### Endpoint /auth/password/reset/confirm/// ### Parameters #### Path Parameters - **uidb64** (string) - Required - User ID in base64. - **token** (string) - Required - Password reset token. ### Request Body - **new_password1** (string) - Required - New password. - **new_password2** (string) - Required - Confirmation of new password. ### Response #### Success Response (200) - **detail** (string) - Confirmation message ``` -------------------------------- ### GET /social/added/ Source: https://github.com/devclad-inc/devclad/blob/main/_autodocs/api-reference/social-endpoints.md Retrieve the list of users the authenticated user has added to their circle (unidirectional). ```APIDOC ## GET /social/added/ ### Description Retrieve the list of users the authenticated user has added to their circle. This is a unidirectional list. ### Method GET ### Endpoint /social/added/ ### Response #### Success Response (200) - **added** (array) - List of usernames added by the authenticated user. #### Response Example { "added": ["username1", "username2"] } ``` -------------------------------- ### Configure Security Headers Source: https://github.com/devclad-inc/devclad/blob/main/_autodocs/configuration.md Sets Django security settings including SSL redirection, HSTS, and frame options. ```python SECURE_SSL_REDIRECT = True # (production) SECURE_HSTS_SECONDS = 31536000 SECURE_HSTS_INCLUDE_SUBDOMAINS = True SECURE_HSTS_PRELOAD = True X_FRAME_OPTIONS = 'DENY' SECURE_CONTENT_SECURITY_POLICY = {...} ``` -------------------------------- ### GET /social/meetings/past/ Source: https://github.com/devclad-inc/devclad/blob/main/_autodocs/api-reference/meetings-endpoints.md Retrieve all past meetings for the authenticated user where they are either the organizer or an invitee. ```APIDOC ## GET /social/meetings/past/ ### Description Retrieve all past meetings for the authenticated user (as organizer or invitee). Meetings are ordered by time in descending order. ### Method GET ### Endpoint /social/meetings/past/ ### Response #### Success Response (200) - **meetings** (array) - List of past meeting objects #### Response Example { "meetings": [ { "id": 0, "uid": "550e8400-e29b-41d4-a716-446655440000", "name": "Previous Sync", "organizer": "user1", "invites": ["user2"], "type_of": "Catch up 1:1", "time": "2023-01-01T10:00:00Z", "attended": true } ] } ``` -------------------------------- ### 404 Not Found Error Response Source: https://github.com/devclad-inc/devclad/blob/main/_autodocs/endpoints.md Returned when the requested resource does not exist. ```json { "detail": "Not found.", "error": "User does not have a profile" } ``` -------------------------------- ### Library Re-exports Source: https://github.com/devclad-inc/devclad/blob/main/_autodocs/api-reference/lib-utilities.md The main entry point for the library, exporting all utility functions. ```typescript export { useDocumentTitle, checkIOS, checkMacOS, classNames, convertTimeZone }; ``` -------------------------------- ### Define project-wide choice enumerations Source: https://github.com/devclad-inc/devclad/blob/main/_autodocs/types.md Standardized lists for developer types, idea statuses, scheduling preferences, and timezone offsets. ```python DEV_TYPE_CHOICES: [ "Mobile/Web", "Native Desktop", "Game Development", "Systems", "Hardware", "Blockchain", "AI", "Other" ] IDEA_STATUS_CHOICES: [ "Open to exploring ideas.", "Not open to exploring ideas.", "Need people working on my idea." ] DAYS_OF_WEEK: [ "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Any Day" ] TIMES_OF_DAY: [ "6AM - 12PM", "12PM - 4PM", "4PM - 8PM", "8PM - 12AM", "12AM - 6AM", "Anytime" ] TIMEZONE_DEVIATION: ["+/- 0", "+/- 2", "+/- 4", "+/- 6", "+/- 8", "Any"] ``` -------------------------------- ### Authentication Error: Missing Token Source: https://github.com/devclad-inc/devclad/blob/main/_autodocs/api-reference/errors-patterns.md Returned when the Authorization header or session cookie is missing. ```json Status: 401 Response: { "detail": "Authentication credentials were not provided." } ``` -------------------------------- ### Update Profile via PATCH Request Source: https://github.com/devclad-inc/devclad/blob/main/_autodocs/api-reference/serializers.md Demonstrates a partial update pattern using a serializer with the partial=True flag. ```python @api_view(['PATCH']) def update_profile(request): serializer = ProfileSerializer( profile, data=request.data, partial=True # Allow partial updates ) if serializer.is_valid(): serializer.save() return Response(serializer.data) return Response(serializer.errors, status=400) ``` -------------------------------- ### Import Utility Functions Source: https://github.com/devclad-inc/devclad/blob/main/_autodocs/README.md Import statement for core utility functions from the @devclad/lib package. ```typescript import { useDocumentTitle, // React hook for page title checkIOS, // Detect iOS browser checkMacOS, // Detect macOS browser classNames, // Combine CSS class names convertTimeZone // Convert ISO time to local timezone } from '@devclad/lib'; ``` -------------------------------- ### GET /social/profile/{username}/ Source: https://github.com/devclad-inc/devclad/blob/main/_autodocs/api-reference/social-endpoints.md Retrieve the social profile of a specific user by username (public display version). ```APIDOC ## GET /social/profile/{username}/ ### Description Retrieve the social profile of a specific user by username (public display version). ### Method GET ### Endpoint /social/profile/{username}/ ### Parameters #### Path Parameters - **username** (string) - Required - The username of the user to retrieve. ``` -------------------------------- ### Configure Django-Q Background Tasks Source: https://github.com/devclad-inc/devclad/blob/main/_autodocs/configuration.md Defines the Q_CLUSTER dictionary for managing async task processing via the Django ORM. ```python Q_CLUSTER = { 'name': 'devclad', 'workers': 4, 'timeout': 500, 'retry': 600, 'queue_limit': 1500, 'orm': 'default', } ``` -------------------------------- ### PATCH /social/skipped/ Source: https://github.com/devclad-inc/devclad/blob/main/_autodocs/api-reference/social-endpoints.md Skip or unskip users. ```APIDOC ## PATCH /social/skipped/ ### Description Skip or unskip users. Users can only skip those in their current 'matches_this_week'. ### Method PATCH ### Endpoint /social/skipped/ ### Request Body - **skipped** (array) - Required - List of usernames to skip. ### Request Example { "skipped": ["skip_user"] } ### Response #### Success Response (200) - **skipped** (array) - Updated list of skipped usernames. #### Response Example { "skipped": ["skip_user"] } ``` -------------------------------- ### POST /auth/password/reset/ Source: https://github.com/devclad-inc/devclad/blob/main/_autodocs/api-reference/authentication.md Initiates the password reset process by sending a reset email. ```APIDOC ## POST /auth/password/reset/ ### Description Generates a password reset token and sends a reset link to the registered email address. ### Method POST ### Endpoint /auth/password/reset/ ### Request Body - **email** (string) - Required - Registered email address. ### Response #### Success Response (200) - **detail** (string) - Confirmation message ``` -------------------------------- ### Configure Verbose Logging in Django Source: https://github.com/devclad-inc/devclad/blob/main/_autodocs/api-reference/errors-patterns.md Sets the logging level to DEBUG and directs output to the console. ```python LOGGING = { 'version': 1, 'disable_existing_loggers': False, 'handlers': { 'console': { 'class': 'logging.StreamHandler', }, }, 'root': { 'handlers': ['console'], 'level': 'DEBUG', }, } ``` -------------------------------- ### Raise NotFound Source: https://github.com/devclad-inc/devclad/blob/main/_autodocs/api-reference/errors-patterns.md Used when a requested resource cannot be located in the database. ```python from rest_framework.exceptions import NotFound raise NotFound('User profile not found') ``` -------------------------------- ### Authenticate and Request API with curl Source: https://github.com/devclad-inc/devclad/blob/main/_autodocs/api-reference/errors-patterns.md Uses curl to obtain an access token and include it in subsequent Authorization headers. ```bash # Login TOKEN=$(curl -X POST https://api.devclad.com/auth/login/ \ -H "Content-Type: application/json" \ -d '{"email":"user@example.com","password":"pass"}' \ | jq -r '.access_token') # Use token curl -H "Authorization: Bearer $TOKEN" \ https://api.devclad.com/users/profile/ ``` -------------------------------- ### GET /social/profile/ Source: https://github.com/devclad-inc/devclad/blob/main/_autodocs/api-reference/social-endpoints.md Retrieve the authenticated user's social profile. This version excludes specific fields like preferred_day, preferred_time, and video_call_friendly. ```APIDOC ## GET /social/profile/ ### Description Retrieve the authenticated user's social profile (internal use, excludes preferred_day/time/video_call_friendly). ### Method GET ### Endpoint /social/profile/ ### Response #### Success Response (200) - **user** (integer) - user ID - **video_call_friendly** (boolean) - Friendly for video calls - **languages** (string) - Languages spoken - **location** (string) - User location - **raw_xp** (integer) - Experience level (0-50) - **purpose** (string) - Purpose of profile - **timezone** (string) - IANA timezone - **preferred_timezone_deviation** (string) - Preferred timezone deviation - **dev_type** (string) - Developer type - **preferred_dev_type** (string) - Preferred developer type - **idea_status** (string) - Status of ideas - **available_this_week** (boolean) - Availability this week - **available_always_off** (boolean) - Always off availability - **indirect_matching** (boolean) - Indirect matching enabled ``` -------------------------------- ### PATCH /social/shadow/ Source: https://github.com/devclad-inc/devclad/blob/main/_autodocs/api-reference/social-endpoints.md Shadow or unshadow users. ```APIDOC ## PATCH /social/shadow/ ### Description Shadow or unshadow users. Shadowing is indefinite and cannot be cleared. Users can only shadow those in their current 'matches_this_week'. ### Method PATCH ### Endpoint /social/shadow/ ### Request Body - **shadowed** (array) - Required - List of usernames to shadow. ### Request Example { "shadowed": ["user_to_shadow"] } ### Response #### Success Response (200) - **shadowed** (array) - Updated list of shadowed usernames. #### Response Example { "shadowed": ["user_to_shadow"] } ``` -------------------------------- ### Retrieve Additional Preferences Source: https://github.com/devclad-inc/devclad/blob/main/_autodocs/api-reference/social-endpoints.md Fetches the authenticated user's meeting preferences. Requires a valid JWT in the Authorization header. ```json { "preferred_day": "string (day of week)", "preferred_time": "string (time range)", "video_call_friendly": "boolean" } ``` ```bash curl -H "Authorization: Bearer " \ https://api.devclad.com/social/additional-prefs/ ``` -------------------------------- ### Idea Status Enumeration Source: https://github.com/devclad-inc/devclad/blob/main/_autodocs/README.md Status options for project collaboration and idea exploration. ```text Open to exploring ideas. Not open to exploring ideas. Need people working on my idea. ``` -------------------------------- ### Configure Production Security Settings Source: https://github.com/devclad-inc/devclad/blob/main/_autodocs/api-reference/authentication.md Sets mandatory security flags for JWT and session cookies to ensure HTTPS-only communication and CSRF protection. ```python JWT_AUTH_SECURE = True # HTTPS only JWT_AUTH_HTTPONLY = True # Block JavaScript access JWT_AUTH_SAMESITE = "Strict" # CSRF protection SESSION_COOKIE_SECURE = True CSRF_COOKIE_SECURE = True ``` -------------------------------- ### Test Views in Django Shell Source: https://github.com/devclad-inc/devclad/blob/main/_autodocs/api-reference/errors-patterns.md Uses RequestFactory to simulate requests and inspect view responses directly. ```bash python manage.py shell # Test a view directly from users.views import profile from django.test import RequestFactory factory = RequestFactory() request = factory.get('/users/profile/') request.user = User.objects.first() response = profile(request) print(response.data) ``` -------------------------------- ### Log Server-Side Errors with Django and Rollbar Source: https://github.com/devclad-inc/devclad/blob/main/_autodocs/api-reference/errors-patterns.md Demonstrates capturing exceptions in Django views and reporting them to Rollbar while logging locally. ```python import logging import rollbar logger = logging.getLogger(__name__) try: profile = Profile.objects.get(user=request.user) except Profile.DoesNotExist as e: logger.error(f"Profile not found for user {request.user.id}") rollbar.report_exc_info(request=request) raise Http404("User does not have a profile") ``` -------------------------------- ### PUT /users/profile/ Source: https://github.com/devclad-inc/devclad/blob/main/_autodocs/api-reference/users-endpoints.md Replace the entire authenticated user's profile with new data. ```APIDOC ## PUT /users/profile/ ### Description Replace the entire authenticated user's profile with new data. ### Method PUT ### Endpoint /users/profile/ ### Request Body - **pronouns** (string) - Required - **about** (string) - Required - **website** (string) - Required - **linkedin** (string) - Required - **calendly** (string) - Required ### Response #### Success Response (200) - **uid** (string) - UUID of the user - **avatar** (string) - URL of the avatar - **pronouns** (string) - User pronouns - **about** (string) - About section - **website** (string) - Website URL - **linkedin** (string) - LinkedIn URL - **calendly** (string) - Calendly URL ``` -------------------------------- ### checkMacOS() Source: https://github.com/devclad-inc/devclad/blob/main/_autodocs/api-reference/lib-utilities.md Detects if the current browser is running on a macOS device. ```APIDOC ## checkMacOS ### Description Detect if the current browser is running on a macOS device. ### Signature `export const checkMacOS = (): boolean` ### Returns - **boolean** - true if user agent indicates macOS, false otherwise ``` -------------------------------- ### Log Client-Side Errors with Sentry Source: https://github.com/devclad-inc/devclad/blob/main/_autodocs/api-reference/errors-patterns.md Initializes Sentry in a React environment and captures fetch request errors. ```typescript // Sentry integration example import * as Sentry from "@sentry/react"; Sentry.init({ dsn: process.env.REACT_APP_SENTRY_DSN, environment: process.env.NODE_ENV, }); async function makeRequest(url, options) { try { return await fetch(url, options); } catch (error) { Sentry.captureException(error); throw error; } } ``` -------------------------------- ### Authenticate with DevClad API Source: https://github.com/devclad-inc/devclad/blob/main/_autodocs/README.md Use these cURL commands to log in and access protected endpoints with a JWT bearer token. ```bash # Login curl -X POST https://api.devclad.com/auth/login/ \ -H "Content-Type: application/json" \ -d '{"email":"user@example.com","password":"pass123"}' # Response includes access_token # Use in subsequent requests: curl -H "Authorization: Bearer " \ https://api.devclad.com/users/profile/ ``` -------------------------------- ### Resource Not Found: Profile Missing Source: https://github.com/devclad-inc/devclad/blob/main/_autodocs/api-reference/errors-patterns.md Returned when a user exists but no associated profile record is found. ```json Status: 404 Response: { "error": "User does not have a profile" } ``` -------------------------------- ### Define HackathonProfile Model Source: https://github.com/devclad-inc/devclad/blob/main/_autodocs/types.md Placeholder model for future hackathon participation tracking. ```python class HackathonProfile(models.Model): user = models.OneToOneField(User, on_delete=models.CASCADE) ``` -------------------------------- ### Retrieve authenticated user profile Source: https://github.com/devclad-inc/devclad/blob/main/_autodocs/api-reference/users-endpoints.md Fetches the profile information for the currently authenticated user. ```bash curl -H "Authorization: Bearer " \ https://api.devclad.com/users/profile/ ``` -------------------------------- ### PATCH /social/meetings/ Source: https://github.com/devclad-inc/devclad/blob/main/_autodocs/api-reference/meetings-endpoints.md Create a new meeting or update an existing one by providing meeting details, organizer, and invitees. ```APIDOC ## PATCH /social/meetings/ ### Description Create a new meeting or update an existing one. Requires JWT authentication. ### Method PATCH ### Endpoint /social/meetings/ ### Request Body - **name** (string) - Required - Name of the meeting - **organizer** (string) - Required - Username of the organizer - **invites** (array) - Required - List of usernames to invite - **type_of** (string) - Required - Meeting type (e.g., 1:1 Match, Catch up 1:1) - **time** (string) - Required - ISO 8601 datetime string ### Request Example { "name": "DevClad 1:1 Meeting", "organizer": "alice_dev", "invites": ["bob_dev"], "type_of": "1:1 Match", "time": "2024-03-20T15:00:00Z" } ### Response #### Success Response (200) - **typeOf** (string) - Meeting type - **time** (string) - ISO 8601 datetime - **uid** (string) - Meeting UUID - **email** (string) - Invitee email - **firstName** (string) - Invitee first name - **inviteName** (string) - Other invitee first name - **timeZone** (string) - Invitee timezone #### Response Example [ { "typeOf": "1:1 Match", "time": "2024-03-20T15:00:00Z", "uid": "uuid-string", "email": "bob@example.com", "firstName": "Bob", "inviteName": "Alice", "timeZone": "UTC" } ] ``` -------------------------------- ### Retrieve User Status Source: https://github.com/devclad-inc/devclad/blob/main/_autodocs/api-reference/users-endpoints.md Fetches the current submission and approval status for the authenticated user. ```bash curl -H "Authorization: Bearer " \ https://api.devclad.com/users/status/ ``` -------------------------------- ### Retrieve Shadowed Users Source: https://github.com/devclad-inc/devclad/blob/main/_autodocs/api-reference/social-endpoints.md Fetches the list of users shadowed by the authenticated user. ```json { "shadowed": ["username1", "username2", ...] } ``` ```bash curl -H "Authorization: Bearer " \ https://api.devclad.com/social/shadow/ ``` -------------------------------- ### Developer Types Enumeration Source: https://github.com/devclad-inc/devclad/blob/main/_autodocs/README.md List of supported developer categories for user profiles. ```text Mobile/Web | Native Desktop | Game Development | Systems Hardware | Blockchain | AI | Other ``` -------------------------------- ### Registration Endpoint Response Schema Source: https://github.com/devclad-inc/devclad/blob/main/_autodocs/api-reference/authentication.md JSON structure returned upon successful account creation. ```json { "user": { User object }, "access_token": "string", "refresh_token": "string" } ``` -------------------------------- ### POST /auth/account-confirm-email/ Source: https://github.com/devclad-inc/devclad/blob/main/_autodocs/endpoints.md Verifies a user's email address using a confirmation key. ```APIDOC ## POST /auth/account-confirm-email/ ### Description Confirms an email address via a provided confirmation key. ### Method POST ### Endpoint /auth/account-confirm-email/ ### Request Body - **key** (string) - Required - Email confirmation key ### Response #### Success Response (200) - **detail** (string) - Status message ``` -------------------------------- ### Authentication Error: Expired Token Source: https://github.com/devclad-inc/devclad/blob/main/_autodocs/api-reference/errors-patterns.md Returned when the provided access token has expired. ```json Status: 401 Response: { "detail": "Token is invalid or expired" } ``` -------------------------------- ### Define UserStatus model Source: https://github.com/devclad-inc/devclad/blob/main/_autodocs/types.md Tracks the submission state and administrative approval status for a user profile. ```python class UserStatus(models.Model): user = models.OneToOneField(User, on_delete=models.CASCADE) status = models.CharField( max_length=255, default="Not Submitted", choices=[ ("Submitted", "Submitted"), ("Not Submitted", "Not Submitted"), ], ) approved = models.BooleanField(default=False) count = models.IntegerField(default=0, blank=True) ``` -------------------------------- ### Resource Not Found: User Missing Source: https://github.com/devclad-inc/devclad/blob/main/_autodocs/api-reference/errors-patterns.md Returned when the requested username or user ID does not exist in the database. ```json Status: 404 Response: { "error": "User does not exist" } ``` -------------------------------- ### Permission Error: Cannot Perform Action Source: https://github.com/devclad-inc/devclad/blob/main/_autodocs/api-reference/errors-patterns.md Returned when a business logic constraint is violated, such as performing an action on oneself. ```json Status: 400 Response: { "error": "Cannot shadow self" } ``` -------------------------------- ### Check Profile Completion Status via cURL Source: https://github.com/devclad-inc/devclad/blob/main/_autodocs/api-reference/social-endpoints.md Verifies if the authenticated user has filled out all mandatory profile fields. ```bash curl -H "Authorization: Bearer " \ https://api.devclad.com/social/is-complete/ ``` -------------------------------- ### Define SubscriptionStatus model Source: https://github.com/devclad-inc/devclad/blob/main/_autodocs/types.md Manages user subscription tiers and links to Stripe customer and subscription identifiers. ```python class SubscriptionStatus(models.Model): SUBSCRIPTION_STATUS = [ ("Free Trial", "Free Trial"), ("Starter", "Starter"), ("X", "X"), ] user = models.OneToOneField(User, on_delete=models.CASCADE) status = models.CharField( choices=SUBSCRIPTION_STATUS, default="Free Trial", max_length=64 ) subscription_id = models.CharField(max_length=64, blank=True, null=True) customer_id = models.CharField(max_length=64, blank=True, null=True) ``` -------------------------------- ### Subscription Tiers Enumeration Source: https://github.com/devclad-inc/devclad/blob/main/_autodocs/README.md Available subscription levels for platform users. ```text Free Trial | Starter | X ``` -------------------------------- ### Configure CORS for Credentials Source: https://github.com/devclad-inc/devclad/blob/main/_autodocs/api-reference/authentication.md Enables cross-origin credential support and defines allowed origins for the application. ```python CORS_ALLOW_CREDENTIALS = True # Allow cookies in cross-origin requests CORS_ALLOWED_ORIGINS = [...] # Whitelist frontend origins ``` -------------------------------- ### Retrieve Subscription Status Source: https://github.com/devclad-inc/devclad/blob/main/_autodocs/api-reference/users-endpoints.md Fetches the authenticated user's subscription status and Stripe identifiers. ```bash curl -H "Authorization: Bearer " \ https://api.devclad.com/users/subscription/ ``` -------------------------------- ### Authentication Endpoints Source: https://github.com/devclad-inc/devclad/blob/main/_autodocs/INDEX.md Endpoints for managing user authentication, registration, and token lifecycle. ```APIDOC ## POST /auth/login/ ## POST /auth/registration/ ## POST /auth/token/refresh/ ## POST /auth/account-confirm-email/ ``` -------------------------------- ### User Profile Management Source: https://github.com/devclad-inc/devclad/blob/main/_autodocs/INDEX.md Endpoints for managing user profiles, account status, and subscription information. ```APIDOC ## GET/PUT/PATCH /users/profile/ ### Description Perform CRUD operations on the authenticated user's profile. ### Method GET, PUT, PATCH ### Endpoint /users/profile/ ## GET /users/profile/{username}/ ### Description Retrieve the public profile information for a specific user. ### Method GET ### Endpoint /users/profile/{username}/ ``` -------------------------------- ### One-on-One Matching Source: https://github.com/devclad-inc/devclad/blob/main/_autodocs/api-reference/meetings-endpoints.md Endpoints for automatic match generation. ```APIDOC ## One-on-One Matching ### Endpoint `/social/one-one/` ### Description Endpoint for automatic match generation. ``` -------------------------------- ### Retrieve Blocked Users Source: https://github.com/devclad-inc/devclad/blob/main/_autodocs/api-reference/social-endpoints.md Fetches the list of users blocked by the authenticated user. ```json { "blocked": ["username1", "username2", ...] } ``` ```bash curl -H "Authorization: Bearer " \ https://api.devclad.com/social/block/ ``` -------------------------------- ### Define Profile model Source: https://github.com/devclad-inc/devclad/blob/main/_autodocs/types.md Stores personal user information, including avatar management and external profile links. ```python class Profile(models.Model): user = models.OneToOneField(User, on_delete=models.CASCADE) uid = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False) avatar = models.ImageField( upload_to="avatars/", default=random_avatar, validators=[validate_image_file_extension, file_size], ) pronouns = models.CharField(max_length=20, default="") about = models.CharField(max_length=255, default="") website = models.URLField(blank=True) linkedin = models.URLField(blank=True) calendly = models.URLField(blank=True) ``` -------------------------------- ### Configure Avatar Image Validation Source: https://github.com/devclad-inc/devclad/blob/main/_autodocs/configuration.md Defines file size limits and allowed image extensions for user avatars. ```python # Max file size: 8 MiB FILE_SIZE_LIMIT = 8 * 1024 * 1024 # Allowed image extensions ALLOWED_IMAGE_EXTENSIONS = ['jpg', 'jpeg', 'png', 'gif', 'webp'] ```