> ## Documentation Index
> Fetch the complete documentation index at: https://docs.deployhub.cloud/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Project Overview

> Retrieve comprehensive project information including settings, domain, and last build details

## Authentication

This endpoint requires JWT authentication via the `verifyJWT` middleware. Include your access token in the Authorization header.

## Path Parameters

<ParamField path="id" type="string" required>
  The unique identifier of the project (MongoDB ObjectId)
</ParamField>

## Response

<ResponseField name="success" type="boolean" required>
  Indicates whether the request was successful
</ResponseField>

<ResponseField name="project" type="object" required>
  The project overview data

  <Expandable title="Project fields">
    <ResponseField name="_id" type="string">
      Project unique identifier
    </ResponseField>

    <ResponseField name="name" type="string">
      Project name
    </ResponseField>

    <ResponseField name="projectType" type="string">
      Type of project deployment

      * `static` - Static site (HTML/CSS/JS)
      * `node` - Node.js application
    </ResponseField>

    <ResponseField name="repoLink" type="string">
      GitHub repository URL
    </ResponseField>

    <ResponseField name="status" type="string">
      Current project status

      * `pending` - Awaiting initial deployment
      * `building` - Currently building
      * `live` - Successfully deployed and running
      * `stopped` - Deployment stopped
      * `failed-deploy` - Deployment failed
    </ResponseField>

    <ResponseField name="plan" type="string">
      Subscription plan (`free` or `pro`)
    </ResponseField>

    <ResponseField name="totalRequest" type="number">
      Total number of HTTP requests received
    </ResponseField>

    <ResponseField name="totalBuilds" type="number">
      Total number of builds executed
    </ResponseField>

    <ResponseField name="domain" type="string">
      The active domain for the project. Returns custom domain if configured, otherwise returns the subdomain in format `{subdomain}.deployhub.online`
    </ResponseField>

    <ResponseField name="settings" type="object">
      Project configuration settings

      <Expandable title="Settings fields">
        <ResponseField name="repoBranchName" type="string">
          Git branch to deploy from (default: `main`)
        </ResponseField>

        <ResponseField name="folder" type="object">
          Repository folder configuration

          <Expandable title="Folder fields">
            <ResponseField name="enabled" type="boolean">
              Whether to deploy from a specific folder
            </ResponseField>

            <ResponseField name="name" type="string">
              Folder path when enabled
            </ResponseField>
          </Expandable>
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="buildCommand" type="string | null">
      Command to build the project (e.g., `npm run build`)
    </ResponseField>

    <ResponseField name="publishDir" type="string | null">
      Directory containing build output (e.g., `dist`, `build`)
    </ResponseField>

    <ResponseField name="startCommand" type="string | null">
      Command to start the application (Node.js projects only)
    </ResponseField>

    <ResponseField name="port" type="number | null">
      Port number the application listens on (Node.js projects only)
    </ResponseField>

    <ResponseField name="createdAt" type="string">
      ISO 8601 timestamp of project creation
    </ResponseField>

    <ResponseField name="updatedAt" type="string">
      ISO 8601 timestamp of last project update
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="lastBuild" type="object | null" required>
  Information about the most recent build, or `null` if no builds exist

  <Expandable title="Build fields">
    <ResponseField name="_id" type="string">
      Build unique identifier
    </ResponseField>

    <ResponseField name="commitSha" type="string | null">
      Git commit SHA that was built
    </ResponseField>

    <ResponseField name="status" type="string">
      Build status

      * `pending` - Build queued
      * `success` - Build completed successfully
      * `failed` - Build failed
    </ResponseField>

    <ResponseField name="duration" type="string | null">
      Human-readable build duration (e.g., `42s`, `2m 15s`). Only available for completed builds.
    </ResponseField>

    <ResponseField name="createdAt" type="string">
      ISO 8601 timestamp when build was created
    </ResponseField>
  </Expandable>
</ResponseField>

## Example Request

```bash theme={null}
curl -X GET "https://api.deployhub.online/api/projects/65f3a2b1c4d5e6f7g8h9i0j1/overview" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
```

## Example Response

```json theme={null}
{
  "success": true,
  "project": {
    "_id": "65f3a2b1c4d5e6f7g8h9i0j1",
    "name": "my-react-app",
    "projectType": "static",
    "repoLink": "https://github.com/username/my-react-app",
    "status": "live",
    "plan": "pro",
    "totalRequest": 15847,
    "totalBuilds": 23,
    "domain": "my-app.deployhub.online",
    "settings": {
      "repoBranchName": "main",
      "folder": {
        "enabled": false,
        "name": ""
      }
    },
    "buildCommand": "npm run build",
    "publishDir": "dist",
    "startCommand": null,
    "port": null,
    "createdAt": "2024-03-15T10:30:00.000Z",
    "updatedAt": "2024-03-20T14:22:33.000Z"
  },
  "lastBuild": {
    "_id": "65f5d3e4f5g6h7i8j9k0l1m2",
    "commitSha": "a3f7d9e2c1b4f6e8d0c2a5b7",
    "status": "success",
    "duration": "1m 42s",
    "createdAt": "2024-03-20T14:20:15.000Z"
  }
}
```

## Example Response (Node.js Project)

```json theme={null}
{
  "success": true,
  "project": {
    "_id": "65f3a2b1c4d5e6f7g8h9i0j1",
    "name": "express-api",
    "projectType": "node",
    "repoLink": "https://github.com/username/express-api",
    "status": "live",
    "plan": "free",
    "totalRequest": 2341,
    "totalBuilds": 8,
    "domain": "api-prod.deployhub.online",
    "settings": {
      "repoBranchName": "production",
      "folder": {
        "enabled": true,
        "name": "server"
      }
    },
    "buildCommand": "npm install",
    "publishDir": null,
    "startCommand": "node index.js",
    "port": 3000,
    "createdAt": "2024-02-10T08:15:00.000Z",
    "updatedAt": "2024-03-18T11:45:22.000Z"
  },
  "lastBuild": {
    "_id": "65f5d3e4f5g6h7i8j9k0l1m2",
    "commitSha": "b2e8f1a3d5c7e9f0a2b4c6d8",
    "status": "success",
    "duration": "38s",
    "createdAt": "2024-03-18T11:43:00.000Z"
  }
}
```

## Error Responses

<ResponseField name="404 Not Found">
  Returned when:

  * Project with the specified ID doesn't exist
  * Project doesn't belong to the authenticated user
  * Project has been deleted

  ```json theme={null}
  {
    "success": false,
    "message": "Project not found"
  }
  ```
</ResponseField>

<ResponseField name="500 Internal Server Error">
  Returned when a server error occurs

  ```json theme={null}
  {
    "success": false,
    "message": "Failed to fetch project overview"
  }
  ```
</ResponseField>

## Implementation Notes

* Only returns projects owned by the authenticated user
* Excludes projects with status `deleted`
* Automatically calculates build duration from `startedAt` and `finishedAt` timestamps
* Duration format: seconds shown as `{s}s`, minutes shown as `{m}m {s}s`
* Returns custom domain if `hascustomDomain` is true, otherwise returns subdomain
* Build information is fetched separately and joined with project data

## Source Reference

`backend/src/controllers/slices/Project/getProjectOverview.js:4`
