How notshrirang/m2connex works
Project Overview and Core Architecture
• The M2ConneX project is a Django-powered backend designed to connect MMCOE alumni. It forms the backend for the alumni portal and exposes RESTful APIs for the frontend (hosted separately).
• The project is containerized via Docker and uses PostgreSQL as the database. It also integrates asynchronous processing (Celery) and leverages various external services (for emails, notifications, file storage, etc.) through utility modules.
• API Gateway/Endpoints (handled by Django views and URL configurations)
• Core project configuration and orchestration (alumniportal folder: settings, URLs, and celery configuration)
• A set of Django apps/modules (each one representing a specific feature area, described below)
• External services such as the database (PostgreSQL), email service, AWS S3, and potentially notification services.
• Container orchestration via Docker (Dockerfile and docker-compose)
Examining the File Structure and Main Components
• Top-Level Project Components:
• CODE: A utility module containing helper functions (for sending emails, notifications, NSFW filtering, handling One Time Passwords, recommendations, S3 integration, etc.).
• alumniportal: Contains project-level configurations, including settings, URL routing, and asynchronous task configuration with celery (alumniportal/celery.py).
• Multiple Django apps provide domain-specific functionality. They generally include subfolders for models, serializers, views, tests, and migrations.
• Docker and deployment files (Dockerfile, docker-compose-dev.yml, run.sh) to containerize and run the backend.
Short Explanations for Each Module
• CODE:
• Acts as a collection of utility functions and helper routines used across the project.
• Includes support for emails, notifications, NSFW processing, integration with AWS S3, generation and handling of OTPs, interfacing with a relational database service (RDS), and generating recommendations.
• alumniportal:
• Serves as the main Django project configuration module.
• Contains key settings, URL configurations, entry points (asgi.py, wsgi.py), and Celery task configurations.
• analytics:
• Manages analytics-related logic.
• Provides models and serializers to record and process user activities and interactions.
• blog:
• Handles blogging functionality for alumni to post articles or updates.
• Contains models, views, and serializers to manage blog posts, as well as admin configurations.
• club:
• Facilitates the creation and management of alumni clubs or groups.
• Contains models and filters to manage club membership, club information, and related admin functionalities.
• connection:
• Manages the social networking element by handling friendship or connection requests between alumni.
• Provides APIs (through views/serializers) and models to maintain these relationships.
• csc:
• Likely designed for managing geographic or related standardized data (e.g., country, state, city) given the migration files altering country names.
• Supports location or regional data that might assist in grouping or filtering alumni.
• donation:
• Enables alumni to make or manage donations.
• Includes models and endpoints to track donation transactions and related data.
• event:
• Provides event management functionality allowing alumni to create, join, and manage events like reunions, workshops, or networking sessions.
• Contains filters to customize event queries and manage event lifecycle.
• experience:
• Captures verifiable alumni experiences such as work history, projects, or expertise.
• Offers data structures and APIs to manage experience data and updates.
• feed:
• Manages the social media feed where alumni can post updates.
• Handles feed actions including posting, commenting, and sharing content.
• notification:
• Manages notifications sent to the alumni, such as alerts for connections, events, or other social updates.
• Integrates with the utility functions in the CODE module for dispatching messages.
• opportunity:
• Focused on job opportunities and professional enhancements.
• Contains capabilities to list, update, and archive career-related posts or opportunities related to the alumni network.
• otp:
• Manages the generation, validation, and lifecycle of one-time passwords used for authentication or sensitive operations.
• Ensures secure login and verification processes.
• skill:
• Allows alumni to share and manage their skills.
• Provides endpoints to list, modify, and validate skill-related data, and to match skills with opportunities.
• users:
• Handles user account management, profiles, and permissions.
• Includes detailed migrations to manage changes in user attributes (like bios, privileges, profile pictures, verification flags).
Relationships and Interactions
• Each module (Django app) exposes its endpoints through the overall URL routing (typically included in alumniportal/urls.py and further delegated to each app’s urls.py).
• The CODE module is imported by many apps to handle cross-cutting concerns.
• The alumniportal module acts as the orchestrator by maintaining the main settings and routing for the apps.
• Many modules interact with the database through Django ORM models, and serializers mediate data to/from client requests.
• Celery (configured in alumniportal/celery.py) manages background jobs such as sending emails and notifications.
• Docker/Docker Compose is used to containerize the entire backend for development and production purposes.