GeThiDo-API is a RESTful API for creating tools based on "Getting Things Done" time management method.
Project is created with:
- Node.js
- Express.js
- MongoDB
To run this project:
-
Clone this repository
git clone https://github.com/michalmarchewczyk/gethido-api
-
Install all dependencies
npm install
-
Generate public/private RSA key pair in PEM format and change filenames in auth/keys.js
const privateKey = fs.readFileSync(path.join(__dirname, '[file_name].key')); const publicKey = fs.readFileSync(path.join(__dirname, '[file_name].pub.key'));
-
Change database config in db/dbConfig.js
-
Start the server
npm start
GeThiDo-API is REST API with two types of endpoints:
For user-related actions endpoints have the form: https://[URL]/user/[endpoint]
Docs for user-related actions: docs/user.md
For tasks-related actions endpoint have the form: https://[URL]/tasks/[endpoint]
Docs for tasks-related actions: docs/tasks.md
GeThiDo-API uses Jest testing framework.
-
(Optional) Setup temporary database for testing purposes, and change config in db/dbConfig.js
-
Create user for testing purposes.
-
Save this user's id in tasks/tasks.test.js
const TEST_USER_ID = [userId];
Run tests using npm
npm test
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.