Skip to content

oovaa/dara

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

64 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dara

Description: ALX final project 🔥

Table of Contents

Introduction

Dara is a project developed as part of the ALX program. It provides functionalities for file parsing, summary generation, and question generation from various document types.

Features

  • File Parsing: Supports .pptx, .pdf, .docx, and .txt file formats.
  • Summary Generation: Generates summaries from the content of the supported document types.
  • Question Generation: Generates questions from the content of the supported document types.

Installation

To get started with Dara, follow these steps:

  1. Clone the repository:

    git clone https://github.com/oovaa/dara.git
    cd dara
  2. Install the dependencies:

    npm install
  3. Set up environment variables: Create a .env file in the root directory and add the necessary environment variables.

Usage

To use Dara, you can use the following commands:

  • Start the server:
    npm start

Endpoints

  • Generate Summary:

    • URL: /api/sum
    • Method: POST
    • Description: Upload a file to generate a summary.
    • Example:
      curl -X POST -F 'file=@path/to/your/file.pdf' http://localhost:3000/api/sum
  • Generate Questions:

    • URL: /api/qs
    • Method: POST
    • Description: Upload a file to generate questions.
    • Example:
      curl -X POST -F 'file=@path/to/your/file.pdf' http://localhost:3000/api/qs

Project Structure

Here is a detailed description of the project structure:

.gitignore
bun.lockb
Dockerfile
index.js
LICENSE
package.json
README.md
server/
	controllers/
		generateQsController.js
		generateSummaryController.js
	middlewares/
		multerMiddleWare.js
		globalErrorHandler.js
	routes/
		generateQsRoute.js
		generateSummaryRoute.js
		index.js
	utils/
		ApiError.js
story.txt
test/
	chaint_test.js
tools/
	generateQs.js
	summarize.js
tsconfig.json

utils/
	model.js
	parser.js

Root Files

  • .gitignore: Specifies files and directories that should be ignored by Git.
  • bun.lockb: Lock file for Bun package manager.
  • Dockerfile: Contains instructions to build a Docker image for the project.
  • index.js: Entry point of the application.
  • LICENSE: License file for the project.
  • package.json: Contains metadata about the project and its dependencies.
  • README.md: This file, providing an overview of the project.

Directories

  • server/: Contains the server-side code.
    • controllers/: Contains controller files that handle requests and responses.
      • generateQsController.js: Handles requests for generating questions.
      • generateSummaryController.js: Handles requests for generating summaries.
    • middlewares/: Contains middleware functions.
      • multerMiddleWare.js: Middleware for handling file uploads.
      • globalErrorHandler.js: Middleware for handling global errors.
    • routes/: Contains route definitions.
      • generateQsRoute.js: Route for generating questions.
      • generateSummaryRoute.js: Route for generating summaries.
      • index.js: Main router that combines all routes.
    • utils/: Contains utility functions and classes.
      • ApiError.js: Custom error class for API errors.
  • story.txt: Example text file used for testing.
  • test/: Contains test files.
    • chaint_test.js: Contains unit tests for the application.
  • tools/: Contains scripts for generating summaries and questions.
    • generateQs.js: Script for generating questions from parsed documents.
    • summarize.js: Script for generating summaries from parsed documents.
  • tsconfig.json: Configuration file for TypeScript.
  • uploads/: Directory for storing uploaded files.
  • utils/: Contains utility functions and classes.
    • model.js: Contains the model used for generating summaries and questions.
    • parser.js: Contains the parser for extracting text from documents.

Contributing

Contributions are welcome! Please read CONTRIBUTING.md for details on our code of conduct and the process for submitting pull requests.

License

This project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details.

About

alx final project 🔥

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published