Description: ALX final project 🔥
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.
- 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.
To get started with Dara, follow these steps:
-
Clone the repository:
git clone https://github.com/oovaa/dara.git cd dara
-
Install the dependencies:
npm install
-
Set up environment variables: Create a
.env
file in the root directory and add the necessary environment variables.
To use Dara, you can use the following commands:
- Start the server:
npm start
-
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
- URL:
-
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
- URL:
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
- .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.
- 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.
- controllers/: Contains controller files that handle requests and responses.
- 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.
Contributions are welcome! Please read CONTRIBUTING.md for details on our code of conduct and the process for submitting pull requests.
This project is licensed under the GNU General Public License v3.0 - see the LICENSE
file for details.