Review how the components are imported and organized.
We repeat this process for 3–4 pages to establish a common pattern, see if there’s any exceptions.
In this part 1.1, we review the components structure in the Twenty’s onboarding feature. When you signup, Twenty has this onboarding asking for info such as your profile, trial period plan, inviting your team mates etc.,
I got curious about how the components behind this feature are organized and I looked at it’s source code.
CreateWorkspace.tsx has about 245 LOC. I found the following imports for the components rendered inside this.
import { Modal } from '@/ui/layout/modal/components/Modal';import { Logo } from '@/auth/components/Logo';import { Title } from '@/auth/components/Title';import { Trans, useLingui } from '@lingui/react/macro';import { SubTitle } from '@/auth/components/SubTitle';import { MainButton } from 'twenty-ui/input';
Most commonly used ones such as Logo, Title, Subtitle are imported from @/auth/components
MainButton is from input
So far, there is no specific pattern, components are imported depending on the need. The only thing that matters here is the colocation.
CreateProfile.tsx has about 254 LOC. I found the following imports for the components rendered inside this.
import { Modal } from '@/ui/layout/modal/components/Modal';import { SubTitle } from '@/auth/components/SubTitle';import { Title } from '@/auth/components/Title';import { WorkspaceMemberPictureUploader} from '@/settings/workspace-member/components/WorkspaceMemberPictureUploader';import { TextInput } from '@/ui/input/components/TextInput';import { MainButton } from 'twenty-ui/input';
Again, Title, SubTitle and Modal are commonly reused. The imports between CreateWorkspace and CreateProfile look similar.
I did mention the term, “colocation”. WorkspaceMemberPictureUploader is technically part of settings but it is reused in this CreateProfile. You colocate components, but import them as you see fit.
I spent 200+ hours analyzing Supabase, shadcn/ui, LobeChat. Found the patterns that separate AI slop from production code. Stop refactoring AI slop. Start with proven patterns. Check out production-grade projects atthinkthroo.com