Focura

Developer Overview

Stack, architecture goals & repo structure

Focura is a full-stack TypeScript SaaS split across two repositories: a Next.js 16 client and an Express.js backend. Both share a PostgreSQL database via Prisma and communicate over HTTPS with RS256 JWT tokens.

Tech stack

LayerTechnology
Frontend runtimeNext.js 16 (App Router) + React 19
LanguageTypeScript throughout
StylingTailwind CSS v4 + tw-animate-css
State / dataTanStack Query (React Query) v5
Auth (client)NextAuth.js v5
HTTP clientAxios (custom instance in lib/axios.ts)
Backend runtimeNode.js + Express.js
ORMPrisma + PostgreSQL (Supabase)
Auth (server)RS256 JWT — private key on backend only
CachingUpstash Redis (ioredis, TLS)
Real-timeServer-Sent Events (SSE)
Job schedulingnode-cron
TestingVitest + React Testing Library + MSW

Repository structure

🖥focura-client
Next.js 16 frontend. Folders: app/ components/ hooks/ lib/ types/ constants/ context/ utils/ tests/
⚙️focura-backend
Express.js API. Folders: src/modules/ src/middleware/ src/lib/ src/sockets/ src/crons/ prisma/ keys/

Backend modules

activityAudit trail — logs every task/workspace mutation
analyticsDAU stats, workspace usage, productivity metrics
attachmentFile attachment CRUD linked to tasks
calendarScheduling logic, insights, aggregation
commentTask comments, @mention parsing, replies
dailyTaskDaily task list with cron-based reset
fileManagementFile listing, filters, workspace-scoped storage
focusSessionFocus Mode sessions, analytics, stats
labelPer-project task labels with color
notificationSSE notification records, mark-read
projectProject CRUD, members, slug, stats
storageSigned upload URLs, storage quota
taskFull task lifecycle, filters, activity, notifications
uploadMultipart upload handler
workspaceWorkspace CRUD, member roles, invitations
💡

Every module is self-contained. Adding a new domain feature means creating a new folder under src/modules/ — you never touch other modules.