Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restructure to single deploy #26

Merged
merged 37 commits into from
Jul 10, 2022
Merged

Restructure to single deploy #26

merged 37 commits into from
Jul 10, 2022

Conversation

burtonr
Copy link
Owner

@burtonr burtonr commented Jul 10, 2022

Serve the React App from Node.JS Express to allow for a single deployment.

Recreate the React App without the "create-react-app" template to remove the built-in "magic" that comes with it.

Adjust server endpoints so they are expected (all dash endpoints in one place, auth in one place, etc)

App.js controls the screen layout and site-wide state passed down to child components

burtonr added 30 commits June 1, 2022 21:45
Use root src as client code
server as the API
public as the bundled React App that is then delivered by ExpressJS
This will simplify the process of deploying and accessing the app as
a whole. Also removing the create-react packages and scripts that were
never used.
Using the role name in the login return object will simplify the
frontend logic and ensure repeatability on new DB servers where the
id is regenerated.
Bug in the dash  post due to forgotten require statement
Commented out a majority of the App and NavBar in order
to prevent errors causing React to not render properly.
This is only a first step in redesigning the client code
to align with the restructuring. WIP
This allows the main page state to be maintained centrally
while the functions and state are passed down to the components
manageMode is sourced at the App level. Potential for introducing Redux to avoid
the through-passing past itemGrid
It was getting confusing and difficult to manage various forms of state
in a single dialog. Created a new Add dialog to handle creating items only.
Cleaned up some commented code and unused imports.
Still a console log there, but less text for now
Still work to do for handling messages and errors
Items API call was being cached when calling update. Added an additional function
that specifically sets the Cache-Control header to ensure fresh data always.
Added prop to item list for handling errors at the top level App. This will need

to be turned into a global service/component soon.
An undefined error popped up, so added an additional check in the error handler
just in case for now
This branch needs to focus on restructure, not new features
Exclude dotenv from code as this is expected to run as a container
using environments in a container is expected over a file. Locally,
setting the environment via file is easier.
Added additional npm script to run the server without the dotenv flag
when running as a deployed application/container
Previously, npm watch only for changes to frontend
Initialize the authentication on the server to return the status
of the auth. Disabled or not.
In the front-end, if auth is disabled fake an admin user to allow
all functionality
@burtonr burtonr merged commit 1de6e0a into main Jul 10, 2022
@burtonr burtonr deleted the restructure branch July 10, 2022 22:12
@burtonr burtonr mentioned this pull request Jul 18, 2022
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant