Sunteți pe pagina 1din 5

Requirement analysis

Introduction
The purpose is to store users and their information. As well as allow users to interact
with each other.
N1. We need to be able to add users.
N2. We need to store certain user information: name, country, e-mail account, date
of birth, username, and password.
N3. We are able to store users posts.
N4. We need to store user relationships (friends, groups, banned).
N5. User should be able to create a public or private group.
I1. Users must have different privilege levels (group admin, global admin, regular
user, root access).
I2. We need to be able to have categories and topics.
D1. We could be able to store users city information.
D2. User could choose anonymous mode (random username).
D3. We would be able to store chat logs.
D4. We could store calendar events for users and groups.
D5. User could be able to delete or edit his post.


Field definitions
User
Field Data type Information
user_id INT(11) primary key, auto_increment
firstname VARCHAR(20) mandatory
lastname VARCHAR(20) mandatory
email VARCHAR(30 mandatory, unique
birthdate DATE mandatory
password CHAR(60) mandatory
salt CHAR(11) mandatory
country VARCHAR(20) mandatory
city VARCHAR(70)
lastAttemptedLogin TIMESTAMP mandatory
failedLoginAttempts INT(3) mandatory
privilegeLevel INT(2) mandatory
avatar VARCHAR(255)
privacyLevel INT(2) mandatory

Group
Field Data type Information
group_id INT(11) primary key, auto_increment
name VARCHAR(50) mandatory
description TEXT
logo VARCHAR(255)
privacyLevel INT(2) mandatory
reviewed BOOLEAN mandatory
active BOOLEAN mandatory

Category
Field Data type Information
category_id INT(11) primary key, auto_increment
group_id INT(11) foreign key, references to table Group
name VARCHAR(50) mandatory
description TEXT

UserGroups
Field Data type Information
user_id INT(11) foreign key, primary key references to table User
group_id INT(11) foreign key, primary key references to table Group
status INT(2) mandatory

UserPost
Field Data type Information
post_id BIGINT primary key, auto_increment
user_id INT(11) foreign key, references to table User
group_id INT(11) foreign key, references to table Group
post_date TIMESTAMP primary key
content TEXT mandatory
active BOOLEAN mandatory

PostComment
Filed Data type Information
post_id BIGINT foreign key, references to table UserPost
user_id INT(11) foreign key, primary key references to table User
comment_date TIMESTAMP primary key
content TEXT mandatory

ChatRoom
Field Data type Information
chatroom_id INT(11) primary key
privacyLevel INT(2) mandatory
password CHAR(60)

ChatLog
Field Data type Information
chatroom_id INT(11) foreign key , primary key references to table ChatRoom
date TIMESTAMP primary key
content TEXT
ChatGroup
Field Data type Information
chatroom_id INT(11) foreign key, primary key references to table ChatRoom
group_id INT(11) foregn key, primary key refrences to table Group

ChatUser
Field Data type Information
chatroom_id INT(11) foreign key, primary key references to table ChatRoom
user_id INT(11) foreign key, primary key references to table User


Referential Integrity
Field Characteristic
user_id primary key, auto_increment
firstname mandatory
lastname mandatory
email mandatory, unique
birthdate mandatory
password mandatory
salt mandatory
country mandatory
city
lastAttemptedLogin mandatory
failedLoginAttempts mandatory
privilegeLevel mandatory
avatar
privacyLevel mandatory