Conversation
Create .gitattributes
Create CODEOWNERS
Update CODEOWNERS
fix incorrect roles initiation
Fixes the error with `DSN.delete()`
Added zitadel
update gitignore for binary files
Thats better
Casbin patch
Fixes something i didnt notice Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Vue integration
There was a problem hiding this comment.
Pull Request Overview
This PR introduces Vue.js frontend scaffolding and backend database user management functionality to enable @SuitablyMysterious to test the backend and database APIs independently.
Key changes:
- Replaces Flask-based frontend with Vue.js framework and components
- Adds User class with SQL storage and Casbin integration for user management
- Updates Docker configuration and database schema to support development testing
Reviewed Changes
Copilot reviewed 28 out of 29 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| src/frontend/src/*.vue | Vue.js components for frontend UI (book search, login, header) |
| src/frontend/package.json | NPM dependencies and build configuration for Vue.js |
| src/backend/db.py | User class implementation with database operations and email validation |
| src/backend/requirements.in | Added email-validator dependency |
| compose.yaml | Updated Docker services, replaced Casdoor with Logto authentication |
| db-init/1_tables.sql | Added users table and changed ID types from BIGINT to UUID |
| launch.sh | New script for environment setup and Docker management |
Comments suppressed due to low confidence (1)
| self.forename = forename | ||
| self.surname = surname | ||
| self.student_id = student_id | ||
| self.uuid = str(uuid.uuid4()) |
There was a problem hiding this comment.
Using uuid.uuid4() is redundant when uuid is already imported. Use uuid4() directly instead of uuid.uuid4().
| self.uuid = str(uuid.uuid4()) | |
| self.uuid = str(uuid4()) |
| self.role = role | ||
| def SQLStore(self): | ||
| try: | ||
| sendSQLCommand( |
There was a problem hiding this comment.
The sendSQLCommand call is missing the 'params' parameter that should contain the SQL parameters tuple, but the function signature expects it.
| field = valid_columns[field] | ||
|
|
||
| if field == 'userID': | ||
| user = User(sendSQLCommand( |
There was a problem hiding this comment.
The User constructor expects individual parameters (forename, surname, student_id, email, role) but sendSQLCommand returns a tuple. You need to unpack the result or handle the tuple properly.
| user = User(sendSQLCommand( | |
| user = User(*sendSQLCommand( |
| id UUID PRIMARY KEY, | ||
| forename TEXT NOT NULL, | ||
| surname TEXT NOT NULL, | ||
| student_id INTEGER NOT NULL |
There was a problem hiding this comment.
Missing comma after 'student_id INTEGER NOT NULL' which will cause a SQL syntax error.
| student_id INTEGER NOT NULL | |
| student_id INTEGER NOT NULL, |
| if (type === 'id') { | ||
| url = 'http://localhost:8000/Book/getByID' | ||
| params = { id: this.query.id } | ||
|
|
||
| } else if (type === 'isbn') { |
There was a problem hiding this comment.
The code checks for 'id' type but there is no corresponding input field or query parameter for 'id' in the template, and the query object doesn't have an 'id' property.
| if (type === 'id') { | |
| url = 'http://localhost:8000/Book/getByID' | |
| params = { id: this.query.id } | |
| } else if (type === 'isbn') { | |
| if (type === 'isbn') { |
|
|
||
| field = valid_columns[field] | ||
|
|
||
| if field == 'userID': |
There was a problem hiding this comment.
The condition checks for 'userID' but the valid_columns mapping shows 'userID' maps to 'student_id', so this condition will never be true after the field is mapped.
| if field == 'userID': | |
| if field == 'student_id': |
Update testing to allow @SuitablyMysterious to test backend and db on their own to test the api