Announcement Banner System

Communication → Silver
💰 $1000

Sticky notices shown on dashboards or course views.

Technology iconTechnology iconTechnology icon

Overview of Announcement Banner System

Purpose

The Announcement Banner System is designed to display sticky notices on dashboards or course views. Its primary goal is to capture user attention for disseminating important information such as news updates, system notifications, and critical alerts.

Benefits

Usage Scenarios

  1. System-Wide Messages: Ideal for broadcasting updates, maintenance schedules, and other critical system information.
  2. Course-Specific Notifications: Inform users about course-related changes or important deadlines.
  3. Time-Sensitive Information: Display alerts for upcoming events, deadlines, or real-time updates.
  4. User-Specific Alerts: Notify users of pending actions, achievements, or personalized updates.

This module offers a flexible and robust solution for developers to enhance user communication within their applications, ensuring messages are seen and acted upon promptly.

Persistent Sticky Banners

Banners are designed to remain visible until explicitly dismissed by the user. They stick to the screen, ensuring important messages aren’t missed.


Supports multiple banner types (info, warning, error), each with distinct styling and priority levels for clear visual communication.


Customizable Positioning

Administrators can set banner positions (top, bottom, floating) based on user experience requirements and layout constraints.


Branding Integration

Banners support custom colors, fonts, and logos to align with the platform’s branding, ensuring consistent visual identity.


Management API

A RESTful API provides CRUD operations for managing banners programmatically. Developers can create, update, or delete banners through code.


Administrators can filter banners by type, status, or content using search parameters, simplifying management of large banner sets.


Performance Optimizations

Banners are optimized to load quickly with minimal impact on page load times, ensuring seamless user experience.


Content Management

Supports rich text formatting and HTML embedding for creating complex or visually appealing announcements.


Multi-Language Support

Banners can display content in multiple languages, catering to a diverse user base.


Expiry Dates

Banners automatically expire after a specified duration, preventing clutter on dashboards and course views.


User Interaction Analytics

Track banner interactions (clicks, dismissals) to gather insights into user behavior and optimize messaging strategies.


Integration Hooks

Provides hooks for integrating with other modules or systems, ensuring seamless integration within existing platforms.

Here’s the technical documentation for the Announcement Banner System module:


Announcement Banner System Documentation

Overview

The Announcement Banner System is designed to display sticky notices or announcements on dashboards and course views within a web application. These banners are persistent and appear at prominent locations until explicitly dismissed by users.

API Endpoint (FastAPI)

Create Announcement

from fastapi import FastAPI, HTTPException
from pydantic import BaseModel

app = FastAPI()

class Announcement(BaseModel):
    title: str
    content: str
    start_date: str
    end_date: str
    is_visible: bool
    created_at: str
    updated_at: str

@app.post("/api/announcements/")
async def create_announcement(announcement: Announcement):
    # Database insertion logic here
    return {"status": "success", "message": "Announcement created successfully"}

Get All Announcements

@app.get("/api/announcements/")
async def get_all_announcements():
    # Database query logic here
    return {
        "data": [
            {
                "id": 1,
                "title": "System Maintenance",
                "content": "Maintenance will occur on Sunday at midnight.",
                "start_date": "2023-10-15T00:00:00Z",
                "end_date": "2023-10-16T00:00:00Z",
                "is_visible": True,
                "created_at": "2023-10-14T12:00:00Z"
            }
        ],
        "total": 1
    }

React UI Component

Announcement Banner Component

import React, { useState, useEffect } from 'react';

interface Announcement {
    id: number;
    title: string;
    content: string;
    start_date: string;
    end_date: string;
    is_visible: boolean;
    created_at: string;
}

const AnnouncementBanner = () => {
    const [announcements, setAnnouncements] = useState<Announcement[]>([]);
    const [searchQuery, setSearchQuery] = useState('');

    useEffect(() => {
        fetch('/api/announcements/')
            .then(response => response.json())
            .then(data => setAnnouncements(data.data))
            .catch(error => console.error('Error fetching announcements:', error));
    }, []);

    const filteredAnnouncements = announcements.filter(announcement =>
        announcement.title.toLowerCase().includes(searchQuery.toLowerCase()) ||
        announcement.content.toLowerCase().includes(searchQuery.toLowerCase())
    );

    return (
        <div className="announcement-banner-container">
            <input
                type="text"
                placeholder="Search announcements..."
                value={searchQuery}
                onChange={(e) => setSearchQuery(e.target.value)}
            />
            <div className="announcements-list">
                {filteredAnnouncements.map(announcement => (
                    <div key={announcement.id} className="banner-item">
                        <h3>{announcement.title}</h3>
                        <p>{announcement.content}</p>
                        <small>Active until: {new Date(announcement.end_date).toLocaleDateString()}</small>
                    </div>
                ))}
            </div>
        </div>
    );
};

export default AnnouncementBanner;

Data Schema (Pydantic)

Announcement Model

from pydantic import BaseModel
from datetime import datetime

class Announcement(BaseModel):
    id: int
    title: str
    content: str
    start_date: datetime
    end_date: datetime
    is_visible: bool
    created_at: datetime
    updated_at: datetime
    
    class Config:
        json_schema_extra = {
            "example": {
                "title": "Important Update",
                "content": "New features are now available.",
                "start_date": "2023-10-14T00:00:00Z",
                "end_date": "2023-10-15T00:00:00Z",
                "is_visible": True,
                "created_at": "2023-10-13T12:00:00Z"
            }
        }


This documentation provides the necessary code examples and schemas to implement the Announcement Banner System. The FastAPI endpoints handle CRUD operations, while the React component provides a UI for displaying and searching announcements.

Announcement Banner System Module Documentation

Summary

The Announcement Banner System module provides a mechanism for displaying sticky notices on dashboards or course views. These announcements are designed to communicate important updates, notifications, or alerts to users without overwhelming them with information.

Use Cases

  1. Course Update Announcements: Display notices about course schedule changes, new materials, or assignment deadlines.
  2. Emergency Notifications: Show critical alerts such as system outages, weather-related closings, or safety advisories.
  3. Feature Launch Promotions: Promote new features or tools to users by displaying informative banners.

Integration Tips

Configuration Options

ParameterDescriptionData TypeDefault Value
announcement_banner_enabledEnables or disables the announcement banner system.Booleantrue
max_announcements_per_pageMaximum number of announcements that can be displayed per page.Integer5
notification_typeType of notification (e.g., email, in-app message).String”in-app”
sticky_banner_durationDuration for which a banner remains sticky in days.Integer30
banner_styling_themeTheme or style to be applied to the banners (e.g., light, dark).String”light”

Notes


This documentation provides a comprehensive overview of the Announcement Banner System module. Developers are encouraged to explore the API endpoints and configuration options to fully leverage its capabilities.