Join the team?
- Contact us via form, drop Mikael a message or join the chat on IRC.
- See issue list and read about [[milestones]].
- We’re quite planned and tasks are done in prioritised order so starting to write code without communicating with the team first mixes up things. It doesn’t mean that you can’t work on other things. We value all progress. If you’ve found a bug, feel free to just fix it and send us pull requests. That said, drop us a line first before you start working on something bigger.
- Our features list is kept short and simple. While many things would be awesome to have, it sometimes makes more sense to make less but better. We know it’s fun to work on your own ideas but this is a team effort. Avoid clutter and keep things simple.
- It would be good if you’d get familiar with the code base with smaller tasks, see easy tag for those. Ask us for guidance and we’ll help.
- We’re looking forward to work with proactive, talented hackers! :-) It’s easier to work with people who can commit for longer term, who are proactive and can work independently. Kudos!
How to write code
- Master is the most up-to-date branch and updated frequently. New feature branches are under our own repository and work is merged via pull requests, apart from very small changes. If you’re not actively working on Trustroots yet, just fork the project and send pull requests from your repo.
- Tests! We use Travis-cli to inform us when something fails. Don’t be the weasel! :-)
- Write JSDoc comment blocks, please, or add them when you see them missing.
- Check [[Accessibility]].
- Mikael is responsible of deployments to production, ask more for details.
- We’re aiming for continuous delivery methods (not quite there yet, but almost).
- MEAN stack, seeded originally with MEAN.js boilerplate: MongoDB, ExpressJS, AngularJS v1, NodeJS. Additionally stuff like Bootstrap, Leaflet etc.
- [[Database]] scheme (look for
*.server.model.jsproject files to check most up to date info)
- We’re migrating the client to React. Read a migration guide.
The mobile app
We have a React Native app for Android written in ClojureScript: https://github.com/Trustroots/Trustroots-React-Native
- Project has .editorconfig file, we recommend to download extension for your IDE.
- Build script checks all the files against our ESLint rules. Fix errors before submitting PR.
- Indentation with 2 spaces
- Beginning brace on the same line as the beginning statement
- File names use dash to separate words. For example: foo-bar.js
- Use camelCase for identifiers. Functions and variable names should be named like
- See Angular 1 Style Guide
- We use LESS CSS for CSS.
- Build as generic modules as possible. Rather
CSS class names
- Name reusable bits of layouts by module names and keep them out of page styles, (eg.
.group-badgecan be used in multiple places around the site.)
- Related elements within a module use the base name as a prefix. For example module
- Prefix state rules with
Convention is as follows:
- Url has the plural like
- The id is the singular name followed by
- The route with the id is called nameSingle like
- Template name matches route name
- Nested routes are simply concatenated like
messagesThread- deviates because it is
Slowly getting there. Any help/experiences appreciated! #228
…mainly to test Mongo models (example).
…as well some critical bits of Angular frontend (example).
… mainly for the API routes (example).
End-to-end tests with Selenium
We have a free Automate account with Browserstack (#199, blog) — this is offered to us for free since we’re an open source project. This makes it very easy for us to test the project on tons of different browsers on various platforms, including MSIE.
Written in Python, using Selenium (#225).
(Selenium tests are currently out of date.)
npm testfor everything,
npm run test:serverfor Mocha tests,
npm run test:server:watchsame with watching,
npm run test:clientfor testing Karma-unit tests and
npm run test:seleniumto run Selenium tests. Requires Python. Make sure Trustroots is running already as this task won’t spin it up first. This task isn’t included in the main test task. If you want to pass custom domain to test for Selenium you can do so by running:
python ./scripts/selenium/test.py http://dev.trustroots.org/
Documents our internal API end points. Great help for writing integration tests.
Swagger editor file: swagger.json