Skip to content

Latest commit

 

History

History
217 lines (166 loc) · 10.3 KB

README.md

File metadata and controls

217 lines (166 loc) · 10.3 KB

project-logo

DAEM-BACKEND

Backend for Child Exploitation Reporting Application

license last-commit repo-top-language repo-language-count


Table of Contents

Overview

The DAEM-Backend is the server-side component of a Child Exploitation Reporting Application. It provides a robust API for managing public and anonymous case reports, user authentication, and file attachments. The application aims to combat child abuse by offering a platform for reporting incidents, both publicly and anonymously, while maintaining user privacy and data security.


Features

  • User authentication and authorization
  • Public case reporting and management
  • Anonymous case reporting with unique key generation
  • File attachment handling using Supabase
  • Location-based case querying and filtering
  • Internationalization support
  • Custom error handling and logging
  • Robust testing setup using Japa

Repository Structure

└── DAEM-backend/
    ├── .github/workflows/
    ├── bin/
    ├── eslint-custom-rules/
    ├── i18n/
    │   ├── en/
    │   └── es/
    ├── src/
    │   ├── application/
    │   │   ├── anonymous-case/
    │   │   ├── anonymous-key/
    │   │   ├── attachment/
    │   │   ├── auth/
    │   │   ├── public-case/
    │   │   ├── stale-content/
    │   │   └── user/
    │   ├── db/
    │   ├── middleware/
    │   └── utils/
    └── tests/
        ├── api/
        └── utils/

Modules

src.application.anonymous-cases
File Summary
anonymous-case.model.js Defines the MongoDB schema for anonymous cases, including location data and attachment references.
anonymous-case.controllers.js Implements controllers for creating, retrieving, and managing anonymous cases.
anonymous-case.utils.js Provides utility functions for anonymous case operations, such as key generation and case querying.
anonymous-case.routes.js Defines API routes for anonymous case-related operations.
anonymous-case.errors.js Contains custom error classes for handling anonymous case-specific errors.
src.application.public-case
File Summary
public-case.model.js Defines the MongoDB schema for public cases, including user references and location data.
public-case.controllers.js Implements controllers for creating, retrieving, and managing public cases.
public-case.utils.js Provides utility functions for public case operations, such as filtering and querying.
public-case.routes.js Defines API routes for public case-related operations.
public-case.errors.js Contains custom error classes for handling public case-specific errors.
src.application.auth
File Summary
auth.controllers.js Implements authentication controllers for user registration and login.
auth.routes.js Defines API routes for authentication-related operations.
auth.errors.js Contains custom error classes for handling authentication-specific errors.
src.application.attachment
File Summary
attachment.model.js Defines the MongoDB schema for file attachments.
attachment.controllers.js Implements controllers for handling file uploads and retrievals using Supabase.
attachment.routes.js Defines API routes for attachment-related operations.
attachment.errors.js Contains custom error classes for handling attachment-specific errors.

Getting Started

Installation

  1. Clone the DAEM-backend repository:
git clone https://github.com/kinal-team-1/DAEM-backend
  1. Change to the project directory:
cd DAEM-backend
  1. Install the dependencies:
npm install
  1. Pull the DB mongo replica set enabled image for local development, we recommend using make for this:
make

Usage

  1. Set up environment variables:

    • You can use .env.example or create .env and set up your own supabase credentials.
  2. Start the server:

npm run dev

Tests

Run the test suite using the command below:

npm test

Project Roadmap

  • Implement basic CRUD operations for public and anonymous cases
  • Set up authentication system
  • Integrate file upload functionality with Supabase
  • Implement location-based case querying
  • Add internationalization support
  • Develop case contribution endpoints

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.


License

This project is licensed under the MIT License.


Contributions

this project was made by students of KINAL, Guatemala.

Contributor Graph

Return