Task Tracker that builds custom reports/invoices for Mavenlink workspaces.
└── client: Client. A VueJS & TypeScript application.
└── service: API. A Node, Express & TypeScript application.
- Access the
client/
directory.
cd ~/MavenlinkReportBuilder/client
- Install npm packages.
npm install
-
Install and set up MongoDB. Follow their guides for your operating system.
-
Start MongoDB without access control.
For Homebrew:
sudo mongod --port 27017 --dbpath /usr/local/var/mongodb
- Open a new tab in your Terminal and start a mongo instance
mongo --port 27017
- Switch to admin database and create admin user.
use admin
db.createUser(
{
user: "superAdmin",
pwd: passwordPrompt(),
roles: [ { role: "userAdminAnyDatabase", db: "admin" }, "readWriteAnyDatabase" ]
}
)
- Shut down the mongod instance followed by the mongo shell.
db.adminCommand( { shutdown: 1 } )
exit
- Open your MongoDB configuration file.
For macOS Intel:
open /usr/local/etc/mongod.conf -a TextEdit
Find the path for your OS here.
- Add the following to the config file:
security:
authorization: enabled
- Go back to your first Terminal tab and start MongoDB using your new configuration file.
For Homebrew:
sudo mongod --config /usr/local/etc/mongod.conf
- Switch to your second tab in the Terminal and start a mongo shell with authentication.
mongo --port 27017 --authenticationDatabase "admin" -u "superAdmin" -p
- Access the
service/
directory.
cd ~/MavenlinkReportBuilder/service
- Install npm packages.
npm install
-
Open
~/MavenlinkReportBuilder/service/.env.template
. -
Create a file in
~/service
called.env
. -
Paste the content you copied from
.env.template
in.env
. -
Fill the keys with the secret values. For example:
DB=
DBUSER=
DBPASSWORD=
To access variables use process.env.DB_HOST
for example.
This is a shell file so there can't be spaces around =
For more information refer to: https://www.npmjs.com/package/dotenv
To use the following commands, do:
npm run <command>
List of commands:
serve
: Start the applicationbuild
: Build the applicationlint
: Run eslint and let it fix the errors
- Open a Terminal tab and start MongoDB with the configuration file you had set up.
For Homebrew:
sudo mongod --config /usr/local/etc/mongod.conf
- To use the following commands, do:
npm run <command>
List of commands:
start
: Start the applicationdev
: Start the application with nodemonlint
: Run eslintlint-fix
: Run eslint and let it fix the errors
Optional parameters are marked as (optional)
.
Request
Body, x-www-form-urlencoded
parameters:
- name
- address
- phone
- password
Successful Response
{ "message": "Success" }
Request
Body, x-www-form-urlencoded
parameters:
- password
Successful Response
{ "message": "Bearer <token>" }
Request GET /invoices
Query params:
- _id
- invoiceDate
- projectId
- number
- __v
Successful Response
[
{
"_id": "6078f715c462e5d7b064d3a1",
"invoiceDate": "2021-04-15",
"projectId": 35576725,
"__v": 0
},
{
"_id": "6078fcdecafdeed994e5ff98",
"invoiceDate": "2021-04-15",
"projectId": 35576725,
"number": 1,
"__v": 0
}...
]
Request GET /invoices/{{id}}
Successful Response
[
{
"_id": "6078f715c462e5d7b064d3a1",
"invoiceDate": "2021-04-15",
"projectId": 35576725,
"__v": 0
},
{
"_id": "6078fcdecafdeed994e5ff98",
"invoiceDate": "2021-04-15",
"projectId": 35576725,
"number": 1,
"__v": 0
}...
]
Request GET /invoices/invoiceLines
Query params:
- _id:
- datePerformed
- timeInMinutes
- notes
- approved
- storyId
- taskTitle
- taskDescription
- rate
- timeEntryId
- invoiceId
Successful Response
[
{
"_id": "6079022a4f4bc1dc2e09ab5d",
"datePerformed": "2021-01-16T00:00:00.000Z",
"timeInMinutes": 420,
"notes": null,
"approved": false,
"storyId": 687005635,
"taskTitle": "Consulting",
"taskDescription": null,
"rate": 10,
"timeEntryId": 1838262685,
"invoiceId": "6079022a4f4bc1dc2e09ab5a",
"__v": 0
} ...
]
Request GET /invoices/invoiceLines/{{id}}
Successful Response
[
{
"_id": "6079022a4f4bc1dc2e09ab5d",
"datePerformed": "2021-01-16T00:00:00.000Z",
"timeInMinutes": 420,
"notes": null,
"approved": false,
"storyId": 687005635,
"taskTitle": "Consulting",
"taskDescription": null,
"rate": 10,
"timeEntryId": 1838262685,
"invoiceId": "6079022a4f4bc1dc2e09ab5a",
"__v": 0
} ...
]
Request DELETE /invoiceLines/delete/{{id}}
Successful Response
{
"n": 1,
"ok": 1,
"deletedCount": 1
}
Request DELETE /invoices/invoiceLines/delete/{{id]}
Successful Response
{
"n": 1,
"ok": 1,
"deletedCount": 1
}
Request POST /invoices/create
Body JSON
parameters:
- invoiceDate: The date of the invoice
- projectId: Mavenlink Project Id
- datePerformed: Automatically imported from Mavenlink
- timeInMinutes: Automatically imported from Mavenlink
- notes: Automatically imported from Mavenlink
- approved: Automatically imported from Mavenlink
- storyId: : Automatically imported from Mavenlink
- taskTitle: : Automatically imported from Mavenlink
- taskDescription: : Automatically imported from Mavenlink
- rate: : Automatically imported from Mavenlink
- timeEntryId: Automatically imported from Mavenlink
Sample Request
{"invoiceData": {
"invoiceDate": "2021-04-09",
"projectId": "35576725",
"invoiceLineData": [
{
"datePerformed": "2021-01-15",
"timeInMinutes": 420,
"notes": null,
"approved": false,
"storyId": "687005635",
"taskTitle": "Consulting",
"taskDescription": null,
"rate": 10,
"timeEntryId": "1838262675"
} ...
]
}
}
Successful Response Status: 200 OK
{
"_id": "607b3a56ef0c73fefb2af71b",
"invoiceDate": "2021-04-09",
"projectId": 35576725,
"number": 22,
"__v": 0
}
Bad Request Status: 400 Bad Request
Request PUT /invoices/update
Body JSON
parameters:
- id: The invoice id
- invoiceDate
- projectId
- number
Sample Request
{"id": "607b3a56ef0c73fefb2af71b",
"newValues": {
"invoiceDate": "2021-05-15"
}
}
Successful Response Status: 200 OK
{
"n": 1,
"nModified": 1,
"ok": 1
}
Bad Request Status: 400 Bad Request
Request PUT /invoices/invoiceLines/update
Body JSON
parameters:
- id: invoice line id
- datePerformed
- timeInMinutes
- notes
- approved
- storyId
- taskTitle
- taskDescription
- rate
- timeEntryId
Sample Request
{"id": "6079022a4f4bc1dc2e09ab5d",
"newValues": {
"rate": "50"
}
}
Successful Response Status: 200 OK
{
"n": 1,
"nModified": 1,
"ok": 1
}
Bad Request Status: 400 Bad Request
Request GET /tasks/mavenlink
Query parameters: Any of the query parameters specified in the Mavenlink documentation for Stories
Successful Response Status: 200 OK
{
"results": [
{
"key": "stories",
"id": "687005635"
} ...
],
"stories": {
"687005635": {
"title": "Consulting",
"description": null,
"updated_at": "2021-04-17T14:38:56-07:00",
"assignment_timestamped_at": "2021-04-17T14:38:56-07:00",
"created_at": "2021-01-14T10:42:32-08:00",
"due_date": "2021-04-13",
"start_date": "2019-12-15",
"story_type": "task",
"state": "started",
"position": 100000000,
"archived": false,
"deleted_at": null,
"sub_story_count": 0,
"percentage_complete": 100,
"priority": "normal",
"has_proofing_access": false,
"ancestor_ids": [],
"subtree_depth": 0,
"ancestry_depth": 0,
"time_trackable": true,
"time_estimate_in_minutes": 150000,
"logged_billable_time_in_minutes": 133860,
"logged_nonbillable_time_in_minutes": 0,
"sub_stories_time_estimate_in_minutes": null,
"sub_stories_billable_time_in_minutes": null,
"weight": null,
"budget_estimate_in_cents": 37500000,
"budget_used_in_cents": 26469750,
"uninvoiced_balance_in_cents": 26469750,
"invoiced_balance_in_cents": 0,
"sub_stories_budget_estimate_in_cents": null,
"sub_stories_budget_used_in_cents": null,
"fixed_fee": false,
"billable": true,
"workspace_id": "35576775",
"creator_id": "16925965",
"parent_id": null,
"root_id": null,
"current_assignment_ids": [
"476005615",
"476015325",
"476015545",
"476015555",
"476015575",
"476015595",
"476015605",
"476015615",
"507741365"
],
"id": "687005635"
}
}...
Bad Request Status: 400 Bad Request
Request POST /tasks/mavenlink/create
Body JSON
parameters:
Any of the parameters specified in the Mavenlink documentation for Stories
Successful Response Status: 200 OK
Bad Request Status: 400 Bad Request
Request PUT /tasks/mavenlink/update
Query parameters:
- id: the Mavenlink task id
Body JSON
parameters:
Any of the parameters specified in the Mavenlink documentation for Stories
Successful Response Status: 200 OK
Bad Request Status: 400 Bad Request
Request DELETE /tasks/mavenlink/delete
Query parameters:
- id: the Mavenlink task id
Successful Response Status: 204 No Content
Bad Request Status: 400 Bad Request
Request GET /tasks/time
Query parameters: Any of the query parameters specified in the Mavenlink documentation for Time Entries
Successful Response Status: 200 OK
Bad Request Status: 400 Bad Request
- Axios
- Eslint
- Prettier
- Sass
- TypeScript
- VueJS
- Axios
- Cors
- Dotenv
- Express
- Helmet
- JSON Web Token
- Mongoose
- Prettier
- TypeScript
- Eslint
- Nodemon