oneFlow is a single Next.js application on a single MongoDB database. Its interest is not in scale. It is in the number of different actors that touch the same records: staff in Slack, staff and clients in a browser, applicants and mail recipients on public pages, and four outside services that have to be told what changed.
The system on one page

| Component | Technology | Responsibility |
|---|---|---|
| Web application | Next.js 14 App Router, React 18, TypeScript in strict mode, Tailwind | Staff and client screens, public application and unsubscribe pages |
| API | Next route handlers, one folder per domain | Reservations, studio slots, broadcast projects, hosts, brands and agencies, hiring, mail, notifications |
| Slack entry | Two route handlers: commands and interactions | Signature check, command routing, modal submissions, menu actions |
| Rules | Plain TypeScript modules | Workflow transitions and preconditions, the role matrix, recurrence generation, conflict queries |
| Database | MongoDB, official Node driver, no ODM | One database, one shared client per process |
| Files | Object storage with presigned access | Applicant documents, mail images |
| Calendar sync | Google Calendar API, service account | One event per booking, updated and deleted by a stored event id |
| Notifier | Slack Web API, SMS gateway, email provider | Direct messages, channel posts, SMS, campaign mail |
| Process | pm2, one instance | Restart on failure and on a memory ceiling |
| Tests | Vitest | Permission matrices, workflow transitions, field rules, ownership checks |
Three ways in
Slack. Two Slack apps point at the same pair of routes: one bot for meeting rooms and one for the studio. Every request carries a signature. The route computes its own over the raw body with each bot’s signing secret in turn, and whichever secret verifies decides which bot’s client answers. A request older than five minutes is refused. The details are in Room booking from Slack.
The browser. Staff sign in with an email and password after an admin has approved the account. Client users, the brands and agencies the company works with, join through an invitation link that expires after seven days and is tied to their brand or agency.
Public pages. Three groups of people use the tool without an account: job applicants, who apply and book interviews, people who fill in a marketing diagnosis, and mail recipients, who unsubscribe.
Data
Each module owns its collections. Nothing is shared through an ORM layer: route handlers and library functions use the driver directly, with TypeScript interfaces describing each document.
| Module | Collections | What a document is |
|---|---|---|
| Accounts | users, invitations, page permissions | A person with a role, a rank and departments. A pending client invitation. The allow-list for one page |
| Calendar | reservations, live broadcasts | One booking of a room on one date. One studio slot with its crew |
| Broadcast projects | broadcast projects, show hosts, brands, agencies, categories | One client broadcast with its stage, dates, hosts, design assets and report. The host roster. Master data |
| Hiring | careers, applicants, interview bookings | One job posting with its interview slots. One applicant with a stage and an SMS history |
| Notes | meetings, team notes, revisions | Team-lead meeting notes with every revision kept |
| mail contacts, campaigns, logs, images | One contact with imported fields and a subscription status. One campaign and one log row per recipient | |
| Leads | diagnosis leads, events, settings, recipients | Leads from the two marketing funnels |
| Notifications | notifications | One in-app notice |
Dates and times are stored the way the office reads them: a date string and wall-clock times in Korean time. Google Calendar events carry the same local time with an explicit time zone.
Permissions

The first model is roles: nine of them, each mapped to a set of twenty actions, with each workflow transition listing the roles that may trigger it. The broadcast workflow still runs on it.
A second model, added in April 2026, describes a person by a rank, the departments they belong to and the departments they lead. Where a user has no rank yet, it is derived from their role, so the two models work side by side without a migration that has to happen all at once.
The third layer is a page allow-list that an administrator edits in the tool. A page with no list is open to every signed-in user. A page with a list is open to the people on it.
What happens after a write
A booking, a stage change or a host selection usually has to be announced somewhere. One notifier function takes an event and fans it out: an in-app notice for everyone, a Slack direct message for internal users, an SMS for client users, and for some events a post to a team channel.
All of that happens after the database write. On the Slack path the calendar sync and the confirmation message are started and not awaited, because Slack closes the request after three seconds and a slow calendar call must not turn a saved booking into an error on the user’s screen.
Meeting reminders are the one piece of scheduled work. A route designed to be called once a minute finds today’s bookings whose reminder time has arrived, and sends each reminder once. It knows a reminder has been sent because the booking keeps a list of the reminder keys already delivered.
Deployment
The application runs as one pm2 process. A deploy script builds locally, copies the build to the server without touching the environment files or uploaded documents, installs dependencies and reloads the process.
Decisions
1. Slack as an entry point with the same standing as the web. A room is booked, changed and cancelled from a slash command and a modal, and the day’s timeline arrives as a direct message. The web calendar shows the same records.
2. Two bots, one codebase. Rooms and studio slots are two Slack apps. They share the routes, the signature check and the modal builder, and are told apart by which signing secret verifies.
3. Respond first, sync after. The booking is the source of truth and the calendar is a mirror. The response to Slack depends only on the database. The mirror is updated afterwards.
4. One document per occurrence. A stored recurrence rule was the alternative. A weekly meeting for a quarter is thirteen bookings that share a group id, and thirteen calendar events. Conflict checks, reminders and edits then work on plain documents, with no rule to expand at read time.
5. The official driver and shared types, no ODM. Documents are described by TypeScript interfaces shared across the codebase. Queries are written as the database runs them.
6. The workflow as data. Allowed transitions, the roles for each, and the preconditions are three small tables and functions, separate from the routes. That is what lets the tests state the workflow as rows of allowed and refused moves.
7. Clients inside the tool. A brand or agency acts on its own project as a user with the client role: it accepts a date, confirms a host, and approves or sends back a design.
