Get Project Overview
curl --request GET \
--url https://api.example.com/api/projects/:id/overviewimport requests
url = "https://api.example.com/api/projects/:id/overview"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/api/projects/:id/overview', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/api/projects/:id/overview",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/projects/:id/overview"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/api/projects/:id/overview")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/projects/:id/overview")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"success": true,
"project": {
"_id": "<string>",
"name": "<string>",
"projectType": "<string>",
"repoLink": "<string>",
"status": "<string>",
"plan": "<string>",
"totalRequest": 123,
"totalBuilds": 123,
"domain": "<string>",
"settings": {
"repoBranchName": "<string>",
"folder": {
"enabled": true,
"name": "<string>"
}
},
"buildCommand": {},
"publishDir": {},
"startCommand": {},
"port": {},
"createdAt": "<string>",
"updatedAt": "<string>"
},
"lastBuild": {
"_id": "<string>",
"commitSha": {},
"status": "<string>",
"duration": {},
"createdAt": "<string>"
}
}Projects
Get Project Overview
Retrieve comprehensive project information including settings, domain, and last build details
GET
/
api
/
projects
/
:id
/
overview
Get Project Overview
curl --request GET \
--url https://api.example.com/api/projects/:id/overviewimport requests
url = "https://api.example.com/api/projects/:id/overview"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/api/projects/:id/overview', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/api/projects/:id/overview",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/projects/:id/overview"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/api/projects/:id/overview")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/projects/:id/overview")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"success": true,
"project": {
"_id": "<string>",
"name": "<string>",
"projectType": "<string>",
"repoLink": "<string>",
"status": "<string>",
"plan": "<string>",
"totalRequest": 123,
"totalBuilds": 123,
"domain": "<string>",
"settings": {
"repoBranchName": "<string>",
"folder": {
"enabled": true,
"name": "<string>"
}
},
"buildCommand": {},
"publishDir": {},
"startCommand": {},
"port": {},
"createdAt": "<string>",
"updatedAt": "<string>"
},
"lastBuild": {
"_id": "<string>",
"commitSha": {},
"status": "<string>",
"duration": {},
"createdAt": "<string>"
}
}Authentication
This endpoint requires JWT authentication via theverifyJWT middleware. Include your access token in the Authorization header.
Path Parameters
string
required
The unique identifier of the project (MongoDB ObjectId)
Response
boolean
required
Indicates whether the request was successful
object
required
The project overview data
Show Project fields
Show Project fields
string
Project unique identifier
string
Project name
string
Type of project deployment
static- Static site (HTML/CSS/JS)node- Node.js application
string
GitHub repository URL
string
Current project status
pending- Awaiting initial deploymentbuilding- Currently buildinglive- Successfully deployed and runningstopped- Deployment stoppedfailed-deploy- Deployment failed
string
Subscription plan (
free or pro)number
Total number of HTTP requests received
number
Total number of builds executed
string
The active domain for the project. Returns custom domain if configured, otherwise returns the subdomain in format
{subdomain}.deployhub.onlineobject
string | null
Command to build the project (e.g.,
npm run build)string | null
Directory containing build output (e.g.,
dist, build)string | null
Command to start the application (Node.js projects only)
number | null
Port number the application listens on (Node.js projects only)
string
ISO 8601 timestamp of project creation
string
ISO 8601 timestamp of last project update
object | null
required
Information about the most recent build, or
null if no builds existShow Build fields
Show Build fields
string
Build unique identifier
string | null
Git commit SHA that was built
string
Build status
pending- Build queuedsuccess- Build completed successfullyfailed- Build failed
string | null
Human-readable build duration (e.g.,
42s, 2m 15s). Only available for completed builds.string
ISO 8601 timestamp when build was created
Example Request
curl -X GET "https://api.deployhub.online/api/projects/65f3a2b1c4d5e6f7g8h9i0j1/overview" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"
Example Response
{
"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)
{
"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
Returned when:
- Project with the specified ID doesn’t exist
- Project doesn’t belong to the authenticated user
- Project has been deleted
{
"success": false,
"message": "Project not found"
}
Returned when a server error occurs
{
"success": false,
"message": "Failed to fetch project overview"
}
Implementation Notes
- Only returns projects owned by the authenticated user
- Excludes projects with status
deleted - Automatically calculates build duration from
startedAtandfinishedAttimestamps - Duration format: seconds shown as
{s}s, minutes shown as{m}m {s}s - Returns custom domain if
hascustomDomainis true, otherwise returns subdomain - Build information is fetched separately and joined with project data
Source Reference
backend/src/controllers/slices/Project/getProjectOverview.js:4Was this page helpful?