You are on page 1of 22

International School

Capstone Project 2
CMU-SE 450

Database Design
Version 2.0
Date: 05/5/2023

Online Service Market System


Submitted by

Quan Tran Anh


Khiem Le Do Hoang
Phuc Truong Gia
Thuan Huynh Van
Truong Nguyen Lam

Approved by

Huy Nguyen Dang Quang M.Sc.

Proposal Review Panel Representative:


Name Signature Date

Capstone Project 2-Mentor:


Name Signature Date
Capstone Database Design v2.0 – OSM

PROJECT INFORMATION

Project
Online Service Market System
acronym
A marketplace that connects Customers & Service Providers in many
Project Tittle
service categories
Start Date 21 Feb 2023 End Date 20 May 2023
Lead
International School, Duy Tan University
Institution
Huy Nguyen Dang Quang
Project Mentor Email: huyndq@duytan.edu.vn
Tel: 0935525354
Scrum Master /
Quan Tran Anh
Project Leader
Email: anhquan74.dev@gmail.com
& contact
Tel: 0362474855
details
Partner
Organization
Project Web
URL
Team members Name Email Tel
Quan Tran
25211200029 anhquan74.dev@gmail.com 0362474855
Anh
Khiem Le Do
25211203121 ledohoangkhiem3k@gmail.com 0348597672
Hoang
Phuc Truong
25211217162 katanan257@gmail.com 0981864173
Gia
Thuan Huynh
25214302052 huynhvanthuan.140921@gmail.com 0824644573
Van
Truong
25211217426 truongnguyen13052001@gmail.com 0353373477
Nguyen Lam
Capstone Database Design v2.0 – OSM

PROJECT PLAN DOCUMENT

Document Title Project Plan

Reporting March 2023


Period
Author(s) & Quan Tran Anh, Scrum Master
project
Role Khiem Le Do Hoang Member

Phuc Truong Gia Member

Thuan Huynh Van Member

Truong Nguyen Lam Member

C2SE.08-
Date 28 Apr 2023 Filename DatabaseDesignDocument-

OSM.docx
URL
Access Project and CMU Program
Capstone Database Design v2.0 – OSM

DOCUMENT HISTORY
Version Date Comments
V1.0 20 Mar 2023 Draft for comment
V2.0 28 Apr 2023 Update database
V3.0 05 May 2023 Update database
Capstone Database Design v2.0 – OSM

CONTENTS
1. Introduction ...............................................................................................................1

1.1. Purpose ...............................................................................................................1

1.2. Document Objectives .........................................................................................1

1.3. Intended Audience .............................................................................................1

1.4. Scope ..................................................................................................................1

1.5. System Overview ...............................................................................................2

1.6. Acronyms And Abbreviations ...........................................................................2

2. System Overview ......................................................................................................2

2.1. Database Management System Configuration ...................................................2

2.2. Database Software Utilities................................................................................3

2.3. Support Software ...............................................................................................3

3. Database-Wide Design Decisions.............................................................................3

3.1. Key Factors Influencing Design ........................................................................3

3.2. Performance And Availability Decisions ..........................................................3

4. Database Administrative Functions ..........................................................................3

4.1. Responsibility ....................................................................................................3

4.2. Applications/Systems Using the Database ........................................................3

4.3. Physical Design ..................................................................................................4

4.3.1. Detail table ..................................................................................................4

5. Entity Mapping .......................................................................................................13

6. References ...............................................................................................................15
Capstone Database Design v2.0 – OSM

LIST OF TABLES
Table 1: System Overview .............................................................................................2
Table 2: Acronyms And Abbreviations ..........................................................................2
Table 3: Database Software ............................................................................................3
Table 4: Support Software ..............................................................................................3
Table 5: Responsibility ...................................................................................................3
Table 6: Systems Using the Database.............................................................................3
Table 7: User...................................................................................................................4
Table 8: Location ............................................................................................................5
Table 9: Image ................................................................................................................6
Table 10: Post .................................................................................................................7
Table 11: Category .........................................................................................................8
Table 12: Service ............................................................................................................8
Table 13: Package ...........................................................................................................9
Table 14: Appointment .................................................................................................10
Table 15: Feedback .......................................................................................................12
Capstone Database Design v2.0 – OSM

TABLE OF FIGURES
Figure 1. Entity Mapping..............................................................................................14
Capstone Database Design v2.0 – OSM

1. Introduction
1.1. Purpose
• Setting up an overview about the database of Online Service Market web
application.
• Provides database tables and the relationship between them.
• Description designing a database (DB), a collection of data related to storage on
a computer through database management system as a basis for data query related
software.
• Provide the entire needed database for OSM web application.
1.2. Document Objectives
The Database Design Document has the following objectives
• To describe the design of a database, that is, a collection of related data stored in
one or more computerized files that can be accessed by users or developers via a
DBMS.
• To serve as a basis for implementing the database and related software units. It
provides the acquirer visibility into the design and provides information
necessary for software development.
1.3. Intended Audience
• This document is intended for the following audiences
• Technical developers, who must evaluate the quality of this document
• Developer including:
o Architects, whose overall architecture design must meet the requirements
specified in this document.
o Designers, whose design must meet the requirements specified in this
document.
o Developers, whose software must implement the requirements specified in
this document. Quality Assurance personnel, whose test cases must validate
the requirements specified in this document.
1.4. Scope
• This Database Design Document provides the basic database design of OSM web
application.

C2SE.08 1
Capstone Database Design v2.0 – OSM

• It describes both logical and physical definition, non-functional, database


interfaces, tables, code create tables.
• It includes the tables and performance considerations and requirements. The
following topics are covered in this document:
o Assumptions and decisions on database design
o Entity – mapping
o Table, column definitions
o Column and row level validation rules (check constraints)
o Interfaces and dependencies with other components.
• This Database Design Document of Online Service Market web application is
composed of definitions for database objects derived by mapping entities to
tables, attributes to columns, unique identifiers to unique keys and relationship
to foreign keys.
1.5. System Overview
Table 1: System Overview

System Overview Details


System Name Online Service Market

System Type Web application


Operational Status In development

1.6. Acronyms And Abbreviations


Table 2: Acronyms And Abbreviations

Acronym/Abbreviation Meaning
OSM Online Service Market

RDMS Relational Database Management System


DBMS Database Management System
DB Database

2. System Overview
2.1. Database Management System Configuration
- System: MS Windows
- Vendor: Digital Ocean

C2SE.08 2
Capstone Database Design v2.0 – OSM

- Services enabled: Linux Virtual Machine


2.2. Database Software Utilities
Table 3: Database Software

Vendor Product Version Comments


This application enables the ability
Oracle MySQL
8.0 to manage MySQL database using
Corporation Workbench
GUI.

2.3. Support Software


Table 4: Support Software

Product Version Purpose


MySQL
8.0 Generate ERD diagram of MySQL database.
Workbench

3. Database-Wide Design Decisions


3.1. Key Factors Influencing Design
- The database should be designed independent when the frontend and backend
are still being developed.
- The database should be designed to meet the data warehouse principles.
3.2. Performance And Availability Decisions
We use common dimensional tables for all the fact tables for better performance
4. Database Administrative Functions
4.1. Responsibility
Table 5: Responsibility

Role Name Responsibility Email Address


Database Khiem Le Do ledohoangkhiem3k@gmai
Administrator Hoang l.com

System and
Security anhquan74.dev@gmail.co
Quan Anh Tran
m
Administrator

4.2. Applications/Systems Using the Database


Table 6: Systems Using the Database

C2SE.08 3
Capstone Database Design v2.0 – OSM

System ID Model Version System Code

OSM-Web NA In Development NA

4.3. Physical Design


4.3.1. Detail table
4.3.1.1. User
Table 7: User

Field Type Constraint Nullable Description


bigInt, The id is the primary
id PK False
autoIncrement key for User record.

varchar,
email False The email of the user.
unique

The password of the


password varchar False
user.

The full name of the


full_name varchar False
user.

birthday timestamp True The birthday of the user.

gender varchar True The gender of the user.

phone_numbe The phone number of


varchar True
r the user.

The introduction about


introduction text True
the provider.

The provider liked by


is_favorite tinyInt True
customer

Provider operating
is_working tinyInt True
status

C2SE.08 4
Capstone Database Design v2.0 – OSM

total_rate bigInt True

total_star bigInt True

avg_star float True

clicks bigInt True

views bigInt True

click_rate float True

User account status (soft


is_valid tinyInt True
delete)

Date and time the


created_at timestamp False
record was created.

Date and time the


updated_at timestamp False
record was last updated.

4.3.1.2. Location
Table 8: Location

Field Type Constraint Nullable Description


bigInt,
The id is the primary key
id autoIncrem PK False
for location record.
ent

User identification number.


user_id bigInt FK False
Foreign key to User.id

province_id bigInt True The id of the province.

province_nam
varchar False The name of the province.
e

district_id bigInt True The id of the district.

C2SE.08 5
Capstone Database Design v2.0 – OSM

district_name varchar True The name of the district.

ward_id bigInt Tue The id of the ward.

ward_name varchar True The name of the ward.

coords_latitud The latitude of the user’s


decimal True
e location.

coords_longit The longitude of the user’s


decimal True
ude location.

is_primary bit

Date and time the record


created_at timestamp False
was created.

Date and time the record


updated_at timestamp False
was last updated.

4.3.1.3. Image
Table 9: Image

Field Type Constraint Nullable Description


bigInt, The id is the primary
id PK False
autoIncrement key for image record.

asset_type varchar True Type of file (image)

Describe what model


parent_type varchar True
this image belongs to.

parent_id varchar True Id of parent model.

delivery_typ Type of delivery


varchar True
e method.

Id of file on cloud
public_id varchar True
server.

C2SE.08 6
Capstone Database Design v2.0 – OSM

file_name varchar True Name of the file.

mime varchar True Type of image file.

Date and time the


created_at timestamp False
record was created.

Date and time the


updated_at timestamp False record was last
updated.

4.3.1.4. Post
Table 10: Post

Field Type Constraint Nullable Description


bigInt, The id is the primary key
id PK False
autoIncrement for banner record.

User identification
author_id bigInt FK False number. Foreign key to
User.id.

title varchar True The title of the post.

content text True The content of the post.

date timestamp True Post creation date.

tags varchar True The tags of the post.

is_valid
tinyInt True Post status (soft delete)

Date and time the record


created_at timestamp False
was created.

Date and time the record


updated_at timestamp False
was last updated.

C2SE.08 7
Capstone Database Design v2.0 – OSM

4.3.1.5. Category
Table 11: Category

Field Type Constraint Nullable Description


bigInt, The id is the primary key
id PK False
autoIncrement for category record.

name varchar True The name of the category.

total_provid
int True The number of provider.
er

view_priorit
bigInt True
y

Category status (soft


is_valid tinyInt True
delete)

Date and time the record


created_at timestamp False
was created.

Date and time the record


updated_at timestamp False
was last updated.

4.3.1.6. Service
Table 12: Service

Field Type Constraint Nullable Description


bigInt, The id is the primary key
id PK False
autoIncrement for service record.

Category identification
category_id bigInt FK False number. Foreign key to
Category.id.

C2SE.08 8
Capstone Database Design v2.0 – OSM

User identification
provider_id bigInt FK False number. Foreign key to
User.id.

avg_price bigInt True Average price of service.

The highest price of the


max_price bigInt True
service.

The lowest price of the


min_price bigInt True
service.

is_negotiabl
tinyInt True
e

total_rate bigInt True

total_star bigInt True

avg_star float True

number_of_
bigInt True
packages

is_valid tinyInt True Service status (soft delete)

Date and time the record


created_at timestamp False
was created.

Date and time the record


updated_at timestamp False
was last updated.

4.3.1.7. Package
Table 13: Package

Field Type Constraint Nullable Description


bigInt, The id is the primary key
id PK False
autoIncrement for service record.

C2SE.08 9
Capstone Database Design v2.0 – OSM

Service identification
service_id bigInt FK False number. Foreign key to
Service.id.

name varchar True The name of the package.

The description of the


description text True
package.

price bigInt True The price of the package.

total_rate bigInt True

total_star bigInt True

avg_star float True

is_negotiable tinyInt True

view_priorit
bigInt True
y

Package status (soft


is_valid tinyInt True
delete)

Date and time the record


created_at timestamp False
was created.

Date and time the record


updated_at timestamp False
was last updated.

4.3.1.8. Appointment
Table 14: Appointment

Field Type Constraint Nullable Description


bigInt, The id is the primary
id autoIncreme PK False key for appointment
nt record.

C2SE.08 10
Capstone Database Design v2.0 – OSM

Package identification
package_id bigInt FK False number. Foreign key to
Package.id.

User identification
customer_id bigInt FK False number. Foreign key to
User.id.

Service status (soft


is_valid tinyInt True
delete)

note_for_provid The note of customer


varchar True
er for provider.

The location of the


location varchar True
appointment

The time occur of the


date timestamp True
appointment

The price of the


price bigInt True
appointment

The unit of
price_unit varchar True
appointment’s price

The status of the


status varchar True
appointment

The time that the


complete_date timestamp True appointment is
completed

The time when the


cancel_date timestamp True appointment was
rejected

C2SE.08 11
Capstone Database Design v2.0 – OSM

The time on which the


offer_date timestamp True
appointment is offered

Date and time the


created_at timestamp False
record was created.

Date and time the


updated_at timestamp False record was last
updated.

4.3.1.9. Feedback
Table 15: Feedback

Field Type Constraint Nullable Description


The id is the primary
bigInt,
id PK False key for feedback
autoIncrement
record.

Appointment
identification
appointment_id bigInt FK False
number. Foreign key
to Appointment.id.

Comment of
comment varchar True customer for the
appointment.

Reply of provider for


reply varchar True
customer’s comment.

Number of star for


star bigInt True appointment
(customer’s rate).

reply_at date True

C2SE.08 12
Capstone Database Design v2.0 – OSM

Date and time the


created_at timestamp False
record was created.

Date and time the


updated_at timestamp False record was last
updated.

5. Entity Mapping

C2SE.08 13
Capstone Database Design v2.0 – OSM

Figure 1. Entity Mapping

C2SE.08 14
Capstone Database Design v2.0 – OSM

6. References
- [SDA] 006 Database Design.docx (Man, Nguyen Duc).
- https://drawsql.app/teams/dac-1/diagrams/osm

C2SE.08 15

You might also like