Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion Dockerfile.api
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ WORKDIR /app

# Optionally install pnpm or use node directly. If you need pnpm for starting, install it.
RUN npm install -g pnpm
RUN npm install -g tsdown


# Copy built files and production node_modules from builder
COPY --from=builder /app/apps/api/dist ./apps/api/dist
Expand All @@ -38,4 +40,5 @@ ENV NODE_ENV=production
EXPOSE 4005

# Replace with your production start command (adjust path/script)
CMD ["node", "apps/api/dist/index.js"]
# CMD ["node", "apps/api/dist/index.js"]
CMD ["pnpm", "--filter", "api", "dev"]
1 change: 1 addition & 0 deletions Dockerfile.dbot
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ WORKDIR /app

# Optionally install pnpm or use node directly. If you need pnpm for starting, install it.
RUN npm install -g pnpm
RUN npm install -g tsdown

# Copy built files and production node_modules from builder
COPY --from=builder /app/apps/discord-bot/dist ./apps/discord-bot/dist
Expand Down
2 changes: 1 addition & 1 deletion apps/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"private": true,
"scripts": {
"start": "node ./dist/index.js",
"dev": "npx tsdown --watch src/index.ts",
"dev": "npx tsdown --watch src --onSuccess \"node dist/index.js\"",
"build": "npx tsdown",
"clean": "rm -rf ../../build/api",
"typecheck": "tsc --noEmit",
Expand Down
5 changes: 3 additions & 2 deletions apps/api/src/server.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { checkConnection, runMigrations } from "@taskcord/database";
import { generateMigration, runMigrations } from "@taskcord/database";
import * as dotenv from "dotenv";
import type { FastifyInstance, FastifyServerOptions } from "fastify";
import Fastify from "fastify";
Expand Down Expand Up @@ -70,7 +70,8 @@ export const startServer = async (): Promise<FastifyInstance> => {
// check if cache & postgres are connected
await fastifyServer.cacheDb.ping();

await checkConnection();
// await checkConnection();
await generateMigration();
await runMigrations();

await fastifyServer.listen({ port: Number(port), host: "0.0.0.0" });
Expand Down
81 changes: 36 additions & 45 deletions apps/api/src/utils/golabalUtils.ts
Original file line number Diff line number Diff line change
@@ -1,70 +1,61 @@
/* eslint-disable @typescript-eslint/no-unnecessary-condition -- ensure that the environment is set */
/* eslint-disable @typescript-eslint/no-extraneous-class -- This is a utility class */

import jwt from "jsonwebtoken";
import dotenv from "dotenv";
import type { z } from "zod";
import { buildJsonSchemas } from "fastify-zod";
import jwt from "jsonwebtoken";
import type { z } from "zod";

dotenv.config();

class GlobalUtils {
private static currentEnv = process.env.NODE_ENV || "local";
private static currentEnv = process.env.NODE_ENV || "local";

public static getApiHostUrl(): string {
if (this.currentEnv === "prod") {
return process.env.REMOTE_BACKEND_HOST_URL;
public static getApiHostUrl(): string {
return process.env.BACKEND_HOST_URL || "http://localhost:4005";
}
return process.env.LOCAL_BACKEND_HOST_URL;
}

public static getRedisUrl(): string | undefined {
if (this.currentEnv === "prod") {
return process.env.REDIS_URL_PROD;
public static getRedisUrl(): string | undefined {
return process.env.REDIS_URL;
}
return process.env.REDIS_URL_LOCAL;
}

public static getPostgresUrl(): string | undefined {
if (this.currentEnv === "prod") {
return process.env.PG_DB_URL_PROD;
public static getPostgresUrl(): string | undefined {
return process.env.PG_DB_URL;
}
return process.env.PG_DB_URL_LOCAL;
}

public static getDiscordOAuthRedirectUrl(): string {
const apiHostUrl = this.getApiHostUrl();
return apiHostUrl + process.env.DISCORD_OAUTH_REDIRECT_URL!;
}

public static verifyJwtToken(token: string) {
const secret = process.env.JWT_SECRET!;
if (!secret) {
throw new Error("JWT_SECRET is not set");
public static getDiscordOAuthRedirectUrl(): string {
const apiHostUrl = this.getApiHostUrl();
return apiHostUrl + process.env.DISCORD_OAUTH_REDIRECT_URL!;
}
return jwt.verify(token, secret);
}

public static signJwtToken(payload: Record<string, unknown>) {
const secret = process.env.JWT_SECRET!;
if (!secret) {
throw new Error("JWT_SECRET is not set");
public static verifyJwtToken(token: string) {
const secret = process.env.JWT_SECRET!;
if (!secret) {
throw new Error("JWT_SECRET is not set");
}
return jwt.verify(token, secret);
}
const maxAge = process.env.JWT_MAX_AGE! || "7d";
const token = jwt.sign(payload, secret, {
expiresIn: maxAge as unknown as number,
});

return token;
}
public static signJwtToken(payload: Record<string, unknown>) {
const secret = process.env.JWT_SECRET!;
if (!secret) {
throw new Error("JWT_SECRET is not set");
}
const maxAge = process.env.JWT_MAX_AGE! || "7d";
const token = jwt.sign(payload, secret, {
expiresIn: maxAge as unknown as number,
});

return token;
}

public static getCurrentEnv(): string {
return this.currentEnv;
}
public static getCurrentEnv(): string {
return this.currentEnv;
}

public static zodToSchema(schema: Record<string, z.ZodType>) {
return buildJsonSchemas(schema).schemas[0];
}
public static zodToSchema(schema: Record<string, z.ZodType>) {
return buildJsonSchemas(schema).schemas[0];
}
}

export default GlobalUtils;
19 changes: 2 additions & 17 deletions apps/api/tsdown.config.ts
Original file line number Diff line number Diff line change
@@ -1,28 +1,13 @@
// import { copyFile } from "node:fs/promises";
// import path from "node:path";
import { defineConfig, type Options } from "tsup";
import { defineConfig } from "tsdown";

export default defineConfig((options: Options) => ({
export default defineConfig((options) => ({
entryPoints: ["src/index.ts"],
outDir: "dist",
target: "es2020",
clean: true,
sourcemap: true,
format: ["cjs"],
...options,
// async onSuccess() {
// // Copy .env file
// await copyFile(
// path.join(__dirname, ".env"),
// path.join(__dirname, "../../build/api/.env")
// ).catch(() => {
// console.log("No .env file found to copy");
// });

// // Copy package.json
// await copyFile(
// path.join(__dirname, "package.json"),
// path.join(__dirname, "../../build/api/package.json")
// );
// },
}));
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,19 @@ interface DiscordSigninProps {
export const DiscordSignIn: FC<DiscordSigninProps> = ({ className }) => {
const currentHost = `${window.location.protocol}//${window.location.host}`;
return (
<a className={cn('mt-4', className)} href={APIs.auth.initDiscordAuth(currentHost)}>
Login with Discord
<a
className={cn(
'flex items-center gap-2 border-white/20 bg-white/5 px-8 text-lg font-semibold text-white backdrop-blur-sm hover:bg-white/10',
className
)}
target='_blank'
rel='noopener noreferrer'
href={APIs.auth.initDiscordAuth(currentHost)}
>
<svg className="size-5" viewBox="0 0 71 55" fill="currentColor">
<path d="M60.1045 4.8978C55.5792 2.8214 50.7265 1.2916 45.6527 0.41542C45.5603 0.39851 45.468 0.440769 45.4204 0.525289C44.7963 1.6353 44.105 3.0834 43.6209 4.2216C38.1637 3.4046 32.7345 3.4046 27.3892 4.2216C26.905 3.0581 26.1886 1.6353 25.5617 0.525289C25.5141 0.443589 25.4218 0.40133 25.3294 0.41542C20.2584 1.2888 15.4057 2.8186 10.8776 4.8978C10.8384 4.9147 10.8048 4.9429 10.7825 4.9795C1.57795 18.7309 -0.943561 32.1443 0.293408 45.3914C0.299005 45.4562 0.335386 45.5182 0.385761 45.5576C6.45866 50.0174 12.3413 52.7249 18.1147 54.5195C18.2071 54.5477 18.305 54.5139 18.3638 54.4378C19.7295 52.5728 20.9469 50.6063 21.9907 48.5383C22.0523 48.4172 21.9935 48.2735 21.8676 48.2256C19.9366 47.4931 18.0979 46.6 16.3292 45.5858C16.1893 45.5041 16.1781 45.304 16.3068 45.2082C16.679 44.9293 17.0513 44.6391 17.4067 44.3461C17.471 44.2926 17.5606 44.2813 17.6362 44.3151C29.2558 49.6202 41.8354 49.6202 53.3179 44.3151C53.3935 44.2785 53.4831 44.2898 53.5502 44.3433C53.9057 44.6363 54.2779 44.9293 54.6529 45.2082C54.7816 45.304 54.7732 45.5041 54.6333 45.5858C52.8646 46.6197 51.0259 47.4931 49.0921 48.2228C48.9662 48.2707 48.9102 48.4172 48.9718 48.5383C50.038 50.6034 51.2554 52.5699 52.5959 54.435C52.6519 54.5139 52.7526 54.5477 52.845 54.5195C58.6464 52.7249 64.529 50.0174 70.6019 45.5576C70.655 45.5182 70.6885 45.459 70.6941 45.3942C72.1747 30.0791 68.2147 16.7757 60.1968 4.9823C60.1772 4.9429 60.1437 4.9147 60.1045 4.8978ZM23.7259 37.3253C20.2276 37.3253 17.3451 34.1136 17.3451 30.1693C17.3451 26.225 20.1717 23.0133 23.7259 23.0133C27.308 23.0133 30.1626 26.2532 30.1066 30.1693C30.1066 34.1136 27.28 37.3253 23.7259 37.3253ZM47.3178 37.3253C43.8196 37.3253 40.9371 34.1136 40.9371 30.1693C40.9371 26.225 43.7636 23.0133 47.3178 23.0133C50.9 23.0133 53.7545 26.2532 53.6986 30.1693C53.6986 34.1136 50.9 37.3253 47.3178 37.3253Z" />
</svg>
Add to Discord
</a>
);
};
153 changes: 153 additions & 0 deletions apps/dashboard-client/src/components/landing/ComparisonSection.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
import { motion } from 'framer-motion';
import { Check, X, ArrowRight } from 'lucide-react';
import { useInView } from '@/hooks/use-in-view';
import { Button } from '@/components/ui/button';

export function ComparisonSection() {
const [ref, inView] = useInView({
triggerOnce: true,
threshold: 0.1,
});

const features = [
{ name: 'Native Discord Bot', taskWaku: true, trello: false, linear: false, jira: false },
{ name: '2-Way GitHub Sync', taskWaku: true, trello: 'partial', linear: 'partial', jira: 'partial' },
{ name: 'Open Source', taskWaku: true, trello: false, linear: false, jira: false },
{ name: 'Self-Hostable', taskWaku: true, trello: false, linear: false, jira: 'enterprise' },
{ name: 'Setup Time', taskWaku: '< 5 min', trello: '30+ min', linear: '15 min', jira: '1+ hour' },
{ name: 'Learning Curve', taskWaku: 'Minimal', trello: 'Low', linear: 'Medium', jira: 'Steep' },
{ name: 'Price (per user)', taskWaku: '$2', trello: '$10+', linear: '$8+', jira: '$7.75+' },
{ name: 'Real-time Sync', taskWaku: '< 100ms', trello: 'Minutes', linear: 'Seconds', jira: 'Seconds' },
{ name: 'Offline Mode', taskWaku: true, trello: false, linear: false, jira: false },
{ name: 'API Access', taskWaku: true, trello: 'paid', linear: 'paid', jira: 'paid' },
];

const renderCell = (value: boolean | string) => {
if (value === true) {
return (
<div className="flex items-center justify-center">
<div className="rounded-full bg-green-500/20 p-1">
<Check className="h-5 w-5 text-green-400" />
</div>
</div>
);
}
if (value === false) {
return (
<div className="flex items-center justify-center">
<div className="rounded-full bg-red-500/20 p-1">
<X className="h-5 w-5 text-red-400" />
</div>
</div>
);
}
if (value === 'partial') {
return (
<div className="flex items-center justify-center">
<span className="text-sm text-yellow-400">⚠️ Limited</span>
</div>
);
}
return (
<div className="flex items-center justify-center">
<span className="text-sm text-gray-300">{value}</span>
</div>
);
};

return (
<section ref={ref} className="relative bg-gray-900 py-24 sm:py-32">
<div className="mx-auto max-w-7xl px-6 lg:px-8">
{/* Section Header */}
<motion.div
initial={{ opacity: 0, y: 20 }}
animate={inView ? { opacity: 1, y: 0 } : {}}
transition={{ duration: 0.6 }}
className="mx-auto max-w-3xl text-center"
>
<h2 className="mb-4 text-4xl font-bold tracking-tight text-white sm:text-5xl">
Why{' '}
<span className="bg-gradient-to-r from-blue-400 to-purple-400 bg-clip-text text-transparent">
Task Waku
</span>{' '}
Wins
</h2>
<p className="mt-4 text-lg text-gray-400">
Compare us to the tools you're currently using. The choice is clear.
</p>
</motion.div>

{/* Comparison Table */}
<motion.div
initial={{ opacity: 0, y: 40 }}
animate={inView ? { opacity: 1, y: 0 } : {}}
transition={{ duration: 0.6, delay: 0.2 }}
className="mt-16 overflow-hidden"
>
<div className="overflow-x-auto">
<table className="w-full border-collapse">
<thead>
<tr className="border-b border-white/10">
<th className="p-4 text-left text-sm font-semibold text-gray-400">Feature</th>
<th className="relative p-4 text-center">
<div className="absolute -inset-x-4 -inset-y-2 rounded-2xl bg-gradient-to-b from-blue-500/20 to-purple-500/20" />
<div className="relative">
<div className="mb-1 text-lg font-bold text-white">Task Waku</div>
<div className="text-xs text-blue-400">Our Solution</div>
</div>
</th>
<th className="p-4 text-center text-sm font-semibold text-gray-300">
<div>Trello</div>
<div className="text-xs font-normal text-gray-500">+ Zapier</div>
</th>
<th className="p-4 text-center text-sm font-semibold text-gray-300">Linear</th>
<th className="p-4 text-center text-sm font-semibold text-gray-300">Jira</th>
</tr>
</thead>
<tbody>
{features.map((feature, index) => (
<motion.tr
key={index}
initial={{ opacity: 0, x: -20 }}
animate={inView ? { opacity: 1, x: 0 } : {}}
transition={{ duration: 0.4, delay: 0.3 + index * 0.05 }}
className="border-b border-white/5 transition-colors hover:bg-white/5"
>
<td className="p-4 font-medium text-gray-300">{feature.name}</td>
<td className="relative p-4">
<div className="absolute inset-0 bg-blue-500/5" />
<div className="relative">{renderCell(feature.taskWaku)}</div>
</td>
<td className="p-4">{renderCell(feature.trello)}</td>
<td className="p-4">{renderCell(feature.linear)}</td>
<td className="p-4">{renderCell(feature.jira)}</td>
</motion.tr>
))}
</tbody>
</table>
</div>
</motion.div>

{/* Bottom CTA */}
<motion.div
initial={{ opacity: 0, y: 20 }}
animate={inView ? { opacity: 1, y: 0 } : {}}
transition={{ duration: 0.6, delay: 0.8 }}
className="mt-12 text-center"
>
<p className="mb-6 text-lg text-gray-300">
Stop overpaying for tools that don't fit your workflow.
</p>
<Button size="lg" className="group gap-2 bg-blue-600 hover:bg-blue-700">
Try Task Waku Free
<ArrowRight className="h-5 w-5 transition-transform group-hover:translate-x-1" />
</Button>
</motion.div>
</div>

{/* Decorative elements */}
<div className="absolute left-1/4 top-0 h-96 w-96 rounded-full bg-blue-500/10 blur-3xl" />
<div className="absolute bottom-0 right-1/4 h-96 w-96 rounded-full bg-purple-500/10 blur-3xl" />
</section>
);
}
Loading
Loading