mirror of
https://github.com/documenso/documenso.git
synced 2025-11-15 01:01:49 +10:00
Compare commits
3 Commits
chore/open
...
fix/sitema
| Author | SHA1 | Date | |
|---|---|---|---|
| 77231e31f7 | |||
| 3d7912586e | |||
| a67894f384 |
@ -6,7 +6,6 @@ import { z } from 'zod';
|
|||||||
|
|
||||||
import { setupI18nSSR } from '@documenso/lib/client-only/providers/i18n.server';
|
import { setupI18nSSR } from '@documenso/lib/client-only/providers/i18n.server';
|
||||||
import { getCompletedDocumentsMonthly } from '@documenso/lib/server-only/user/get-monthly-completed-document';
|
import { getCompletedDocumentsMonthly } from '@documenso/lib/server-only/user/get-monthly-completed-document';
|
||||||
import { getSignerConversionMonthly } from '@documenso/lib/server-only/user/get-signer-conversion';
|
|
||||||
import { getUserMonthlyGrowth } from '@documenso/lib/server-only/user/get-user-monthly-growth';
|
import { getUserMonthlyGrowth } from '@documenso/lib/server-only/user/get-user-monthly-growth';
|
||||||
|
|
||||||
import { FUNDING_RAISED } from '~/app/(marketing)/open/data';
|
import { FUNDING_RAISED } from '~/app/(marketing)/open/data';
|
||||||
@ -20,7 +19,6 @@ import { MonthlyCompletedDocumentsChart } from './monthly-completed-documents-ch
|
|||||||
import { MonthlyNewUsersChart } from './monthly-new-users-chart';
|
import { MonthlyNewUsersChart } from './monthly-new-users-chart';
|
||||||
import { MonthlyTotalUsersChart } from './monthly-total-users-chart';
|
import { MonthlyTotalUsersChart } from './monthly-total-users-chart';
|
||||||
import { SalaryBands } from './salary-bands';
|
import { SalaryBands } from './salary-bands';
|
||||||
import { SignerConversionChart } from './signer-conversion-chart';
|
|
||||||
import { TeamMembers } from './team-members';
|
import { TeamMembers } from './team-members';
|
||||||
import { OpenPageTooltip } from './tooltip';
|
import { OpenPageTooltip } from './tooltip';
|
||||||
import { TotalSignedDocumentsChart } from './total-signed-documents-chart';
|
import { TotalSignedDocumentsChart } from './total-signed-documents-chart';
|
||||||
@ -145,7 +143,6 @@ export default async function OpenPage() {
|
|||||||
EARLY_ADOPTERS_DATA,
|
EARLY_ADOPTERS_DATA,
|
||||||
MONTHLY_USERS,
|
MONTHLY_USERS,
|
||||||
MONTHLY_COMPLETED_DOCUMENTS,
|
MONTHLY_COMPLETED_DOCUMENTS,
|
||||||
MONTHLY_SIGNER_CONVERSION,
|
|
||||||
] = await Promise.all([
|
] = await Promise.all([
|
||||||
fetchGithubStats(),
|
fetchGithubStats(),
|
||||||
fetchOpenIssues(),
|
fetchOpenIssues(),
|
||||||
@ -154,7 +151,6 @@ export default async function OpenPage() {
|
|||||||
fetchEarlyAdopters(),
|
fetchEarlyAdopters(),
|
||||||
getUserMonthlyGrowth(),
|
getUserMonthlyGrowth(),
|
||||||
getCompletedDocumentsMonthly(),
|
getCompletedDocumentsMonthly(),
|
||||||
getSignerConversionMonthly(),
|
|
||||||
]);
|
]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@ -285,17 +281,6 @@ export default async function OpenPage() {
|
|||||||
data={MONTHLY_COMPLETED_DOCUMENTS}
|
data={MONTHLY_COMPLETED_DOCUMENTS}
|
||||||
className="col-span-12 lg:col-span-6"
|
className="col-span-12 lg:col-span-6"
|
||||||
/>
|
/>
|
||||||
<SignerConversionChart
|
|
||||||
className="col-span-12 lg:col-span-6"
|
|
||||||
title={_(msg`Signers that Signed Up`)}
|
|
||||||
data={MONTHLY_SIGNER_CONVERSION}
|
|
||||||
/>
|
|
||||||
<SignerConversionChart
|
|
||||||
className="col-span-12 lg:col-span-6"
|
|
||||||
title={_(msg`Total Signers that Signed Up`)}
|
|
||||||
data={MONTHLY_SIGNER_CONVERSION}
|
|
||||||
cumulative
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@ -1,64 +0,0 @@
|
|||||||
'use client';
|
|
||||||
|
|
||||||
import { DateTime } from 'luxon';
|
|
||||||
import { Bar, BarChart, ResponsiveContainer, Tooltip, XAxis, YAxis } from 'recharts';
|
|
||||||
|
|
||||||
import type { GetSignerConversionMonthlyResult } from '@documenso/lib/server-only/user/get-signer-conversion';
|
|
||||||
|
|
||||||
export type SignerConversionChartProps = {
|
|
||||||
className?: string;
|
|
||||||
title: string;
|
|
||||||
cumulative?: boolean;
|
|
||||||
data: GetSignerConversionMonthlyResult;
|
|
||||||
};
|
|
||||||
|
|
||||||
export const SignerConversionChart = ({
|
|
||||||
className,
|
|
||||||
data,
|
|
||||||
title,
|
|
||||||
cumulative = false,
|
|
||||||
}: SignerConversionChartProps) => {
|
|
||||||
const formattedData = [...data].reverse().map(({ month, count, cume_count }) => {
|
|
||||||
return {
|
|
||||||
month: DateTime.fromFormat(month, 'yyyy-MM').toFormat('MMM yyyy'),
|
|
||||||
count: Number(count),
|
|
||||||
signed_count: Number(cume_count),
|
|
||||||
};
|
|
||||||
});
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div className={className}>
|
|
||||||
<div className="border-border flex flex-1 flex-col justify-center rounded-2xl border p-6 pl-2">
|
|
||||||
<div className="mb-6 flex px-4">
|
|
||||||
<h3 className="text-lg font-semibold">{title}</h3>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<ResponsiveContainer width="100%" height={400}>
|
|
||||||
<BarChart data={formattedData}>
|
|
||||||
<XAxis dataKey="month" />
|
|
||||||
<YAxis />
|
|
||||||
|
|
||||||
<Tooltip
|
|
||||||
labelStyle={{
|
|
||||||
color: 'hsl(var(--primary-foreground))',
|
|
||||||
}}
|
|
||||||
formatter={(value) => [
|
|
||||||
Number(value).toLocaleString('en-US'),
|
|
||||||
cumulative ? 'Total Signers' : 'Monthly Signers',
|
|
||||||
]}
|
|
||||||
cursor={{ fill: 'hsl(var(--primary) / 10%)' }}
|
|
||||||
/>
|
|
||||||
|
|
||||||
<Bar
|
|
||||||
dataKey={cumulative ? 'signed_count' : 'count'}
|
|
||||||
fill="hsl(var(--primary))"
|
|
||||||
radius={[4, 4, 0, 0]}
|
|
||||||
maxBarSize={60}
|
|
||||||
name={cumulative ? 'Total Signers' : 'Monthly Signers'}
|
|
||||||
/>
|
|
||||||
</BarChart>
|
|
||||||
</ResponsiveContainer>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
@ -145,10 +145,7 @@ export default async function AdminStatsPage() {
|
|||||||
msg`Monthly Active Users: Users that had at least one of their documents completed`,
|
msg`Monthly Active Users: Users that had at least one of their documents completed`,
|
||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
<SignerConversionChart
|
<SignerConversionChart title="Signers that Signed Up" data={signerConversionMonthly} />
|
||||||
title={_(msg`Signers that Signed Up`)}
|
|
||||||
data={signerConversionMonthly}
|
|
||||||
/>
|
|
||||||
<SignerConversionChart
|
<SignerConversionChart
|
||||||
title={_(msg`Total Signers that Signed Up`)}
|
title={_(msg`Total Signers that Signed Up`)}
|
||||||
data={signerConversionMonthly}
|
data={signerConversionMonthly}
|
||||||
|
|||||||
@ -1,20 +1,20 @@
|
|||||||
/* eslint-disable turbo/no-undeclared-env-vars */
|
/* eslint-disable turbo/no-undeclared-env-vars */
|
||||||
import { NEXT_PUBLIC_WEBAPP_URL } from '../constants/app';
|
import { APP_BASE_URL } from '../constants/app';
|
||||||
|
|
||||||
export const getBaseUrl = () => {
|
export const getBaseUrl = () => {
|
||||||
if (typeof window !== 'undefined') {
|
if (typeof window !== 'undefined') {
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const marketingAppUrl = APP_BASE_URL();
|
||||||
|
|
||||||
|
if (marketingAppUrl) {
|
||||||
|
return marketingAppUrl;
|
||||||
|
}
|
||||||
|
|
||||||
if (process.env.VERCEL_URL) {
|
if (process.env.VERCEL_URL) {
|
||||||
return `https://${process.env.VERCEL_URL}`;
|
return `https://${process.env.VERCEL_URL}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
const webAppUrl = NEXT_PUBLIC_WEBAPP_URL();
|
|
||||||
|
|
||||||
if (webAppUrl) {
|
|
||||||
return webAppUrl;
|
|
||||||
}
|
|
||||||
|
|
||||||
return `http://localhost:${process.env.PORT ?? 3000}`;
|
return `http://localhost:${process.env.PORT ?? 3000}`;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user