Files
wekan/docs/DeveloperDocs/Directory-Structure.md
T
Lauri Ojansivu dcc6c8fe5d Version pane: five tables with a heading each, and what WeKan is installed as.
Admin Panel / Settings / Version was ONE table of 38 rows. The WeKan version,
the OS load average, the DDP transport and a V8 heap counter were the same kind
of thing in it: one flat list, read top to bottom, with no way to jump to the
part you came for.

Five tables now, each under a small heading, in the order somebody debugging
reads them - Platform (what this IS), OS (what it runs on), Meteor (how it talks
to the client: reactivity, reactivity order, DDP transport), Database (type,
versions, commits, storage engine, OpLog, sessions) and Node (version, heap,
memory). Reactivity and DDP moved to Meteor, where they belong: they are how the
client is fed, and they were the two rows most often read as database settings.
Whether an OpLog EXISTS stays with the database, because that is a property of
it. No row was dropped; a test lists all 38 by name and requires each to still
be shown.

NEW ROW: what WeKan is installed as - bundle.zip, Snap, Docker or Sandstorm. It
is the first thing a support answer turns on, and the pane never said it: the
same version keeps its data somewhere else, carries a different database and
gives the admin different reach in each of the four. models/lib/platformPackaging.js
detects it, most-specific-first: an explicit WEKAN_PACKAGING wins (a packaging
that knows what it is should say so, and it is how a future .deb or chart names
itself), then Sandstorm, then snapd's own SNAP/SNAP_NAME, then a container
runtime's marker file, then the bundle. Sandstorm and Snap are asked BEFORE the
container markers on purpose: a grain is a container, and a confined snap can
look like one, so the other order answers "Docker" for both. It claims nothing
it cannot know - there is no "source checkout" answer, because a `meteor run`
and an unpacked bundle are identical from inside the process.

The detection is a pure function taking the environment, the Sandstorm flag and
a file-exists callback, so all nine of its tests run here without a snap, a
container or a grain - including that an empty SNAP is not a snap, that an empty
WEKAN_PACKAGING falls through rather than blanking the field, and that an
unreadable root answers bundle.zip instead of throwing an admin's Version page
away.

The headings are SMALLER than the pane title above them, and a test compares the
two font sizes rather than trusting the CSS to stay that way: five headings at
1.25rem would read as five pane titles and "Version" would be lost among them,
and an unstyled h3 - the browser default here - is larger still. Six new English
strings; the other languages fall back to English until translated, as usual.

tests/clientBundleImports.test.cjs caught the new stylesheet before it could
matter: package.json sets meteor.mainModule, so a .css nobody imports is simply
not in the bundle. It is imported from client/features/settings.js now.

Thanks to xet7 !
2026-08-10 03:40:12 +03:00

21 KiB

Routing

We're using FlowRouter client side router inside config/router.js. For accounts there is AccountsTemplates configured in config/accounts.js.

Client

public

Files in this directory are served by meteor as-is to the client. It hosts some (fav)icons and fonts. wekan-manifest.json: goes into link rel="manifest" in the header of the generated page and is a Web App Manifest.

components

  • activities:
    • activities.jade: activities template for the list of activities placed inside a sidebar-content; uses boardActivities or cardActivities depending on mode; XXX: does this mean that sidebar should be visible in board list mode? when does the board activity gets shown?
    • comments.jade: commentForm template used in card-details-canvas for adding comments;
  • boards:
    • boardArchive.jade: archivedBoards template for the modal dialog showing the list of archived boards that might be restored;
    • boardBody.jade: top level template for presenting a board is board and, based on screen size and current state, it uses either cardDetails or boardBody templates; boardBody is the one including the sidebar, each list, cardDetails for larger screens when a card is selected and the addListForm for adding a new list (also defined in this file);
    • boardHeader.jade: boardHeaderBar, boardMenuPopup, boardVisibilityList, boardChangeVisibilityPopup, boardChangeWatchPopup, boardChangeColorPopup, createBoard, chooseBoardSource, boardChangeTitlePopup, archiveBoardPopup, outgoingWebhooksPopup;
    • boardsList.jade: boardList and boardListHeaderBar for the list of boards in the initial screen;
  • cards:
    • attachments.jade: cardAttachmentsPopup, previewClipboardImagePopup, previewAttachedImagePopup, attachmentDeletePopup, attachmentsGalery;
    • cardDate.jade: editCardDate and dateBadge templates;
    • cardDetails.jade: boardsAndLists is the usual layout for a board display with boardLists being used in sandstorm where each board is independent;cardDetails, editCardTitleForm, cardDetailsActionsPopup, moveCardPopup, copyCardPopup,cardMembersPopup,cardMorePopup, cardDeletePopup;
    • cardTime.jade: editCardSpentTime and timeBadge templates;
    • checklists.jade: checklists, checklistDetail, checklistDeleteDialog, addChecklistItemForm, editChecklistItemForm, checklistItems, itemDetail;
    • labels.jade: formLabel, createLabelPopup, editLabelPopup, deleteLabelPopup, cardLabelsPopup;
    • minicard.jade: has the minicard template
  • forms: inlinedform.jade has theinlinedForm template;
  • import:
  • lists:
    • list.jade: list is the simple, main template for lists;
    • listBody.jade: listBody, addCardForm, autocompleteLabelLine templates;
    • listHeader.jade: listHeader, editListTitleForm, listActionPopup, boardLists, listMorePopup, listDeletePopup, setWipLimitPopup, wipLimitErrorPopup templates;
  • main:
    • editor.jade: editor and viewer templates;
    • header.jade: header and offlineWarning templates; if the user is connected we display a small "quick-access" top bar that list all starred boards with a link to go there (this is inspired by the Reddit "subreddit" bar); the first link goes to the boards page;
    • keyboardShortcuts.jade: shortcutsHeaderBar, shortcutsModalTitle, keyboardShortcuts - all for the shortcuts that are presented when you press ?re implemented inhere;
    • layouts.jade: has the template for head portion of the html page and other general purpose templates: userFormsLayout, defaultLayout, notFound, message;
    • popup.tpl.jade: tpl files only define a single template so there's no need to wrap content in a template tag; the name of the template is the base name of the file (popup in this case);
    • spinner.tpl.jade: is the template for a "waiting" dialog;
  • settings:
    • informationBody.jade: the statistics template — the Version pane of Admin Panel / Settings, five tables (Platform, OS, Meteor, Database, Node). There is no information template any more: it is a pane rendered by settingBody.jade, not a page;
    • invitationCode.jade: invitationCode template;
    • peopleBody.jade: people, peopleGeneral, peopleRow, editUserPopup;
    • settingBody.jade: setting, general, email, accountSettings, announcementSettings
    • settingHeader.jade: settingHeaderBar template;
  • sidebar:
    • sidebar.jade: sidebar, homeSidebar, membersWidget, labelsWidget, memberPopup, removeMemberPopup, leaveBoardPopup, addMemberPopup, changePermissionsPopup
    • sidebarArchives.jade: archivesSidebar
    • sidebarFilters.jade: filterSidebar, multiselectionSidebar, disambiguateMultiLabelPopup, disambiguateMultiMemberPopup, moveSelectionPopup;
  • users:
    • userAvatar.jade: userAvatar, userAvatarInitials, userPopup, memberName, changeAvatarPopup, cardMemberPopup
    • userHeader.jade: headerUserBar, memberMenuPopup, editProfilePopup, editNotificationPopup, changePasswordPopup, changeLanguagePopup, changeSettingsPopup;
  • mixins: extends infiniteScrolling.js for card details, sidebar and also extends perfectScrollbar.js;

config

lib

  • accessibility.js: define a set of DOM transformations that are specifically intended for blind screen readers;
  • cssEvents.js: the CSSEventsobject has methods that select the name of the event based on the specific transitions and animations;
  • pasteImage.js and dropImage.js: utility for pasting and dropping images on a web app; XXX: add comments; not same style as the rest of the code
  • emoji-values.js: sets Emoji.values;
  • escapeActions.js: defines the behavior (mostly canceling current edit) for escape keyboard key;
  • i18n.js: at startup we choose the language for the ui based on user profile or browser language;
  • inlinedform.js: forms for editing a single field (like adding a card); XXX: comments in code suggest that a form that is not submitted will retain its value to prevent data loss using unsavedEdits.js;bug?; XXX: edit button to save and open;
  • keyboard.js: the shortcuts that are presented when you press ?re implemented inhere;
  • mixins.js: stub; no Mixins at this point; XXX: what does new class do? exlint: missing () invoking a constructor
  • popup.js: defines Popup class for things likes electing a date; XXX: not a Blaze helper?
  • textComplete.js: extends jquery-textcomplete to integrate with the rest of the system (like escape actions, tab and enter key handling); XXX: deprecated?
  • utils.js: various methods all over the place (resize, screen size, sort, capitalize, navigate to board and card);
  • Blaze helpers:
    • filter.js: registers Filter Blaze helper to support filtering cards by labels and by members;
    • modal.js: registers Modal Blaze helper to support showing modal windows like the one for archived boards;
    • multiSelection.js: registers Modal Blaze helper to support multiple selection mode;
    • unsavedEdits.js: registers getUnsavedValue and hasUnsavedValue Blaze helpers to preserve content entered in fields but not saved;

Server

.js files in this directory are not available to the client.

Models

The files in models directory mainly define collections; most of them have aldeed SimpleSchema for automatic validation of insert and update of collections. This is also where helpers, mutations, methods, hooks and bootstrap code is to be found. Server side code also implements json REST API.

Collections (mostly Mongo.Collection except as noted) are defined in:

Other files:

  • watchable.js: extends the schema, helpers and mutations of Boards, Lists and Cards.
  • export.js: has some code to support the REST API.
  • import.js: implements importBoard() method so that Trello (in trelloCreator.js) and Wekan (in wekanCreator.js) boards can be imported. XXX: Solid candidates for a directory of their own.

Tools

Info


Contributions to this page

This documentation was contributed by TNick and xet7 while Wekan was at commit e2f768c. Please add new files, fixes, updates, etc directly to this page.