Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
129 commits
Select commit Hold shift + click to select a range
8a557a4
https version
tcrurav Sep 3, 2022
461b03d
https version
tcrurav Sep 3, 2022
ac17d63
It works in dev mode with docker
tcrurav Sep 4, 2022
d1fa74e
It works in development with docker better organized
tcrurav Sep 4, 2022
449dfc8
It works in production using https://somosbluecity.es:8443 and https:…
tcrurav Sep 4, 2022
f968f89
it works in hosting
tcrurav Sep 12, 2022
39047ac
fixed some bugs regarding admin panel Sessions and Users sections
mianfiga Sep 14, 2022
e67d74c
updated ruby version
mianfiga Sep 16, 2022
5d0cab7
fixed to chat
mianfiga Sep 26, 2022
e891569
Extrafields woring version
mianfiga Sep 26, 2022
1b20971
Fixed backend notification system, changed backend user dropdown to t…
mianfiga Oct 4, 2022
4f931b0
fixed profile username change, unread chat order, chat list z-index
mianfiga Oct 9, 2022
270b586
updating chat seen for unread chat info
mianfiga Oct 9, 2022
045a4e3
session links fixed
mianfiga Oct 9, 2022
d3c2bc0
README.md changes
tcrurav Oct 10, 2022
94b4e5a
README.md changes
tcrurav Oct 10, 2022
e23f7b7
Development issues in README.md
tcrurav Oct 11, 2022
93ea6df
improved admin user interface, fixed user filtering
mianfiga Oct 11, 2022
ea3b249
wq
mianfiga Oct 13, 2022
f58ba70
Fixed order issue in user list
mianfiga Oct 13, 2022
ad75656
Making deployment instructions easier
tcrurav Oct 14, 2022
fb974b8
Some README.md fixing
tcrurav Oct 14, 2022
6be709d
Added Danish tranlations
Oct 14, 2022
4546c05
git clone added to README.md
tcrurav Oct 14, 2022
8c66135
fixed hiding menu option in desktop menu when disabled
mianfiga Oct 14, 2022
185cbc4
Merge pull request #1 from eduapp-project/sosu
mianfiga Oct 14, 2022
5368599
Merge pull request #2 from eduapp-project/rincon
mianfiga Oct 14, 2022
05a16f0
some .env changes
tcrurav Oct 14, 2022
aeb1c44
fixed filtering of enrollments
mianfiga Nov 10, 2022
aed100c
frontend danish translations
mianfiga Nov 10, 2022
7f5f4cf
login feedback on failing login
mianfiga Nov 14, 2022
4bee289
course API fixed
mianfiga Nov 14, 2022
de6973f
fixed subjects api
mianfiga Nov 16, 2022
09ffe06
fixed session api
mianfiga Nov 16, 2022
a09c322
Added Romanian translations
mianfiga Nov 17, 2022
5591523
Added romanian flag to admin site
mianfiga Nov 30, 2022
0ecfc63
Merge pull request #3 from eduapp-project/develop
mianfiga Nov 30, 2022
d0c98c6
reorganized inline creation form part I
mianfiga Nov 30, 2022
52ed2e3
Merge pull request #4 from eduapp-project/develop
mianfiga Nov 30, 2022
44f2a5e
Fix imports and add enrollment
PdgarHern Dec 16, 2022
fd52eea
Add subject user enrollment
PdgarHern Dec 20, 2022
aec4044
Merge pull request #5 from eduapp-project/issue/5423
mianfiga Jan 16, 2023
3db5745
Change frontend lateral menu
PdgarHern Dec 27, 2022
c8a6804
Merge pull request #6 from eduapp-project/issue/5436
mianfiga Jan 16, 2023
dd7e00b
Change frontend resources dropdown
PdgarHern Dec 27, 2022
678ad7d
Merge pull request #8 from eduapp-project/issue/5438
mianfiga Jan 16, 2023
2117006
Merge pull request #9 from eduapp-project/develop
mianfiga Jan 16, 2023
2ff38b4
Add deletion confirmation box
PdgarHern Jan 17, 2023
f02b4a1
Add participant in enrollment
PdgarHern Jan 17, 2023
b095a0d
Change language icons
PdgarHern Jan 18, 2023
84ffed8
Add subject enrollments to profile
PdgarHern Jan 18, 2023
b913384
Change profile to separate page
PdgarHern Jan 18, 2023
3f6b296
Merge pull request #10 from eduapp-project/issue/5468
mianfiga Jan 23, 2023
0fce2db
Merge pull request #11 from eduapp-project/issue/5477
mianfiga Jan 23, 2023
d242a69
Add functionality related with calendar sessions
PdgarHern Jan 23, 2023
90717be
Merge pull request #12 from eduapp-project/issue/5477-2
mianfiga Jan 24, 2023
ce00a35
some .env changes
tcrurav Oct 14, 2022
cb97704
Save avatar image in local stoarage instead of firabase
AleVeraM Jan 24, 2023
a80bdeb
Fix url image
AleVeraM Jan 24, 2023
4f20166
Fix saveUserOffile
AleVeraM Jan 24, 2023
0def3f1
Merge branch 'issue/5482' of github.com:eduapp-project/eduapp into is…
AleVeraM Jan 26, 2023
434eebf
Fix "is repited" modal
AleVeraM Feb 1, 2023
b29a096
some .env changes
tcrurav Oct 14, 2022
e44f086
Add functionality related with calendar sessions
PdgarHern Jan 23, 2023
7327e72
Fix create groupchat
AleVeraM Feb 6, 2023
3e6a9a7
Fix errors fo create groupchat
AleVeraM Feb 6, 2023
aca5af0
Merge pull request #13 from eduapp-project/issue/5482
mianfiga Feb 6, 2023
539e03f
Merge pull request #16 from eduapp-project/fix/sessions
mianfiga Feb 6, 2023
04599f2
Add functionality related with calendar sessions
PdgarHern Jan 23, 2023
9c53011
Fix create groupchat
AleVeraM Feb 6, 2023
8603800
Complite rebase with development
AleVeraM Feb 7, 2023
20467cc
Merge pull request #15 from eduapp-project/issue/5494
mianfiga Feb 7, 2023
465cc7f
Merge pull request #17 from eduapp-project/develop
mianfiga Feb 7, 2023
4007ee3
added course_id to create on subject controller
mianfiga Feb 7, 2023
752be64
Merge pull request #19 from eduapp-project/hotfix/course_id_missing
mianfiga Feb 7, 2023
7973603
minor hotfixes
mianfiga Feb 8, 2023
8cbaf51
Merge pull request #18 from eduapp-project/hotfix/course_id_missing
mianfiga Mar 1, 2023
2af13ef
Merge pull request #23 from eduapp-project/develop
mianfiga Mar 1, 2023
4493ada
Add push notifications
AleVeraM Mar 1, 2023
5bb6c2e
minor hotfixes
mianfiga Feb 8, 2023
089fbd8
Add push notifications
AleVeraM Mar 1, 2023
45ea196
Merge branch 'issue/5555' of github.com:eduapp-project/eduapp into is…
AleVeraM Mar 1, 2023
051a1cf
Merge pull request #24 from eduapp-project/issue/5555
mianfiga Mar 1, 2023
9ab2d8f
Merge pull request #25 from eduapp-project/develop
mianfiga Mar 1, 2023
693a57c
fix: User profiles settings
PdgarHern Mar 2, 2023
a0dad61
fix: Add chat participants in enrollment
PdgarHern Mar 2, 2023
8640e67
fix: Group chat creation fails to create
PdgarHern Mar 2, 2023
2cf6144
fix: Double enrollment to chat
PdgarHern Mar 2, 2023
c37e92c
fix: ADMIN: deletion of subject chat fails
PdgarHern Mar 2, 2023
81c2143
fix: Resource subject list is empty
PdgarHern Mar 2, 2023
8f7e1a8
Better implementation of notifications
AleVeraM Mar 2, 2023
95bb7a9
Better implementation of notifications
AleVeraM Mar 2, 2023
f54b69e
Merge branch 'issue/5555' of github.com:eduapp-project/eduapp into is…
AleVeraM Mar 2, 2023
c840373
Merge pull request #27 from eduapp-project/issue/5555
mianfiga Mar 15, 2023
d65ccbf
Merge pull request #26 from eduapp-project/fixes
mianfiga Mar 15, 2023
b9f2230
Merge pull request #28 from eduapp-project/develop
mianfiga Mar 15, 2023
0678d34
FIX toolbar order
tcrurav Mar 24, 2023
72efe82
Merge pull request #29 from eduapp-project/develop
mianfiga Mar 24, 2023
bc69cc3
FIX progress bar
tcrurav Mar 29, 2023
8e86172
DEL material-ui
tcrurav Mar 30, 2023
438d714
Merge branch 'main' into feature/t03
tcrurav Mar 30, 2023
e46faa1
Merge pull request #30 from eduapp-project/feature/t03
tcrurav Mar 30, 2023
63e6ebd
Merge pull request #31 from eduapp-project/develop
tcrurav Mar 30, 2023
0c131e9
FIX add buttons to right side
tcrurav Mar 31, 2023
1bf4138
Create importer session from csv
AleVeraM Apr 4, 2023
573579d
Merge pull request #32 from eduapp-project/issue/5682
mianfiga Apr 4, 2023
bf716da
Merge pull request #33 from eduapp-project/develop
tcrurav Apr 4, 2023
fe9ba97
merge new Alejandro's commits
tcrurav Apr 4, 2023
8a7605b
Merge branch 'develop' into feature/t04
tcrurav Apr 4, 2023
caba983
Change external_id to string and change sessionsTemplate image
AleVeraM Apr 5, 2023
f668c97
Merge pull request #34 from eduapp-project/issue/change_externalid
tcrurav Apr 5, 2023
55f9df7
Fixing handleChange everywhere
tcrurav Apr 5, 2023
f213e98
Merge branch 'develop' into feature/t04
tcrurav Apr 5, 2023
20a0eb5
Fix chat when don't have teacher
AleVeraM Apr 5, 2023
03f80ae
Add case insensitive to search
AleVeraM Apr 5, 2023
a0772ed
FIX edit in sessions
tcrurav Apr 5, 2023
2f8a0ce
Merge pull request #36 from eduapp-project/issue/5718
tcrurav Apr 5, 2023
111f8ae
Merge pull request #35 from eduapp-project/issue/5683
tcrurav Apr 5, 2023
c0f92f6
Merge branch 'develop' into feature/t04
tcrurav Apr 5, 2023
e0cfd01
Merge pull request #37 from eduapp-project/feature/t04
tcrurav Apr 5, 2023
3964247
FIX edit related issues
tcrurav Apr 6, 2023
52d143c
Merge pull request #39 from eduapp-project/feature/t05
tcrurav Apr 6, 2023
4c3fbf8
Fixes to enrollSubjectsConfig and subjectsConfig
mianfiga Apr 6, 2023
e236af1
Merge pull request #41 from eduapp-project/ma01
mianfiga Apr 6, 2023
7bb3fae
Hide extrafields and edit from resources
mianfiga Apr 6, 2023
0ca0bc3
Merge pull request #42 from eduapp-project/ma01
mianfiga Apr 6, 2023
2570fe3
FIX frontend image
tcrurav Apr 6, 2023
8c29775
Merge branch 'develop' into feature/t06
tcrurav Apr 6, 2023
0aaa2e2
FIX Enrollment (Subjects)
tcrurav Apr 6, 2023
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
  •  
  •  
  •  
390 changes: 195 additions & 195 deletions Documentation/README.md
Original file line number Diff line number Diff line change
@@ -1,195 +1,195 @@
# Development Notes

- [Backend Structure](#backend-structure)
- [Frontend Structure](#frontend-structure)
- [Administration Structure](#administration-structure)

# Backend Structure

The main components we are going to dive in are:
- Controllers
- Extra Fields
- Filtration
- Encryption

## Controllers

Each table has a custom controller by which each have their own methods.
The main controller to look at is the Application Controller.

This controller contains all methods used for the Extra Fields as well as helper methods for other controllers to deny or permit accesd to users and paginate extra fields.

These are explicitly documented inside the code to make it easy to find and follow.

An example of what you can find in the Application Controller:

```ruby
# UTILS

# Returns a ```UserRole``` entry for the currently existing admin role.
def get_admin_role
return UserRole.where(name: "eduapp-admin").first
end

# Returns the user's respective ```UserRole``` information.
def get_user_roles(user_id = @current_user)
return UserRole.find(UserInfo.where(user_id: user_id).first.user_role_id)
end

# Serializes each element in an array.
def serialize_each(array, iExcept = [], iInclude = [])
s = []
array.each do |item|
s.push(item.serializable_hash(except: iExcept, include: iInclude))
end
return s
end

# Paginates an ```ActiveRecord``` query.
def query_paginate(query, page, limit = 10)
page = Integer(page)
if page - 1 < 0
return { :error => "Page cannot be less than 1" }
end
return { :current_page => query.limit(limit).offset((page - 1) * limit), :total_pages => (query.count.to_f / limit).ceil, :page => page }
end

# Paginates an array.
def array_paginate(array, page, limit = 10)
return array.slice(Integer(page) > 0 ? Integer(page) - 1 : 0, limit)
end

# A parser made to correctly return a decoded order filter.
def parse_filter_order(order)
order = JSON.parse(Base64.decode64(order))
return { order["field"] => order["order"] == "asc" ? :asc : :desc }
end
```

## Extra Fields

Extra fields are made to provide access to custom information each Institution needs. Examples of this can be student debts, detention counts and custom notes.

The tables elegible for extra fields are Users, Courses, Sessions, Institutions, Resources and Subjects.

Helper methods for these are located as well in the Application Controller.

## Filtration

Each controller has it's own way of filtrating. Every controller follows a pattern:

- Check if any extra fields exists and try to filter by that
- If there's any filtered extra fields, filter with that by the other main fields, if not, filter by any value in the database.
- Order by ascending if no order is specified
- Return the first page if not page of information is specified

## Encryption

EduApp has it's own encryption utility inside ```lib/edu_app_utils/encrypt_utils.rb```.

Here, you will find different methods used to encrypt and decrypt messages for the messaging part of EduApp.

# Frontend Structure

The main topics we will cover about how the frontend works:
- It's PWA
- How we save information offline
- It's different utilities
- Custom hooks

## The PWA

The PWA has two main components necessary:
- ```service-worker.js```
- ```serviceWorkerRegistration.js```

These two components are necessary for registering the Service Worker to the browser so that it works correctly.

This all depends on WorkBox to register and save to browser cache the compiled assets necessary to run the app.

To save the user's important information for offline use, we use the ```OfflineManager.js``` utility. This helps us saving and updating any information when needed so that we have always the most updated user information at all types.

## Utilities

The different types of utilities we use are:
- ```OfflineManager```
- ```IDBManager```
- ```MediaFixer```
- ```FirebaseStorage```
- ```UrlPrefixer```
- ActionCable websockets

### OfflineManager

The offline manager contains various functions used to save and load information for further use when in offline mode.

The workflow used is to always store information offline when received from the API, and if the information is different then save it, if not there's no need to save it.

```getOfflineUser()``` is the main function you will want to use for accessing a user's information online or offline. It all depends on the information in it.

### IDBManager

The IDBManager uses a library @jakearchibald called ```idb-keyval``` which converts all IndexedDB functions into asynchronous, for ease of use.

The class contains methods used as a Singleton to load a store and make transactions.

### MediaFixer

MediaFixer is a small function used to correct files from Rails ActiveStorage from not displaying the correct URL. It changes the ```localhost:3000``` domain that ActiveStorage sets to the back domain passed inside the ```.env``` file.

### FirebaseStorage

This is used to upload any files used to a Firebase Storage bucket in case ActiveStorage fails. As of now, only profile images are uploaded to Firebase.

### UrlPrefixer

This is used in case you change your domains base name to a new mount point.

Example: default - eduapp.com
Changed basename: eduapp.com/app

This functions converts all urls passed to use the new basename you specify. This was previously used for ease of use, but it's not necessary anymore.

### ActionCable Websockets

Rails ActionCable needs a special JS library from the same developers to connect to each other.

To provide an easy interface, we created a class called ```ACManager``` which is an abstract class used to create new Websocket classes to manage the different websocket channels in the backend.


# Administration Structure

The main topics we will cover:

- Initialization of the administration panel and database
- Login
- Components

## Initialization

When creating and intializing the backend, frontend and administration for the first time, you will be prompted to create a new administrator user. Once done, you may login with your new administration account.

Once in, you will only be able to see to sections:
- Institutions
- User Permissions/Roles

To unlock the other administrative sections, you must first create your an Institution. Once created, you may access the other sections to setup your educational environment.

## Login

Only users who have an ```admin-query``` or ```admin``` role are able to have access to the web app by default. You may change this inside the authentication service inside ```services```.

## Components

The administration panel constitutes of one main parent view with rotating child components. This means that ControlPanel is the parent view that never changes, and the only components that change are the inside/body of the main page.

Each component behaves differently since they all manage different sets of data according to their table, but they share common features:
- Creation
- Deletion
- Updates
- Filtration
- Extra Fields
- Extra Fields Filtration
- Order By

Chat messages are not displayed to manage to keep the users privacy safe.
# Development Notes
- [Backend Structure](#backend-structure)
- [Frontend Structure](#frontend-structure)
- [Administration Structure](#administration-structure)
# Backend Structure
The main components we are going to dive in are:
- Controllers
- Extra Fields
- Filtration
- Encryption
## Controllers
Each table has a custom controller by which each have their own methods.
The main controller to look at is the Application Controller.
This controller contains all methods used for the Extra Fields as well as helper methods for other controllers to deny or permit accesd to users and paginate extra fields.
These are explicitly documented inside the code to make it easy to find and follow.
An example of what you can find in the Application Controller:
```ruby
# UTILS
# Returns a ```UserRole``` entry for the currently existing admin role.
def get_admin_role
return UserRole.where(name: "eduapp-admin").first
end
# Returns the user's respective ```UserRole``` information.
def get_user_roles(user_id = @current_user)
return UserRole.find(UserInfo.where(user_id: user_id).first.user_role_id)
end
# Serializes each element in an array.
def serialize_each(array, iExcept = [], iInclude = [])
s = []
array.each do |item|
s.push(item.serializable_hash(except: iExcept, include: iInclude))
end
return s
end
# Paginates an ```ActiveRecord``` query.
def query_paginate(query, page, limit = 10)
page = Integer(page)
if page - 1 < 0
return { :error => "Page cannot be less than 1" }
end
return { :current_page => query.limit(limit).offset((page - 1) * limit), :total_pages => (query.count.to_f / limit).ceil, :page => page }
end
# Paginates an array.
def array_paginate(array, page, limit = 10)
return array.slice(Integer(page) > 0 ? Integer(page) - 1 : 0, limit)
end
# A parser made to correctly return a decoded order filter.
def parse_filter_order(order)
order = JSON.parse(Base64.decode64(order))
return { order["field"] => order["order"] == "asc" ? :asc : :desc }
end
```
## Extra Fields
Extra fields are made to provide access to custom information each Institution needs. Examples of this can be student debts, detention counts and custom notes.
The tables elegible for extra fields are Users, Courses, Sessions, Institutions, Resources and Subjects.
Helper methods for these are located as well in the Application Controller.
## Filtration
Each controller has it's own way of filtrating. Every controller follows a pattern:
- Check if any extra fields exists and try to filter by that
- If there's any filtered extra fields, filter with that by the other main fields, if not, filter by any value in the database.
- Order by ascending if no order is specified
- Return the first page if not page of information is specified
## Encryption
EduApp has it's own encryption utility inside ```lib/edu_app_utils/encrypt_utils.rb```.
Here, you will find different methods used to encrypt and decrypt messages for the messaging part of EduApp.
# Frontend Structure
The main topics we will cover about how the frontend works:
- It's PWA
- How we save information offline
- It's different utilities
- Custom hooks
## The PWA
The PWA has two main components necessary:
- ```service-worker.js```
- ```serviceWorkerRegistration.js```
These two components are necessary for registering the Service Worker to the browser so that it works correctly.
This all depends on WorkBox to register and save to browser cache the compiled assets necessary to run the app.
To save the user's important information for offline use, we use the ```OfflineManager.js``` utility. This helps us saving and updating any information when needed so that we have always the most updated user information at all types.
## Utilities
The different types of utilities we use are:
- ```OfflineManager```
- ```IDBManager```
- ```MediaFixer```
- ```FirebaseStorage```
- ```UrlPrefixer```
- ActionCable websockets
### OfflineManager
The offline manager contains various functions used to save and load information for further use when in offline mode.
The workflow used is to always store information offline when received from the API, and if the information is different then save it, if not there's no need to save it.
```getOfflineUser()``` is the main function you will want to use for accessing a user's information online or offline. It all depends on the information in it.
### IDBManager
The IDBManager uses a library @jakearchibald called ```idb-keyval``` which converts all IndexedDB functions into asynchronous, for ease of use.
The class contains methods used as a Singleton to load a store and make transactions.
### MediaFixer
MediaFixer is a small function used to correct files from Rails ActiveStorage from not displaying the correct URL. It changes the ```localhost:3000``` domain that ActiveStorage sets to the back domain passed inside the ```.env``` file.
### FirebaseStorage
This is used to upload any files used to a Firebase Storage bucket in case ActiveStorage fails. As of now, only profile images are uploaded to Firebase.
### UrlPrefixer
This is used in case you change your domains base name to a new mount point.
Example: default - eduapp.com
Changed basename: eduapp.com/app
This functions converts all urls passed to use the new basename you specify. This was previously used for ease of use, but it's not necessary anymore.
### ActionCable Websockets
Rails ActionCable needs a special JS library from the same developers to connect to each other.
To provide an easy interface, we created a class called ```ACManager``` which is an abstract class used to create new Websocket classes to manage the different websocket channels in the backend.
# Administration Structure
The main topics we will cover:
- Initialization of the administration panel and database
- Login
- Components
## Initialization
When creating and intializing the backend, frontend and administration for the first time, you will be prompted to create a new administrator user. Once done, you may login with your new administration account.
Once in, you will only be able to see to sections:
- Institutions
- User Permissions/Roles
To unlock the other administrative sections, you must first create your an Institution. Once created, you may access the other sections to setup your educational environment.
## Login
Only users who have an ```admin-query``` or ```admin``` role are able to have access to the web app by default. You may change this inside the authentication service inside ```services```.
## Components
The administration panel constitutes of one main parent view with rotating child components. This means that ControlPanel is the parent view that never changes, and the only components that change are the inside/body of the main page.
Each component behaves differently since they all manage different sets of data according to their table, but they share common features:
- Creation
- Deletion
- Updates
- Filtration
- Extra Fields
- Extra Fields Filtration
- Order By
Chat messages are not displayed to manage to keep the users privacy safe.
Loading