Skip to content

The Notifications API enables the creation, retrieval, updating, and deletion of push notifications in applications, keeping users informed about events, promotions, and important updates.

Notifications You must be signed in to change notification settings

GilbertoJNJ/NotificationAPI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Notifications API

The Notifications API is a RESTful service designed to manage push notifications for applications, ensuring users are kept informed about events, promotions, and important updates.

Features

  • Create Notifications: Add new notifications for users. (Future Implementation via SQS Queue)
  • Retrieve Notifications: Fetch all notifications or specific ones by ID.
  • Update Notifications: Modify existing notifications, including marking them as read.
  • Delete Notifications: Deactivate notifications by ID.

Endpoints

Get All Notifications

GET /notifications

Fetches all notifications for a specific user.

Get Notification by ID

GET /notifications/{id}

Fetches a specific notification by its ID for a user.

Delete Notification by ID

DELETE /notifications/{id}

Deactivates a notification by setting its `isActive` flag to false.

Mark Notification as Read

PATCH /notifications/{id}/mark-as-read

Marks a notification as read and sets the `readAt` timestamp.

Notification Model

  • notificationId: Unique identifier for the notification.
  • userId: Identifier for the user receiving the notification.
  • title: Title of the notification.
  • message: Content of the notification.
  • type: Type of notification (e.g., promotion, alert).
  • createdAt: Timestamp when the notification was created.
  • read: Boolean indicating if the notification has been read.
  • readAt: Timestamp when the notification was read.
  • priority: Priority of the notification (e.g., high, medium, low).
  • link: URL or path for more information.
  • isActive: Boolean indicating if the notification is active.

Dependencies

  • Java
  • Spring Boot
  • Spring Data JPA
  • H2 Database
  • PostgreSQL
  • Lombok
  • MapStruct
  • SpringDoc OpenAPI

Setup

  1. Clone the repository:

    git clone https://github.com/GilbertoJNJ/NotificationAPI.git
    
  2. Navigate to the project directory:

    cd notifications-api
    
  3. Build the project using Gradle:

    ./gradlew build
    
  4. Run the application:

    ./gradlew bootRun
    

About

The Notifications API enables the creation, retrieval, updating, and deletion of push notifications in applications, keeping users informed about events, promotions, and important updates.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published