Skip to content

Archived-Daily-Dev-Notes




2023-12-22

Today’s Goals
Profile Setup Screens


Get the name and email address to prefill from QS on this form:

Setup the in the AWS emails we can send to

why isn’t invite_accepted_date being set on the session rec
contacts.invited_by
entered when they submit on invite
Setup the Postman test for the Invite_Accept
test with existing one and be able to reset the acceptance_date
Test passing the session_id and session_token as QS Params for Expo
console.log()
Config.is_sessions_multi_allow
so we can stay signed in

2023-12-20

Today’s Goals
-Accept Invite Screen



Create Test API Point for RecSaver to Create Contact Rec
uses new Table()
via the key
Create the Fields recs on the table
uses key and “Value”
Test Postman that RecSaver still works properly
Invite Email
has to use the “key” querystring
first test by setting up the screen and accessing manually
Accept Invite Screen
Enters Full-Name & password
Text
Thank you for accepting your invite! Please enter a password to create your account. Afterwards, you will be directed to the Login screen to login using your email address and password.
API endpoint
Creates the User Account
#later
shows the email address that they are using

#later
Has to track “invite opened” to know if they opened it but didn’t go through the password setup
so add sessions.invite_opened_datetime
#later
When opening, we have to validate the request initially
so we don’t show the option to enter a password
so we do double validation
#later


2023-12-17

Today’s Goal:
Invite Tab

We need a API endpoint that we can test to see what are the cookies that we are getting back
Setup a test page to get the User Current Object
/api/user/current
To see if the Cookies are still an issue ​
Login has to set the session_key cookie and we have to submit this with our axios
Try to send the cookie manually instead of dealing with HTTPS
OR try to setup HTTPS
Invite Tab
Email Address *
Name
High-Trust checkbox
Change the /invite_create route to be able to accept the POST JSON data

Give me the complete code following all of the best practices for an "Invite" screen, where the user enters an email address (required), the Name (required) and a checkbox for "High-Trust" (optional) on a single form. These fields are then submitted in JSON via axios POST to /api/invite and then a message displayed for "Thank you inviting {{Name}} ({{email address}}) The form is reset to blank with a message for “Invite Another Person”

Forms should have a max-width defined when not on mobile or even on mobile (like a tablet) they should have a max-width to not seem stretched out.




2023-12-16

Today’s Goal:
Setup the Login screen with error handling
store the session cookie in the secure storage so its persistent
have the app automatically open to the home screen
and redirect to the Login screen if no valid session
Setup the Invite Form


Hamburger Menu Setup for the Logout and other settings
Do we switch to Another UI Lib
Setup the UseStorageStateForObject
to save the user to it and retrieve in AuthProvider
like in ctx.tsx
Test that we can store and retrieve the User object from that storage
Setup the useEffect() to check for the Valid Session upon load
So need to check if the User’s sessions is still valid

We need to have a user object that contains
a session-token
a sesion_exp var
So tweak the Login API to return it all as one object instead { "is_success": true, "id": 1, "name": "Dmitri Sunshine", "is_admin": true, "session_id": 10086, "session_key": "52BB6BFE94FD77B1F0353013139CCC390C91AC73E205F9E171CF74E0823515C2", "session_expires_at": null }


Use console.log to test whether the _layout.tsx is being cascaded
I believe it is
Setup the Not-Found Screen
with the tracking for where they came from and where they were clicking on <Stack.Screen name="NotFound" component={NotFoundScreen} options={{ title: 'Oops!' }} />

Understand how the Expo Tabs an Expo Tabs.Screen work

User Type Class for what is returned from the /user/current or upon login
see the “spa” for how was setup there




2023-12-14

Wrap my head around Expo-Router
TOS and Privacy Policy ready for app
Test Setting up the a brand new SDK 50 project with tabs
npx create-expo-app@next expo_test_tabs --template tabs@next
or upgrading the existing one
Set the cookie expiration to really long, like 30 days for the mobile app
Config option for is_sessions_multi
so that they can stay logged in on the web and on their mobile



Help me write the code for an Expo app that will be used on Web, iOS and Android.
The app is invite-only and user’s must be logged in to view any screen except the “accept-invite” screen, so when a user who hasn’t logged in yet (or whose session has expired) then we send them to the login screen with the email address and password inputs and checkbox for “Remember Me” which automatically checked.
Upon app start, we check if the user has a valid session via the API endpoint of “/api/user/current” which should return a JSON object for the User object (with an id) which we store in the global state using Recoil. If there isn’t an object returned with an “id”, then we redirect them to them to the Login screen/component (using Expo router).
The app has several tabs at the bottom.
For now we will just have the “Profile”, “Search” and “Invite” Tabs.
Make sure that the code will pass a review by a senior React developer and it follows all of the best practices.
Here are more specs:
* Use Typescript (instead of Javascript) for the React part * We are using Expo Managed Workflow to create an iOS, Android AND Web app at the same time * Using the Expo Router instead of React Navigation * "React Native Paper" is our UI Library * Provide excellent error/validation handling for all form fields * Provide the complete code so that I can just copy and paste it without having to make any changes or fill in any placeholders. * Provide the file names and the suggested directory (like components, configs, etc...) for all of the code files you generate for me as a comment at the top of them * We want to provide a smooth user experience so use splash screens and loading indicators * We want to prevent double-submission so after the error handling is performed on a form (but before we send the data off) we want to disable the button/link and show that it is sending, by changing the button text and/or showing a loading indicator - whatever is the best practice * Using Axios for Http Request * Using Recoil for State Management instead of the React useState



2023-12-01

like tags (& tags table setup)
so have top-level and table-specific (multi-rec) so one tag can be used on multiple tables

2023-11-30

For sending the email templates, we need a quick & dirty way to just pass in the exact column names that we are using, instead of creating “views” and setting them up with the fields.
We could still
Setup the Tables & Fields
volunteer_history
Org/Project History/Affiliations Table Setup
relationships
Setup the Invite and Create Account/Profile Pages



2023-11-29

Expo State Management and Storage
? Which db provider do we use with watermelon for the Web app?
Session-Management
If our API uses a simple session-key cookie as the mechanism, how could we make this work with React Native (and Expo managed)?
Go through the Expo Tutorial

Want to print your doc?
This is not the way.
Try clicking the ··· in the right corner or using a keyboard shortcut (
CtrlP
) instead.