0% found this document useful (0 votes)
24 views4 pages

IDEH Assignment

The document outlines the requirements for designing and implementing a Flask application with PostgreSQL, integrating features such as social login, web scraping, and LangChain for prompt interactions. It specifies the database setup, application structure, and the need for RESTful APIs, a user-friendly dashboard, and error handling. Additionally, it includes evaluation criteria, deliverables, and bonus points for extra functionalities.

Uploaded by

anindya sarkar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views4 pages

IDEH Assignment

The document outlines the requirements for designing and implementing a Flask application with PostgreSQL, integrating features such as social login, web scraping, and LangChain for prompt interactions. It specifies the database setup, application structure, and the need for RESTful APIs, a user-friendly dashboard, and error handling. Additionally, it includes evaluation criteria, deliverables, and bonus points for extra functionalities.

Uploaded by

anindya sarkar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Objective:

Design and implement a Flask application that integrates Flask-SQLAlchemy (with


PostgreSQL) to build a small web application. The project should also include features for
prompting using LangChain, web scraping, and social login authentication.

Assignment Requirements:

1. Database Setup (PostgreSQL):

o Create a database using PostgreSQL.

o Define the following models using Flask-SQLAlchemy:

▪ User: For managing users (name, email, social_login_provider,


profile_picture, created_at).

▪ ScrapedData: For storing data scraped from a website (URL, content,


metadata, created_by_user_id as a foreign key to User, and created_at).

▪ PromptLog: For storing prompts and their generated outputs


(prompt_text, generated_output, created_by_user_id as a foreign key to
User, and created_at).

2. Application Setup:

o Follow the below folder structure:

config / config.py
modules / web_application / api / ..
modules / web_application / forms / ..
modules / web_application / models / ..
modules / web_application / templates / ..
modules / web_application / views / ..
modules / web_application / tests / ..
static
templates
.env
app.py
other files as required
3. Social Login Integration:

o Implement social login using Google or Facebook OAuth (use Flask-Dance or


any other library of your choice).
o Upon login, save user details (name, email, profile picture, and provider) in the
User table.

4. LangChain Integration:

o Integrate LangChain for prompt-based interactions.

o Create an endpoint where users can send a prompt and receive a response.

o Save both the prompt and the generated response in the PromptLog table with
tokens used.

o You may use GenAI to get the data from the scraped website.

5. Web Scraping Feature:

o Provide an interface where logged-in users can enter a URL (Social Media Profile,
Website etc).

o Scrape the content (Name, About, Source (Company, Social Media Account,
Others), Industry, Page Content Type, Contact, Email etc) and metadata (e.g.,
title, description, etc.) of the provided URL.

o Save the scraped data in the ScrapedData table, associating it with the logged-in
user.

o Ensure the scraper handles common issues like timeouts and invalid URLs or JS
based websites that load content after load gracefully.

6. Dashboard (Frontend):

o Create a simple dashboard (using Bootstrap or any frontend library) with the
following features:

▪ Display a list of the user's scraped URLs with their content and
metadata.

▪ Display a list of the user's prompts and generated outputs.

▪ Allow users to delete or edit their scraped data and prompts.

7. API Development:

o Develop RESTful APIs for:

▪ Creating, reading, updating, and deleting scraped data.

▪ Creating and retrieving prompts and their generated responses.

8. Additional Requirements:

o Ensure the application is containerized using Docker.

o Write unit tests for key functionalities (e.g., user login, prompt generation, web
scraping).

o Use environment variables to manage sensitive information (e.g., database


credentials, API keys).
Evaluation Criteria:

1. Functionality:

o Are all the requirements implemented correctly?

o Does the social login and OAuth work seamlessly?

o Is the LangChain integration functional and responsive?

2. Code Quality:

o Is the code modular and well-organized?

o Are Flask-SQLAlchemy best practices followed (e.g., using relationships,


session management)?

3. Database Design:

o Are the models well-structured, with appropriate relationships and indexing?

4. Error Handling:

o Are edge cases handled gracefully (e.g., invalid login, failed scraping)?

5. Frontend Design:

o Is the dashboard user-friendly and visually appealing?

6. Documentation:

o Is there a clear README file with setup instructions?

o Are the endpoints and functionality well-documented?

Deliverables:

1. Source code (preferably in a GitHub repository).

2. A Docker Compose file to set up the app and database. (optional)

3. A README file with:

o Setup and installation instructions.

o Usage guide.

o API documentation.

Bonus Points:

1. Implement pagination for the dashboard views.

2. Use redis to store any error logs.


3. Use advanced LangChain functionalities (e.g., chaining multiple prompts or tools).

4. Provide a deployed version of the app using any free cloud service.

5. Any additional features and functionalities.

Good Luck!

Let me know if you need help setting up or clarifying the assignment!

You might also like