Lynx 0.0.1 #1

Merged
Azea_Avenbright merged 40 commits from Code-Clean-Sweep into master 2025-10-25 11:40:24 -06:00

Lynx 0.0.1

Lynx is a KMP project design to help users safely and effectively manage a home arsenal.
Lynx-Client is an android application for interfacing with a Lynx-Server Instance.
Lynx-Server is available for Windows/OSX/Linux and provides a database and the core logic of Lynx. Currently, Lynx-Server is not configurable by the user, but can easily be built from scratch.
Lynx-Shared provides a common API for interfacing between client and server.

Lynx-Client

Build Env

.gitignore

  • Added standard KMP project files to gitignore

build.gradle.kts

  • Added KTOR library dependencies for server <-> client communication
    • Websockets is our workaround for not using Firebase to handle notifications

AndroidManifest.xml

  • FOREGROUND_SERVICE : For showing persistent notifications
    • DATA_SYNC : declaration of intent for why we need a foreground service
  • POST_NOTIFICATIONS : This is what allows us to actually display notifications to the user
  • INTERNET : To connect to the server

Lynx-Client

The Following Files have been added or updated:

App.kt

  • Replaced starter content with call to NavGraph (Splash Screen or Server Offline depending on ping result)
  • Added Menagerie Green Themeing to application

AppSignals.kt (NEW)

  • This is what holds our persistent notification system together

MainActivity.kt

  • Generally sends users to the splash and then login screens, but may send them straight to the inventory screen to accept a new invitation

Services

NotificationService.kt (NEW)

  • Our Web Socket service for listening to notifications
  • Currently only handles Arsenal Invitations, but will eventually be where all system notifications are sorted and displayed to the user.

UI-Components

AddableDropdownMenu (NEW)

  • A custom dropdown menu with "Add New..." for any database field that is a reference to another table, to allow users to create new Calibers, Manufacturers, Projectile Types, etc. while creating Ammo Types / Hardware that uses them

DialogComponents.kt (NEW)

  • A quick reusable Cancel/Add button pair

Navigation

NavGraph.kt (NEW)

  • Standard Kotlin navigation system for moving between screens

Routes.kt (NEW)

  • Constants file for rout names and args

Screens

CreateAccountScreen.kt + ViewModel (NEW)

  • Screen and viewModel for registering a new user.
  • Accepts username and password from login screen if a new user fills those in before clicking create account
  • Allows users to draw an instance of their digital signature for use in app, stored as ByteArray data

EventScreen.kt (NEW)

  • Placeholder for events calendar and TODOs

Add Caliber/Manufacturer/ProjectileTypeDialog.kt (NEW)

  • very generic boxes that I have a ticket to condense down into one composable that updates a different field rather than so many little composables. Fills in those fields that are later used as dropdown options

AmmoTypeDialog.kt (NEW)

  • a Popup dialog for adding a new AmmoType, including Caliber, Projectile Type such as Full Metal, the grain weight and how many rounds are in a box (you'll want a new AmmoType object for the same round in a different box count.

CreateARsenalDialog.kt (NEW)

  • Same as AddCaliberDialog.kt

InventoryScreen.kt + ViewModel + ViewModelUtils (NEW)

  • The main screen for displaying arsenals, yours and those you are a member of.
  • for now invites to arsenals are displayed here, will be moved to top-bar once added

PendingInvitations.kt (NEW)

  • Composable to accept an invite to an arsenal
  • need to add way to reject invites

AddRoundsDialog.kt (NEW)

  • Composable for selecting an AmmoType and adding boxes and loose rounds to your arsenal

ArsenalDetailsScreen.kt + ViewModel (NEW)

  • Composable and viewModel for handling an arsenal. includes Hardware, Ammo, and the ability for the owner to invite other members.

InviteUserDialog.kt (NEW)

  • Invites a User to an Arsenal (Owners Only)

AddHardwareDialog.kt + ViewModel (NEW)

  • Dialog for adding a new piece of hardware. For now this is tailored towards traditional firearms, with plans to support Propellant Driven (Airsoft/Paintball/Less-Than-Lethals)

AmmunitionViewModel.kt (NEW)

  • ViewModel for handling adding rounds to an arsenal
  • currently no way to spend rounds

AmmunitionList.kt (NEW)

  • Composable to view rounds in an arsenal

ArsenalDetails' FabContent.kt (NEW)

  • Composable holding the Float Action Button and its content for the details screen

HardwareList.kt (NEW)

  • Composable to view hardware in an arsenal

LoginScreen.kt + ViewModel (NEW)

  • Composable and viewModel to login an existing user.
  • Can pass username and password to createAccount screen

MainScreen.kt (NEW)

  • Composable holding links to the three main views of Lynx : Inventory, Users, and Events
  • Also includes a means to logout of Lynx

MainViewModel.kt (NEW)

  • Handles ensuring we get a hello from the Lynx Server.

ServerOfflineScreen.kt (NEW)

  • Users are redirected here if they open the app and can't connect to a Lynx Server instance.

SplashScreen.kt + ViewModel (NEW)

  • Composable and viewModel for checking login
    • users with valid auth tokens are sent directly to MainScreen.
    • users without a token are sent to Login
    • clients that can't connect to a server instance display the Server Offline screen.

UserScreen.kt + ViewModel (NEW)

  • Composable and View Model showing a list of all users on a server by display name only

UserProfileScreen.kt + ViewModel (NEW)

  • Composable and viewModel showing details about a specific user

Theme

  • Added Menagerie Green color theme

uistate

UserState.kt (NEW)

  • really this could / should go in the UserViewModel, I added a Trello card.

Util

Incrementer.kt (NEW)

  • Composable to change a number value. Users can tap/long press to update the value, or type it in manually

Main/Res/XML

network_security_config.xml (NEW)

  • workaround to allow cleartext traffic to the server

Gradle

libs.versions.toml

  • version updates and adding ktor dependencies

Lynx-Server

build.gradle.kts

  • added KTOR server side dependencies

Main

Application.kt

  • added websocket for notifications
  • set up POST/GET/etc routing

Database.kt

  • broke up credentials and content databases
  • using Flyway for sql migration handling
  • Start of a system for alerting active clients to possibly recompose, as data on the server had been updated

Routes

ArsenalRoutes.kt (NEW)

  • Main routing system for handling anything to do with an arsenal / inventory

MiscRoutes.kt (NEW)

  • Routes for calibers, manu, projectileType, and also tracking health
  • may move these around

UserRoutes.kt (NEW)

  • Routing system for user management and display

Tables

AmmoInventory, AmmoType.kt

  • KDOC comments

ArsenalInvitations.kt (NEW)

  • Holds pending invites until a user accepts them

ArsenalMemberships.kt (NEW)

  • Holds the owner and non-owner members of an arsenal. This is crucial for only displaying and working with equipment you have access to.

Arsenals.kt (NEW)

  • An Arsenal is an inventory of equipment in a specific location. It has a single owner, and as many members as you want.

Caliber, Hardware.kt

  • KDOC comments

Manufacturer.kt (NEW)

  • Moved Manu to its own table so it can be saved and reused easily.

ProjectileType, Users.kt

  • KDOC comments

Resources

application.conf

  • ktor config document, will update later

Migrations

  • several migration files during testing. when we move to 1.0.0 I plan on condensing all these back down and using the final migration result as our base version, effectively erasing all of these from 0.0.0a to release.

Lynx-Shared

Gradle

  • added shared ktor dependencies

Main

TokenStorage.kt (NEW)

  • handles auth tokens so users don't have to log in constantly

API

ApiClient.kt (NEW)

  • Main API pipe. currently handles ALL communication between client and server.
  • considering breaking up

ApiException.kt (NEW)

  • Handling for specific errors so we display a better message than the blob it naturally returns

Cache

UserCache.kt (NEW)

  • Caches users online to limit calls

Responses

  • Various responses to requests for data on the server

Requests

  • various requests for data on the server from the clients
# Lynx 0.0.1 Lynx is a KMP project design to help users safely and effectively manage a home arsenal. Lynx-Client is an android application for interfacing with a Lynx-Server Instance. Lynx-Server is available for Windows/OSX/Linux and provides a database and the core logic of Lynx. Currently, Lynx-Server is not configurable by the user, but can easily be built from scratch. Lynx-Shared provides a common API for interfacing between client and server. # Lynx-Client ## Build Env #### .gitignore - Added standard KMP project files to gitignore #### build.gradle.kts - Added KTOR library dependencies for server <-> client communication - Websockets is our workaround for not using Firebase to handle notifications #### AndroidManifest.xml - FOREGROUND_SERVICE : For showing persistent notifications - DATA_SYNC : declaration of intent for why we need a foreground service - POST_NOTIFICATIONS : This is what allows us to actually display notifications to the user - INTERNET : To connect to the server ## Lynx-Client The Following Files have been added or updated: #### App.kt - Replaced starter content with call to NavGraph (Splash Screen or Server Offline depending on ping result) - Added Menagerie Green Themeing to application #### AppSignals.kt (NEW) - This is what holds our persistent notification system together #### MainActivity.kt - Generally sends users to the splash and then login screens, but may send them straight to the inventory screen to accept a new invitation ### Services #### NotificationService.kt (NEW) - Our Web Socket service for listening to notifications - Currently only handles Arsenal Invitations, but will eventually be where all system notifications are sorted and displayed to the user. ### UI-Components #### AddableDropdownMenu (NEW) - A custom dropdown menu with "Add New..." for any database field that is a reference to another table, to allow users to create new Calibers, Manufacturers, Projectile Types, etc. while creating Ammo Types / Hardware that uses them #### DialogComponents.kt (NEW) - A quick reusable Cancel/Add button pair ### Navigation #### NavGraph.kt (NEW) - Standard Kotlin navigation system for moving between screens #### Routes.kt (NEW) - Constants file for rout names and args ### Screens #### CreateAccountScreen.kt + ViewModel (NEW) - Screen and viewModel for registering a new user. - Accepts username and password from login screen if a new user fills those in before clicking create account - Allows users to draw an instance of their digital signature for use in app, stored as ByteArray data #### EventScreen.kt (NEW) - Placeholder for events calendar and TODOs #### Add Caliber/Manufacturer/ProjectileTypeDialog.kt (NEW) - very generic boxes that I have a ticket to condense down into one composable that updates a different field rather than so many little composables. Fills in those fields that are later used as dropdown options #### AmmoTypeDialog.kt (NEW) - a Popup dialog for adding a new AmmoType, including Caliber, Projectile Type such as Full Metal, the grain weight and how many rounds are in a box (you'll want a new AmmoType object for the same round in a different box count. #### CreateARsenalDialog.kt (NEW) - Same as AddCaliberDialog.kt #### InventoryScreen.kt + ViewModel + ViewModelUtils (NEW) - The main screen for displaying arsenals, yours and those you are a member of. - for now invites to arsenals are displayed here, will be moved to top-bar once added #### PendingInvitations.kt (NEW) - Composable to accept an invite to an arsenal - need to add way to reject invites #### AddRoundsDialog.kt (NEW) - Composable for selecting an AmmoType and adding boxes and loose rounds to your arsenal #### ArsenalDetailsScreen.kt + ViewModel (NEW) - Composable and viewModel for handling an arsenal. includes Hardware, Ammo, and the ability for the owner to invite other members. #### InviteUserDialog.kt (NEW) - Invites a User to an Arsenal (Owners Only) #### AddHardwareDialog.kt + ViewModel (NEW) - Dialog for adding a new piece of hardware. For now this is tailored towards traditional firearms, with plans to support Propellant Driven (Airsoft/Paintball/Less-Than-Lethals) #### AmmunitionViewModel.kt (NEW) - ViewModel for handling adding rounds to an arsenal - currently no way to spend rounds #### AmmunitionList.kt (NEW) - Composable to view rounds in an arsenal #### ArsenalDetails' FabContent.kt (NEW) - Composable holding the Float Action Button and its content for the details screen #### HardwareList.kt (NEW) - Composable to view hardware in an arsenal #### LoginScreen.kt + ViewModel (NEW) - Composable and viewModel to login an existing user. - Can pass username and password to createAccount screen #### MainScreen.kt (NEW) - Composable holding links to the three main views of Lynx : Inventory, Users, and Events - Also includes a means to logout of Lynx #### MainViewModel.kt (NEW) - Handles ensuring we get a hello from the Lynx Server. #### ServerOfflineScreen.kt (NEW) - Users are redirected here if they open the app and can't connect to a Lynx Server instance. #### SplashScreen.kt + ViewModel (NEW) - Composable and viewModel for checking login - users with valid auth tokens are sent directly to MainScreen. - users without a token are sent to Login - clients that can't connect to a server instance display the Server Offline screen. #### UserScreen.kt + ViewModel (NEW) - Composable and View Model showing a list of all users on a server by display name only #### UserProfileScreen.kt + ViewModel (NEW) - Composable and viewModel showing details about a specific user ### Theme - Added Menagerie Green color theme ### uistate #### UserState.kt (NEW) - really this could / should go in the UserViewModel, I added a Trello card. ### Util #### Incrementer.kt (NEW) - Composable to change a number value. Users can tap/long press to update the value, or type it in manually ## Main/Res/XML #### network_security_config.xml (NEW) - workaround to allow cleartext traffic to the server # Gradle #### libs.versions.toml - version updates and adding ktor dependencies # Lynx-Server ## build.gradle.kts - added KTOR server side dependencies ### Main #### Application.kt - added websocket for notifications - set up POST/GET/etc routing #### Database.kt - broke up credentials and content databases - using Flyway for sql migration handling - Start of a system for alerting active clients to possibly recompose, as data on the server had been updated ### Routes #### ArsenalRoutes.kt (NEW) - Main routing system for handling anything to do with an arsenal / inventory #### MiscRoutes.kt (NEW) - Routes for calibers, manu, projectileType, and also tracking health - may move these around #### UserRoutes.kt (NEW) - Routing system for user management and display ### Tables #### AmmoInventory, AmmoType.kt - KDOC comments #### ArsenalInvitations.kt (NEW) - Holds pending invites until a user accepts them #### ArsenalMemberships.kt (NEW) - Holds the owner and non-owner members of an arsenal. This is crucial for only displaying and working with equipment you have access to. #### Arsenals.kt (NEW) - An Arsenal is an inventory of equipment in a specific location. It has a single owner, and as many members as you want. #### Caliber, Hardware.kt - KDOC comments #### Manufacturer.kt (NEW) - Moved Manu to its own table so it can be saved and reused easily. #### ProjectileType, Users.kt - KDOC comments ### Resources #### application.conf - ktor config document, will update later ### Migrations - several migration files during testing. when we move to 1.0.0 I plan on condensing all these back down and using the final migration result as our base version, effectively erasing all of these from 0.0.0a to release. # Lynx-Shared ### Gradle - added shared ktor dependencies ### Main #### TokenStorage.kt (NEW) - handles auth tokens so users don't have to log in constantly ### API #### ApiClient.kt (NEW) - Main API pipe. currently handles ALL communication between client and server. - considering breaking up #### ApiException.kt (NEW) - Handling for specific errors so we display a better message than the blob it naturally returns ### Cache #### UserCache.kt (NEW) - Caches users online to limit calls ### Responses - Various responses to requests for data on the server ### Requests - various requests for data on the server from the clients
Azea_Avenbright changed title from WIP: Lynx 0.0.1 to Lynx 0.0.1 2025-10-24 13:15:54 -06:00
Azea_Avenbright changed title from Lynx 0.0.1 to WIP: Lynx 0.0.1 2025-10-24 13:26:30 -06:00
Azea_Avenbright changed title from WIP: Lynx 0.0.1 to Lynx 0.0.1 2025-10-24 14:26:32 -06:00
@ -0,0 +1,8 @@
package org.menagerie.lynx.ui.navigation
object Routes {

Rename file to include Filename.constants.kt, to make it clearer this file is just a constants file.

Rename file to include `Filename.constants.kt`, to make it clearer this file is just a constants file.

Single folder for response classes?

Alternatively, single file containing request and response.

Single folder for response classes? Alternatively, single file containing request and response.

ArsenalID should also be non-incremental

ArsenalID should also be non-incremental

JWT Secret gen:

tr -dc 'A-Za-z0-9!"#$%&'\''()*+,-./:;<=>?@[\]^_`{|}~' </dev/urandom | head -c 26; echo
JWT Secret gen: ```bash tr -dc 'A-Za-z0-9!"#$%&'\''()*+,-./:;<=>?@[\]^_`{|}~' </dev/urandom | head -c 26; echo ```
blizzardfinnegan left a comment
Owner

aside from previous comments, lgtm

aside from previous comments, lgtm
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Menagerie/Lynx!1
No description provided.