Skip to content

Commit 8a4984c

Browse files
committed
Merge branch 'release/v0.2.0'
2 parents 08ef723 + 17cc4cf commit 8a4984c

File tree

15 files changed

+384
-40
lines changed

15 files changed

+384
-40
lines changed

README.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,33 @@
1-
# Majifix
1+
# MajiFix
22

33
MajiFix was developed by the World Bank in Tanzania to solve the challenge of tracking problems in cities through citizen crowd sourcing.
44

55
MajiFix builds up on the movement of civic issue tracking by adopting since day zero the well known standard Open311 GeoReport v2.
66

77
MajiFix is completely open source. It is free to use and to adapt, or adopt by anyone.
88

9-
## Our aim
9+
This is an official documentation on how you can contribute, use , extend or deploy
10+
MajiFix to your organization.
1011

11-
With MajiFix, we aim to:
12+
## Contributing
1213

13-
Open city governments, by creating new communication channels with their citizens.
14-
allow citizens to report problems they face in their daily lives, and empowering them to share existing problems.
15-
support public service providers in solving each and every problem, while giving feedback to people about updates on the efforts to solve each problem.
14+
Please improve this documentation by cloning this repo. Create a feature branch for what
15+
you are working on, after you are done, please submit your pull request.
1616

17-
## Majifix components
17+
```sh
18+
git clone https://github.com/CodeTanzania/majifix-docs.git
19+
```
1820

19-
MajiFix has different components
21+
Install all required dependencies
2022

21-
- A ticket management system to support public officials to keep track of problems that were reported.
22-
- A management app that provides statistics about system performance to city managers.
23-
- A mobile app that citizens can use to easily report problems.
24-
- A Facebook Messenger Bot, so that people can submit problems through FB Messenger’s interface. No need to download an app.
25-
- A USSD interface, specially relevant in places where not everyone owns a smartphone.
26-
- A public website, that publicly shows what is going on with the system.
23+
```sh
24+
npm install
25+
```
2726

28-
## Our vision
27+
### Run it in development mode
2928

30-
MajiFix tries to achieve two main outcomes:
29+
```sh
30+
npm run serve
31+
```
3132

32-
- Improving efficiency of public services, by providing relevant information to the relevant stakeholders,at the right time.
33-
- Improving social accountability about public services, by providing public statistics about the performance of public services.
33+
and view it on http://localhost:3000

_media/background-image.jpg

908 KB
Loading

_sidebar.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,17 @@
22

33
- Home
44

5-
- [Introduction](/)
5+
- [Introduction](/get-started.md)
66

77
- Get Started
88

99
- [Create Module](get-started/create-module.md)
10+
- [Deploy MajiFix](get-started/deploy-platform.md)
1011

1112
- Guides
1213

1314
- [Best Practices](guides/best-practices.md)
15+
- [Documentation](guides/documentation.md)
1416
- [Testing](guides/testing.md)
1517
- [Source Code Management](guides/scm.md)
1618

cover.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Welcome to MajiFix
2+
3+
[GitHub](https://github.com/CodeTanzania)
4+
[Get Started](/get-started)
5+
6+
<!-- background image -->
7+
![](_media/background-image.jpg)

get-started.md

Lines changed: 68 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,68 @@
1-
# Get Started on Majifix
1+
# MajiFix
2+
3+
MajiFix was developed by the World Bank in Tanzania to solve the challenge of tracking problems in cities through citizen crowd sourcing.
4+
5+
MajiFix builds up on the movement of civic issue tracking by adopting since day zero the well known standard Open311 GeoReport v2.
6+
7+
MajiFix is completely open source. It is free to use and to adapt, or adopt by anyone.
8+
9+
## Our aim
10+
11+
With MajiFix, we aim to:
12+
13+
Open city governments, by creating new communication channels with their citizens.
14+
allow citizens to report problems they face in their daily lives, and empowering them to share existing problems.
15+
support public service providers in solving each and every problem, while giving feedback to people about updates on the efforts to solve each problem.
16+
17+
## MajiFix components
18+
19+
MajiFix has different components. The following text provides brief description of each component.
20+
21+
### MajiFix API
22+
23+
MajiFix API is built on Node.JS. It is a RESTful API layer designed in support of reporting and tracking common public service (i.e. water) problems.
24+
25+
It is consists of a suite of node packages covering the business/domain logic (the part of a platform that encodes the real-world business rules that determine how data is created, displayed, stored and changed), built for performance and scale.
26+
27+
You can consider it as the data layer within a platform (including the data model). It is designed to be plugged into a templating layer, a mobile application or to be used with any other data consumer.
28+
29+
MajiFix API provides a starting point that's further advanced than a framework. It allows you to get a complete data layer up and running in minutes.
30+
31+
See source code [repository](https://github.com/CodeTanzania/open311-api).
32+
33+
### MajiFix management app
34+
35+
MajiFix management app is designed to help manages statistical information about system performance to official city managers.
36+
37+
See source code [repository](https://github.com/CodeTanzania/open311-mobile-manager).
38+
39+
### MajiFix citizen mobile app
40+
41+
MajiFix mobile app is used by citizens to help them instantly report problems to city managers.
42+
43+
Work still continues in a private repository. A public repository will be available as soon as a stable release is published.
44+
45+
### MajiFix facebook messenger bot
46+
47+
MajiFix facebook messenger bot is designed to create more social engagement by allowing citizens to submit problems to the MajiFix platform through Facebook Messenger's interface without downloading the actual app.
48+
49+
See source code [repository](https://github.com/CodeTanzania/facebook-majifix-bot).
50+
51+
### MajiFix USSD
52+
53+
MajiFix USSD interface, specially relevant in places where not everyone owns a smartphone.
54+
55+
See source code *This is yet to be published*.
56+
57+
### MajiFix website
58+
59+
A public website, that publicly shows what is going on with the system.
60+
61+
See source code [repository](https://github.com/CodeTanzania/majifix.io).
62+
63+
## Our vision
64+
65+
MajiFix tries to achieve two main outcomes:
66+
67+
- Improving efficiency of public services, by providing relevant information to the relevant stakeholders,at the right time.
68+
- Improving social accountability about public services, by providing public statistics about the performance of public services.

get-started/create-module.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# Create Majifix Module
1+
# Create MajiFix Module
22

3-
To create a new Majifix module follow these steps
3+
To create a new MajiFix module follow these steps
44

55
- Clone this [repository](https://github.com/CodeTanzania/majifix-module-starter)
66
- Delete .git folder by running

get-started/deploy-platform.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Deploy MajiFix Checklist

guides/best-practices.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
The most preferred editor used currently in the project is [Visual Studio Code](https://code.visualstudio.com/). If you opt to use this editor we advice you
66
have these extensions installed in your editor.
77

8-
- jshint
8+
- Jshint
99
- EditorConfig for VSCode
1010
- ESLint
1111
- Sublime Babel

guides/documentation.md

Lines changed: 208 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,208 @@
1+
# Documentation
2+
3+
In this project we try our level best to document the code so that the any new
4+
developer can easily chip in and understand what is going on. We highly recommend
5+
that you document any piece of code your are adding on this project.
6+
7+
Below is our recommendation when documenting routers in API modules. It is not
8+
an exhaustive list but it will act as a starting point when we are documenting
9+
routers for API modules.
10+
11+
## API Router Documentation
12+
13+
For API routes documentation we use [apidoc](http://apidocjs.com/) which generate
14+
API documentation directly from block comments from the codes.
15+
16+
### Route Documentation
17+
18+
While documenting a route we recommend the comments to have the following
19+
20+
- @api
21+
- @apiVersion
22+
- @apiName
23+
- @apiGroup
24+
- @apiDescription
25+
- @apiUse RequestHeaders
26+
- @apiUse [*Success returned object format*]
27+
- @apiUse RequestHeadersExample
28+
- @apiUse [*Success response example*]
29+
- @apiUse JWTError
30+
- @apiUse JWTErrorExample
31+
- @apiUse AuthorizationHeaderError
32+
- @apiUse AuthorizationHeaderErrorExample
33+
34+
```js
35+
/**
36+
* @api {get} /jurisdictions List Jurisdictions
37+
* @apiVersion 1.0.0
38+
* @apiName GetJurisdictions
39+
* @apiGroup Jurisdiction
40+
* @apiDescription Returns a list of jurisdictions
41+
* @apiUse RequestHeaders
42+
* @apiUse Jurisdictions
43+
*
44+
* @apiUse RequestHeadersExample
45+
* @apiUse JurisdictionsSuccessResponse
46+
* @apiUse JWTError
47+
* @apiUse JWTErrorExample
48+
* @apiUse AuthorizationHeaderError
49+
* @apiUse AuthorizationHeaderErrorExample
50+
*/
51+
router.get(PATH_LIST, function getJurisdictions(request, response, next) {
52+
...
53+
}
54+
```
55+
56+
For RequestHeaders, RequestHeadersExample, JWTError, JWTErrorExample,
57+
AuthorizationHeaderError and AuthorizationHeaderErrorExample apidocs comments are
58+
already defined in [majifix-common](https://github.com/CodeTanzania/majifix-common) module.
59+
To use it you just have to include it in your apidoc build system.
60+
61+
This is an example of configuring apidoc grunt plugin to read apidoc comments from
62+
[majifix-common](https://github.com/CodeTanzania/majifix-common)
63+
64+
```js
65+
apidoc: {
66+
api: {
67+
src: ['node_modules/@codetanzania/majifix-common/lib', 'lib/'],
68+
dest: 'docs/',
69+
options: {
70+
debug: true,
71+
includeFilters: ['.*\\.js$'],
72+
}
73+
}
74+
}
75+
```
76+
77+
For Success returned object format and Success response example should be defined in the router file as shown in below examples:
78+
79+
```js
80+
/**
81+
* @apiDefine Jurisdictions
82+
* @apiSuccess {Object[]} data List of jurisdictions
83+
* @apiSuccess {String} data._id Unique jurisdiction identifier
84+
* @apiSuccess {String} [data.jurisdiction = undefined] jurisdiction under
85+
* which this jurisdiction belongs
86+
* @apiSuccess {String} data.code Unique human readable coded name of
87+
* the jurisdiction. Used in deriving service request code
88+
* @apiSuccess {String} data.name Unique human readable name of the jurisdiction
89+
* @apiSuccess {String} data.phone Primary mobile phone number used to
90+
* contact jurisdiction
91+
* @apiSuccess {String} data.email Primary email address used to contact
92+
* jurisdiction direct
93+
* @apiSuccess {String} [data.website] Primary website url of the jurisdiction
94+
* @apiSuccess {String} [data.about] A brief summary about jurisdiction
95+
* if available i.e additional details that clarify what a jurisdiction do
96+
* @apiSuccess {String} [data.address] Human readable physical address of
97+
* jurisdiction office
98+
* @apiSuccess {String} [data.color] A color code(in hexadecimal format)
99+
* eg. #363636 used to differentiate jurisdictions visually
100+
* @apiSuccess {Point} [data.location] A center of jurisdiction. Its an
101+
* office reachable by citizen(or customer)
102+
* @apiSuccess {MultiPolygon} [data.boundaries] Jurisdiction boundaries.
103+
* Its mainly used for geo lookup of service request jurisdiction
104+
* based on its geo coordinates.
105+
* @apiSuccess {Date} data.createdAt Date when jurisdiction was created
106+
* @apiSuccess {Date} data.updatedAt Date when jurisdiction was last updated
107+
* @apiSuccess {Number} total Total number of jurisdiction
108+
* @apiSuccess {Number} size Number of jurisdiction returned
109+
* @apiSuccess {Number} limit Query limit used
110+
* @apiSuccess {Number} skip Query skip/offset used
111+
* @apiSuccess {Number} page Page number
112+
* @apiSuccess {Number} pages Total number of pages
113+
* @apiSuccess {Date} lastModified Date and time at which latest jurisdiction
114+
* was last modified
115+
*/
116+
117+
118+
/**
119+
* @apiDefine JurisdictionsSuccessResponse
120+
* @apiSuccessExample {json} Success-Response:
121+
* {
122+
* "data": [
123+
* {
124+
* "_id": "5aef42d59748e41e02e2a562",
125+
* "jurisdiction": {
126+
* "_id": "5af2aad4408ccb594b173f96",
127+
* "code": "84105193",
128+
* "name": "Faroe Islands"
129+
* },
130+
* "code": "66230485",
131+
* "name": "Kunze and Sons",
132+
* "phone": "1-964-200-3838 x5726",
133+
* "email": "mazie_bayer@hotmail.com",
134+
* "website": "vilma.net",
135+
* "about": "Molestias culpa porro pariatur.",
136+
* "address": "6552 Haven Prairie",
137+
* "color": "#b32acc",
138+
* "location": {
139+
* "type": "Point",
140+
* "coordinates": [
141+
* -77.5707764925392,
142+
* 39.880937519031235
143+
* ]
144+
* },
145+
* "boundaries": {
146+
* "type": "MultiPolygon",
147+
* "coordinates": [
148+
* [
149+
* [
150+
* [
151+
* -76.80207859497996,
152+
* 55.69469494228919
153+
* ],
154+
* [
155+
* -75.71404588095427,
156+
* 53.59198291229545
157+
* ],
158+
* [
159+
* -73.49941546156064,
160+
* 47.7536674960849
161+
* ],
162+
* [
163+
* -78.24692848453104,
164+
* 51.75424604090497
165+
* ],
166+
* [
167+
* -77.96718998971203,
168+
* 43.532912808667284
169+
* ],
170+
* [
171+
* -80.05583147381611,
172+
* 51.2655718114278
173+
* ],
174+
* [
175+
* -87.10717890417094,
176+
* 49.55715210838287
177+
* ],
178+
* [
179+
* -86.82247323878836,
180+
* 57.53161913076085
181+
* ],
182+
* [
183+
* -81.00322721012589,
184+
* 56.68343367062641
185+
* ],
186+
* [
187+
* -81.15080039041881,
188+
* 57.91444311426214
189+
* ],
190+
* [
191+
* -76.80207859497996,
192+
* 55.69469494228919
193+
* ]
194+
* ]
195+
* ],
196+
* ]
197+
* }
198+
* ],
199+
* "total": 5,
200+
* "size": 1,
201+
* "limit": 1,
202+
* "skip": 0,
203+
* "page": 1,
204+
* "pages": 5,
205+
* "lastModified": "2018-05-06T18:00:53.283Z"
206+
* }
207+
*/
208+
```

0 commit comments

Comments
 (0)