Everything is in standard node / JS, built with:
- ReactJS + Bootstrap 4
- FeatherJS (for services)
- Sqlite3
-
Change port number: search port 5000 in src/server.js
-
Change CBDB page link: In src/views/Layout/DefaultLayout.js
window.cbdbLink = (id) => { return "https://input.cbdb.fas.harvard.edu/basicinformation/" + id + "/edit"; }
-
Add / remove header navigation items: In views/Layout/DefaultHeader.js, add / remove items like this:
<Can I="manage" a="tasks" ability={userAbility}> <NavItem className={" "+ this.navStyle("import")} onClick={this.navClicked.bind(this, "import")}> <Link to="/import" className="nav-link">Import a task</Link> </NavItem> </Can>
Note:
-
First line defines permission required for this item.
-
After adding a new page, you should also add it in ./src/services/hooks/abilities.js (rolePermissions)
-
All services are structured as standard REST services (by default port 5000), through FeatherJS (which uses ExpressJS underneath).
- src/server.js: Primary entry point. Responsible for pulling in various services and serve them.
- src/import.js: csv import module
- src/prep_tasks.js: Run this file to create db schema & a few data items.
services/ This is where you find all unerlying services, including ...
- person/: CBDB person search
- tasks/: Service for both task and proposals. Each task is a collection of line items to be crowd sourced. A proposal is a collection crowdsource information for a specific task.
- users/: Services for user and permission (called "abilities") management
- hooks/: Handling of roles/permissions (contributor, reviewer, admin, guest) and authentication function.
- routes.js: Modify this file to add/remove new pages for routing.
- "__custom.scss": Apart from Bootstrap standard scss, all custom CSS are added here.
- DefaultLayout.js: This is the main file that renders every page: which embeds DefaultHeader, DefaultFooter, and one of the component files invoked (under src/views). Client authentication code is also handled here.
- Tasks: Task main crowdsourcing page. As well as Import and Export page.
- Proposals: Proposal page and its various components.
- Manage: User and task management.
- Pages: common pages incl. Login, Register, etc.