SRS Analysis Models - SSD2015/TeamGG GitHub Wiki
Domain model
(The source is in this page's commit history)
Relational model
Group table
| Name | Type | Note |
|---|---|---|
| id | int PRIMARY KEY AUTO_INCREMENT | |
| name | varchar(255) | |
| number | tinyint NULL | Group number (like 1, 2, 3). It might be changed so we doesn't store it in the primary key |
Project table
| Name | Type | Note |
|---|---|---|
| id | int PRIMARY KEY AUTO_INCREMENT | |
| name | varchar(255) | |
| group_id | int | Foreign key to group table |
| description | text DEFAULT "" | I think the application should set like 250 maximum length but text type is used to support possible requirement changes |
| logo | varchar(255) DEFAULT "" | Path to the image file |
User table
| Name | Type | Note |
|---|---|---|
| id | int PRIMARY_KEY AUTO_INCREMENT | |
| username | varchar(255) | For KU login use [email protected], otherwise it is username without @... |
| password | varchar(255) | For KU login the password is NOT stored. Otherwise it MUST be hashed (scrypt?). |
| type | tinyint | 0=voter, 1=instructor, 2=organizer. (2 can do everything 1 can, 1 can do everything 0 can but not vice-versa) |
| name | varchar(255) NULL DEFAULT NULL | Human name (eg. Manatsawin instead of b5610545757) |
| organization | varchar(255) NULL | Their organization. Not parsed by application |
| group_id | int NULL DEFAULT NULL | Foreign key to group. Can be null if user does not belongs to any group. Having a group make user type 0 able to access group backoffice |
Organizer can allow students access beforehand by adding their usernames into this table.
Token table
Note: If Play framework has good session system it can be used instead of this
| Name | Type | Note |
|---|---|---|
| id | varchar(255) PRIMARY_KEY | Generated randomly |
| user_id | int | Foreign key to user table |
VoteCategory table
| Name | Type | Note |
|---|---|---|
| id | int PRIMARY_KEY AUTO_INCREMENT | |
| name | varchar(255) | |
| type | tinyint | 0=best of, 1=star |
Configuration table
| Name | Type | Note |
|---|---|---|
| key | varchar(255) PRIMARY_KEY | |
| value | text NULL |
Example of configuration keys: allow_voting, announcement, allow_group_edit
Vote table
| Name | Type | Note |
|---|---|---|
| id | int PRIMARY_KEY AUTO_INCREMENT | |
| category_id | int | Foreign key to vote_category table |
| user_id | int | Foreign key to user table |
| project_id | int | Foreign key to project table |
| score | int DEFAULT 1 | For best of vote it is always 1 |
Additional tables
These additional tables may or may not be used:
- Screenshots
- AppBuild
If you need it, please design it or ask @whs to make one.
Swagger API
The API is documented as Swagger API at Swagger UI (source)