Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding some code changes to user #7

Open
wants to merge 94 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
94 commits
Select commit Hold shift + click to select a range
94ba6b0
Added mySQL database creation script
gemackin Apr 15, 2024
240dd02
Adding the data
Airelyn Apr 15, 2024
6fa4502
Adding the data
Airelyn Apr 15, 2024
4006395
Rename locations.sql to Locations.sql
gemackin Apr 15, 2024
bbda18f
Rename shifts.sql to Shifts.sql
gemackin Apr 15, 2024
fa6aa07
Rename tasks.sql to Tasks.sql
gemackin Apr 15, 2024
8b9bda9
Rename user_data.sql to Users.sql
gemackin Apr 15, 2024
a0e285e
Delete flask-app/src/customers directory
gemackin Apr 15, 2024
f6cd23a
Delete flask-app/src/products directory
gemackin Apr 15, 2024
a248cd1
Uploading preliminary flask routes
gemackin Apr 15, 2024
8a8de21
Moving locations.py to folder
gemackin Apr 15, 2024
080fc9b
Moving shifts.py to folder
gemackin Apr 15, 2024
29950bb
Moving torequests.py to folder
gemackin Apr 15, 2024
0f64c59
Moving users.py to folder
gemackin Apr 15, 2024
0f6d5af
Delete db/00_northwind.sql
gemackin Apr 16, 2024
dddef5b
Delete db/01_northwind-default-current-timestamp.sql
gemackin Apr 16, 2024
a7b7931
Delete db/02_northwind-data.sql
gemackin Apr 16, 2024
2404783
Changed state names to abbreviations
gemackin Apr 16, 2024
b4ffd2e
Update and rename PhaseTwo_FINAL.sql to 00_Scheduling.sql
gemackin Apr 16, 2024
07e529a
Rename Users.sql to 01_Users.sql
gemackin Apr 16, 2024
f934f30
Rename UserManagers.sql to 02_UserManagers.sql
gemackin Apr 16, 2024
2e486f4
Rename Locations.sql to 03_Locations.sql
gemackin Apr 16, 2024
37b1f71
Rename Schedules.sql to 04_Schedules.sql
gemackin Apr 16, 2024
e505ed6
Rename Shifts.sql to 05_Shifts.sql
gemackin Apr 16, 2024
abe621b
Rename Tasks.sql to 06_Tasks.sql
gemackin Apr 16, 2024
80a64fc
Rename TimeOffRequests.sql to 07_TimeOffRequests.sql
gemackin Apr 16, 2024
3aaddf4
Rename Times.sql to 08_Times.sql
gemackin Apr 16, 2024
cb3c9a3
Fixed Times to have startDate come before endDate
gemackin Apr 16, 2024
58ea1ef
Fixed Shifts timing
gemackin Apr 16, 2024
cfb9801
Added new creation date attribute to Shifts
gemackin Apr 16, 2024
2dbb54e
Fixed dayOfWeek column to be 0-6 not 1-7
gemackin Apr 16, 2024
a3c1b40
Added salary GET route
gemackin Apr 16, 2024
e31e0f4
Removed get_max_value
gemackin Apr 16, 2024
d096ef4
Fixed location PUT route
gemackin Apr 16, 2024
7d367fe
Delete db/db_bootstrap.sql
gemackin Apr 16, 2024
f68878f
Delete db/classicModelsSampleDB.sql
gemackin Apr 16, 2024
0ac44fd
Changed function name
gemackin Apr 16, 2024
b062093
Create db_password.txt
gemackin Apr 16, 2024
568ebe2
Create db_root_password.txt
gemackin Apr 16, 2024
e482252
Update locations.py
gemackin Apr 16, 2024
cd1b4a7
Update shifts.py
gemackin Apr 16, 2024
bb4a057
Update torequests.py
gemackin Apr 16, 2024
6130e79
Update users.py
gemackin Apr 16, 2024
d84597d
changing password back
Airelyn Apr 16, 2024
eba9afc
Update locations.py
gemackin Apr 16, 2024
a3c8def
locations
Airelyn Apr 16, 2024
f531b64
Update shifts.py
gemackin Apr 16, 2024
6ebd845
Update torequests.py
gemackin Apr 16, 2024
4fc0105
Update users.py
gemackin Apr 16, 2024
0d5ca4e
Minor edits in SQL files
gemackin Apr 17, 2024
c38fca6
Add 5th route to locations
gemackin Apr 17, 2024
2effafe
Add 6th route to shifts
gemackin Apr 17, 2024
4f1ec78
Finished request routes (8 total)
gemackin Apr 17, 2024
672bbac
Added 5th route to users
gemackin Apr 17, 2024
e8e728a
Update locations.py
gemackin Apr 17, 2024
34ec909
Update shifts.py
gemackin Apr 17, 2024
85aa78e
Update torequests.py
gemackin Apr 17, 2024
4b2c063
Update users.py
gemackin Apr 17, 2024
12e674a
Finished location routes
gemackin Apr 18, 2024
5fe642e
Finished shift routes
gemackin Apr 18, 2024
e0fab8a
Finished request routes
gemackin Apr 18, 2024
5c410cc
Finished user routes
gemackin Apr 18, 2024
6c03f25
Minor edits to database creation
gemackin Apr 18, 2024
dbbcaf6
Added comments
gemackin Apr 18, 2024
6dad605
Fixed start/end date swapping
gemackin Apr 18, 2024
1982092
Added grant privileges line
gemackin Apr 18, 2024
1680ca2
tweaks in MySQL INSERT files and in route files
gdiegnan Apr 18, 2024
62f41d6
Merge branch 'main' of https://github.com/Airelyn/24s-project-boilerp…
gdiegnan Apr 18, 2024
428bce4
Implemented to_str in put_helper
gemackin Apr 18, 2024
638a2ad
Fixed to_str
gemackin Apr 18, 2024
62f68b9
Indentation
gemackin Apr 18, 2024
496d7b6
Merge branch 'main' of https://github.com/Airelyn/24s-project-boilerp…
Airelyn Apr 18, 2024
13a3975
Potential fix for JSONify
gemackin Apr 18, 2024
52ca2e2
Swapping some values
gemackin Apr 18, 2024
15691b2
Update blueprint_template.py
gemackin Apr 18, 2024
efc3ce3
Update blueprint_template.py
gemackin Apr 18, 2024
bea4cbc
Update blueprint_template.py
gemackin Apr 18, 2024
0c44714
Changing time
Airelyn Apr 18, 2024
b2f15b6
Update shifts.py
gemackin Apr 18, 2024
350a217
Update blueprint_template.py
gemackin Apr 18, 2024
979fa30
Update shifts.py
gemackin Apr 18, 2024
25202b7
Removed the datetime stuff since it's in shifts.py
gemackin Apr 18, 2024
4770e20
Changedd moveLocation
gemackin Apr 19, 2024
cfdd79b
Fixed transferShifts
gemackin Apr 19, 2024
29e9779
Comments
gemackin Apr 19, 2024
10fcb2a
Comments
gemackin Apr 19, 2024
875ba20
Update users.py
gemackin Apr 19, 2024
173f1ea
Update shifts.py
gemackin Apr 19, 2024
44bf6da
Updated README.md
melinalymber Apr 19, 2024
ac3e83e
Finalized Personas -- Updated README.md
melinalymber Apr 19, 2024
e7d16c6
Fixed name of delete_location
gemackin Apr 19, 2024
98b0c48
Updating time off requests
gdiegnan Apr 19, 2024
f54e1eb
Merge branch 'main' of https://github.com/Airelyn/24s-project-boilerp…
gdiegnan Apr 19, 2024
eff3ad4
Added demo video to README
gdiegnan Apr 19, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
59 changes: 58 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,61 @@
# MySQL + Flask Boilerplate Project
## Project Overview:

Our project aims to create a comprehensive scheduling application using the AppsSmith platform. The UI is customized to meet the scheduling needs of owners, employees, and managers within a business context. By leveraging AppSmith's capabilities, we provide a streamlined and intuitive scheduling solution tailored for different organizational roles.

You can see an overview of the entire project here: https://www.youtube.com/watch?v=vKeo7o4iGt8

-------------------------------------------------------------------------------

## Key Features of Personas:
- Owner
- Can access locations using a GET.
- Allowed to pull information about specific shifts using a GET.

- Employee
- Employees are permitted to request time off with a POST route.
- Able to view their schedules via a GET.

- Manager
- Allowed to access the information of other managers' schedule information via a GET.
- Managers can view all employees/users, choose one, and delete them using a DELETE route from the database.
- Can access a table of all employee's tasks using a GET.
- Able to edit an employee's role via a PUT route.

-------------------------------------------------------------------------------



## Getting Started:

To use the AppSmith UI for scheduling purposes, here are the following steps:

1.) Clone the repository to your local machine

git clone https://github.com/Airelyn/24s-project-boilerplate
2.) Navigate to project directory

cd 24s-project-boilerplate
3.) Start docker containers using docker-compose

docker-compose up -d
4.) Access the application. Once the containers are running, access the application through your web browser

- OWNER: HTTP://localhost:8080/owner
- EMPLOYEE: HTTP://localhost:8080/employee
- MANAGER: HTTP://localhost:8080/manager
5.) Refer to the Docker Compose file ('docker-compose.yml) to adjust environment variables or container settings as needed.


-------------------------------------------------------------------








c/Users/airelynguadagno/Desktop/3200-practice/24s-project-boilerplate/docker-compose.yml# MySQL + Flask Boilerplate Project

This repo contains a boilerplate setup for spinning up 3 Docker containers:
1. A MySQL 8 container for obvious reasons
Expand Down
113 changes: 113 additions & 0 deletions db/00_Scheduling.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
DROP DATABASE IF EXISTS Scheduling;
CREATE DATABASE Scheduling;

GRANT ALL PRIVILEGES ON Scheduling.* TO 'webapp'@'%';
FLUSH PRIVILEGES;

USE Scheduling;


CREATE TABLE Users (
id INTEGER AUTO_INCREMENT PRIMARY KEY,
role VARCHAR(50),
hourlyRate FLOAT(2), -- In dollars
firstName VARCHAR(50),
lastName VARCHAR(50),
sharesOwned INTEGER DEFAULT 0, -- Ownership percentage
active BOOLEAN DEFAULT TRUE -- If they're still employed
);

-- Indicates user-manager relationships
CREATE TABLE UserManagers (
employee INTEGER,
manager INTEGER,
PRIMARY KEY (employee, manager),
CONSTRAINT employeeKey FOREIGN KEY (employee)
REFERENCES Users (id)
ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT managerKey FOREIGN KEY (manager)
REFERENCES Users (id)
ON DELETE CASCADE ON UPDATE CASCADE
);

CREATE TABLE Locations (
id INTEGER AUTO_INCREMENT PRIMARY KEY,
address1 VARCHAR(100) NOT NULL, -- Line 1
address2 VARCHAR(100), -- Line 2 (optional)
city VARCHAR(50),
state CHAR(2), -- State abbreviation
zip CHAR(5), -- Should be numeric
owner INTEGER,
CONSTRAINT ownedBy FOREIGN KEY (owner)
REFERENCES Users (id)
ON DELETE CASCADE ON UPDATE CASCADE
);

CREATE TABLE Schedules (
id INTEGER AUTO_INCREMENT PRIMARY KEY,
location INTEGER NOT NULL,
CONSTRAINT locatedAt FOREIGN KEY (location)
REFERENCES Locations (id)
ON DELETE CASCADE ON UPDATE CASCADE
);

CREATE TABLE TimeOffRequests (
id INTEGER AUTO_INCREMENT PRIMARY KEY,
reason TEXT,
paid BOOLEAN DEFAULT FALSE,
submitDate DATETIME DEFAULT CURRENT_TIMESTAMP,
createdBy INTEGER,
approved BOOLEAN,
viewedBy INTEGER,
schedule INTEGER,
CONSTRAINT creator FOREIGN KEY (createdBy)
REFERENCES Users (id)
ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT viewer FOREIGN KEY (viewedBy)
REFERENCES Users (id)
ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT scheduleKey FOREIGN KEY (schedule)
REFERENCES Schedules (id)
ON DELETE CASCADE ON UPDATE CASCADE
);

-- Multivalued attribute of time-off requests
CREATE TABLE Times (
id INTEGER AUTO_INCREMENT PRIMARY KEY,
startDate DATETIME NOT NULL,
endDate DATETIME NOT NULL,
request INTEGER,
CONSTRAINT requestKey FOREIGN KEY (request)
REFERENCES TimeOffRequests (id)
ON DELETE CASCADE ON UPDATE CASCADE
);

CREATE TABLE Shifts (
id INTEGER AUTO_INCREMENT PRIMARY KEY,
duty VARCHAR(50),
dayOfWeek INTEGER, -- 0 = Monday, 6 = Sunday
startTime TIME,
endTime TIME,
overtime BOOLEAN DEFAULT FALSE,
employee INTEGER,
schedule INTEGER,
CONSTRAINT workedBy FOREIGN KEY (employee)
REFERENCES Users (id)
ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT scheduledAt FOREIGN KEY (schedule)
REFERENCES Schedules (id)
ON DELETE CASCADE ON UPDATE CASCADE
);

CREATE TABLE Tasks (
id INTEGER AUTO_INCREMENT PRIMARY KEY,
assignedDate DATETIME DEFAULT CURRENT_TIMESTAMP,
dueDate DATETIME,
type VARCHAR(100),
description TEXT,
submitted BOOLEAN DEFAULT FALSE,
user INTEGER NOT NULL,
CONSTRAINT student FOREIGN KEY (user)
REFERENCES Users (id)
ON DELETE CASCADE ON UPDATE CASCADE
);
Loading