Skip to content

PermanentOrg/notification-service

Repository files navigation

Permanent.org Notification Service

This repository contains a service responsible for handling notifications.

Structure

- src
|- controllers // maps between routes to services
|- database    // configuration, migrations, and queries
|- routes      // endpoint definitions
|- services    // business logic

Usage

  1. Install npm packages.
npm install
  1. Create database. See the PostgreSQL Creating a Database tutorial.

  2. Configure environment variables, by copying .env.template to .env and replacing the example values.

  3. Start the project.

npm start
  1. Verify it is running and configured correctly:
curl http://localhost:3000/api/health

Endpoints

GET /api/health

Input

No inputs.

Output

Returns a health check.

  • status: either available or unavailable.
  • message: a more detailed explanation about the health status.

POST /api/notifications

Input

  • toUserId: Id of the user the notification is for.
  • notificationType: Type of the notification being saved.

Output

  • notificationId: Id of the notification that got created.

Design Doc

link: DESIGN.md

Contributing

Contributors to this repository agree to adhere to the Contributor Covenant Code of Conduct. To report violations, get in touch with [email protected].

Security

Found a vulnerability? Report this and any other security concerns to [email protected].

License

This code is free software licensed as AGPLv3, or at your option, any final, later version published by the Free Software Foundation.

About

No description, website, or topics provided.

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published