Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added PythonTask.pdf
Binary file not shown.
60 changes: 59 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,59 @@
# UrbanMatch-PythonTask
<<<<<<< HEAD
# Marriage Matchmaking App

## Brief Description
The Marriage Matchmaking App is a simple backend application designed to help users find potential matches based on their profile information. The app allows users to create, read, update, and delete profiles with details such as name, age, gender, email, city, and interests.

## What is Provided?
This project provides a basic skeleton for a FastAPI-based backend application.
#### Github repo: **https://github.com/abhishek-UM/UrbanMatch-PythonTask/tree/master**

The provided code includes:

### Basic Project Structure:

- **main.py** : The main application file with basic CRUD operations for user profiles.
- **models.py**: SQLAlchemy models defining the User schema.
- **database.py**: Database configuration and setup.
- **schemas.py**: Pydantic schemas for data validation and serialization.

### Functionality:

- Create User Endpoint: Create a new user profile.
- Read Users Endpoint: Retrieve a list of user profiles.
- Read User by ID Endpoint: Retrieve a user profile by ID.
- SQLite Database: The application uses SQLite as the database to store user profiles.

## What is Required?
### Tasks:
1. Add User Update Endpoint:
- Implement an endpoint to update user details by ID in the main.py file.
2. Add User Deletion Endpoint:
- Implement an endpoint to delete a user profile by ID.
3. Find Matches for a User:
- Implement an endpoint to find potential matches for a user based on their profile information.
4. Add Email Validation:
- Add validation to ensure the email field in user profiles contains valid email addresses.

## Instructions:
Implement the required endpoints and email validation:

1. Add the necessary code for the update, delete, match and validation endpoints
2. Test Your Implementation:
1. Verify that users can be updated and deleted correctly.
2. Check that matches are correctly retrieved for a given user.
3. Ensure email validation is working as expected.

## Submit Your Work:
Provide the updated code files (main.py, models.py, database.py, and schemas.py).
Include a brief report explaining your approach and any assumptions made.


### Prerequisites
- Python 3.7+
- FastAPI
- SQLAlchemy
- SQLite
=======
# UrbanMatch-PythonTask
>>>>>>> f167553ae8b55f1b45acad5e31b8664f61fad37c
Binary file added __pycache__/database.cpython-311.pyc
Binary file not shown.
Binary file added __pycache__/main.cpython-311.pyc
Binary file not shown.
Binary file added __pycache__/models.cpython-311.pyc
Binary file not shown.
Binary file added __pycache__/schemas.cpython-311.pyc
Binary file not shown.
22 changes: 22 additions & 0 deletions database.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# from sqlalchemy import create_engine
# from sqlalchemy.ext.declarative import declarative_base
# from sqlalchemy.orm import sessionmaker

# // Free to use remote db or create a local database. Modify the URl appropriately
# SQLALCHEMY_DATABASE_URL = "sqlite:///./test.db"

# engine = create_engine(SQLALCHEMY_DATABASE_URL)
# SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine)
# Base = declarative_base()


from sqlalchemy import create_engine
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker

SQLALCHEMY_DATABASE_URL = "sqlite:///./users.db"

engine = create_engine(SQLALCHEMY_DATABASE_URL, connect_args={"check_same_thread": False})
SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine)

Base = declarative_base()
Loading