Skip to content

Commit

Permalink
Design backend
Browse files Browse the repository at this point in the history
  • Loading branch information
SekoiaTree committed Jun 7, 2024
1 parent a2c9b81 commit 11143e9
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions template/9-design.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
*How is it shared/copied/cached?*
*How is the application developed, tested and deployed?*
*Any special infrastructure requirements.*
*How is the application developed, tested and deployed?*
*Any special infrastructure requirements.*


### Frontend
Expand All @@ -30,29 +28,34 @@
### Backend

#### Functional Blocks
- **User Management:**
- **Event Handling:**
- **Treasury Handling:**
- **Authentication** is managed by Supabase's extensive authentication flow
- **Treasury** is handled via Supabase's databases (postgres), and Storage, for images
- **Events** are handled via a few tables in Postgres
- **Profile and association management** are also handled in Postgres and Supabase Storage
- **Maps** are handled by EPFL's map servers and OpenStreetMap

### Data Model

#### Data Collection/Management
- **User Data:**
- **Event Data:**
- **User Data:** We store the user's display name. It is easy to change, and owned by the user. No other data is externally visible, but some login information is kept.
- **Association Data:** The data related to an association is all stored within Supabase. This includes events, members, receipts, and other treasury information. It can be protected via row-level security.


#### Organization and Storage
- **Database:**
- **Data Organization:**
- **Database:** All non-image data is stored within databases linked together via foreign keys.
- **Data Organization:** All images are stored in a filesystem-like structure with folders.

#### Sharing, Copying, and Caching
- **Data Sharing:**
- **Caching Strategy:**
- **Data Sharing:** The data is only transferred between the server and the client, never between clients or externally. As such.
- **Caching Strategy:** Caching is done by storing portions of the database locally, updated with our code, and refreshed upon the user's request. Upon app reload, the cache is not kept. Images are cached with a lifetime and are stored in a cache folder provided by Android. The cache has a maximum size.

The backend can also easily be extended to include indices on the databases, further increasing speed.

### Security Considerations
All communication is done via HTTPS. Row-level security will be added to all tables (they were designed with security in mind), meaning data is protected from authenticated but unauthorized access.

#### Infrastructure and Deployment

The application's backend is on Supabase, which can be self-hosted in its entirety. By default it will be hosted on supabase.com, but it is easy to move over to self-hosted hardware, if desired.

### Test Plan

Expand Down

0 comments on commit 11143e9

Please sign in to comment.