0% found this document useful (0 votes)
14 views6 pages

System Design Lecture Notes

The document outlines a system design for a project featuring a layered architecture that includes a frontend, backend RESTful API, relational and NoSQL databases, an AI engine for recommendations, and third-party integrations. It details functional and non-functional requirements, including user authentication, search capabilities, and performance metrics, alongside a database design and API endpoints. The document emphasizes the use of frameworks like Django for backend development and highlights the importance of security, scalability, and reliability in the system.

Uploaded by

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

System Design Lecture Notes

The document outlines a system design for a project featuring a layered architecture that includes a frontend, backend RESTful API, relational and NoSQL databases, an AI engine for recommendations, and third-party integrations. It details functional and non-functional requirements, including user authentication, search capabilities, and performance metrics, alongside a database design and API endpoints. The document emphasizes the use of frameworks like Django for backend development and highlights the importance of security, scalability, and reliability in the system.

Uploaded by

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

System Design Document for …

-Project Overview
- System Architecture
SYSTEM DIAGRAM

A layered architecture will be used:

1. Frontend:
2. Backend: RESTful API server for business logic and data processing.
3. Database: Relational database for structured data and a NoSQL database for
unstructured data like reviews.
4. AI Engine: Recommender system using machine learning algorithms.
5. Third-Party Integrations: APIs for location services and reviews (e.g., Google
Maps, Yelp).

COMPONENTS

Frontend

B ACKEND

 Framework: Framework sec!

FRAMEWORK'ÜN İŞLEVLERI VE AVANTAJLARI

1. Hazır Yapılar ve Araçlar Sağlar:


o Framework'ler, projelerin temel taşlarını (örneğin, kullanıcı doğrulama, veri
işleme, API oluşturma) hazır bir şekilde sunar.
o Örneğin, Django'da kullanıcı oturum açma sistemi ya da React Native'de
mobil arayüz bileşenleri hazırdır.

2. Kod Tekrarını Azaltır:


o Yazılımcıların her projede aynı altyapıyı sıfırdan kurması gerekmez.
o Örneğin, bir veritabanına bağlanma ve veri çekme gibi işlemleri Django
veya Spring Boot ile kolayca gerçekleştirebilirsiniz.

3. Standartlaştırma ve Düzen Sağlar:


o Kodun nasıl yazılacağına dair belli kurallar sunarak projelerin düzenli ve
anlaşılır olmasını sağlar.
o Örneğin, Model-View-Controller (MVC) veya Model-Template-View (MTV)
gibi mimariler sunar.
4. Zaman ve Efor Tasarrufu:
o Hazır şablonlar, bileşenler ve kütüphaneler sayesinde bir projeyi daha hızlı
geliştirebilirsiniz.
o Örneğin, React Native ile hem iOS hem de Android uygulamalarını tek bir
kod tabanıyla geliştirmek mümkündür.

5. Performans ve Güvenlik:
o Framework'ler genellikle optimize edilmiş kod ve güvenlik özellikleri sunar.
o Örneğin, Django CSRF ve XSS koruması gibi güvenlik özelliklerini
otomatik sağlar.

6. Topluluk Desteği:
o Popüler framework'lerin büyük bir topluluğu vardır ve birçok kaynak
(döküman, eğitim, forum) mevcuttur.
o Örneğin, React Native veya Django için Stack Overflow'da binlerce soru-
cevap bulabilirsiniz.

Back-End Frameworks

1. Django (Recommended):
o Why:
 Python-based, aligning well with AI integration for
recommendations.
 High scalability and compatibility with JavaScript-based frontends.
 Security features like authentication, CSRF, and XSS protection.
 Supported by a wide range of libraries for rapid development.
o Best For:
 Handling AI recommendation logic and connecting to third-party
APIs (e.g., Google Maps, Yelp).
 Rapid development and maintainability.
2. Ruby on Rails:
o Why:
 Excellent for rapid prototyping.
 Secure and scalable.
o Challenges:
 Lesser integration libraries for AI/ML compared to Django.
 Smaller talent pool compared to Django.
3. Spring Boot:
o Why:
 Java-based with enterprise-level scalability.
 Ideal for performance-intensive applications.
o Challenges:
 Might be overkill for a project that doesn’t require enterprise-level
complexity.
 Responsibilities:
o Process user queries and preferences.
o Communicate with the database and AI engine.
o Expose APIs for the frontend to consume.

D ATABASE

 Structure:
o Relational Database (PostgreSQL): User data, business details,
preferences.
o NoSQL Database (MongoDB): Unstructured data such as reviews.
 Responsibilities:
o Store and retrieve structured and unstructured data.
o Support complex queries for recommendations.

AI E NGINE

 Technology: TensorFlow or PyTorch.


 Responsibilities:
o Analyze user data and preferences.
o Generate personalized recommendations.
o Continuously improve models using user feedback.

T HIRD -P ARTY I NTEGRATIONS

 Examples: Google Maps API, Yelp API.


 Responsibilities:
o Fetch location data and reviews.
o Integrate external ratings and business details.

A UTHENTICATION S ERVICE

 Technology: OAuth 2.0.


 Responsibilities:
o Securely authenticate users.
o Manage session tokens and permissions.

DATA FLOW

1. User Interaction:
o User opens the app and inputs preferences or performs a search.
o The frontend sends the request to the backend via RESTful APIs.
2. Backend Processing:
o Backend receives the request and validates the input data.
o It queries the database for relevant businesses matching the criteria.
o If recommendations are requested, the backend interacts with the AI
Engine.
3. AI Engine:
o Processes user preferences and historical data.
o Applies machine learning algorithms to generate personalized
recommendations.
4. Database Interaction:
o Backend retrieves business and review data from PostgreSQL and
MongoDB.
o Updates user preferences or reviews if applicable.
5. Response Generation:
o Backend combines AI recommendations and database results.
o Formats the response in JSON and sends it back to the frontend.
6. Frontend Display:
o The mobile app displays results, recommendations, and additional
business details to the user.

3. FUNCTIONAL REQUIREMENTS
FEATURES

1. User Registration and Login: Allow users to create accounts and log in securely.
2. Search and Filtering: Provide search options with filters for distance, cuisine,
ratings, etc.
3. Personalized Recommendations: AI-powered recommendations based on user
history and preferences.
4. Business Listings: Display detailed information about restaurants and cafes.
5. User Reviews: Allow users to read and write reviews.

USE CASES

 UC1: User searches for nearby Italian restaurants.


 UC2: User filters results by "Open Now" and "Rating > 4".
 UC3: Business owner updates their listing details.

USER ROLES

 Regular Users: Search and view listings, leave reviews.


 Business Owners: Manage their establishment’s details.

4. NON-FUNCTIONAL REQUIREMENTS
PERFORMANCE

 System should handle up to 1000 concurrent users.


 Response time should be under 1 second for search queries.

SCALABILITY

 Horizontal scaling for backend servers and databases.


 Support for adding new recommendation algorithms.

SECURITY

 Use HTTPS for secure data transmission.


 Encrypt sensitive user data in the database.
 Implement OAuth 2.0 for authentication.

RELIABILITY

 99.9% uptime.
 Regular backups of the database.

5. DATABASE DESIGN
ER DIAGRAM

Entities include:

 User: UserID, Name, Email, Preferences.


 Business: BusinessID, Name, Location, Category, Rating.
 Review: ReviewID, UserID, BusinessID, Rating, Comment.

SCHEMAS

 Users: UserID (PK), Name, Email, Password, Preferences.


 Businesses: BusinessID (PK), Name, Location, Category, Rating.
 Reviews: ReviewID (PK), UserID (FK), BusinessID (FK), Rating, Comment.

6. API DESIGN
ENDPOINTS

1. User Management:
o POST /register: Register a new user.
o POST /login: Authenticate user.
2. Search and Recommendations:
o GET /search: Search for businesses.
o GET /recommendations: Get personalized recommendations.
3. Reviews:
o POST /reviews: Submit a review.
o GET /reviews/{businessID}: Get reviews for a business.

7-User Interface Design


8-Technology Stack
9-Deployment Plan
10-Testing Plan
11- Maintaining and Updates
12-Risks and Mitigations
13-Appendices

You might also like