Geekle Supply App
This is the Supply App of the Geekle package. It is used by organizations to manage their jobs and applications.
Main
main.tsx
is where the App starts. We instantiate a new GeekleSupplyAppTemplate
with it's options and dependencies; then initialize and render a React App.
Dependencies
The dependencies are services and API's needed for the Supply App.
authApi
: The auth API for authenticationcatalogApi
: The Catalog API service for jobschatApi
: Chat API for messaging between organizations and userschatSocketApi
: Web sockets for chatdemandSiteOrganizationUrl
: URL of the organization API of the demand sitedemandSiteProductUrl
: URL of the product API of the demand sitefileUploader
: Google Cloud Bucket for uploading imagesorderApi
: Order API service for job applicationsorganizationApi
: The organization API servicepaymentApi
: Payment service for supply organization paymentssessionService
: The service which handles the session managementuserApi
: The user API service
Opts
Block Pages
The blockPages
option is one of the main options. Here are the components used for the Supply site:
-
createRedirect
: Simple redirect to the top index page- Settings
options
: Navigation options for the redirectto
: Name of theblockPage
to redirect to
- Validators
- None
- Settings
-
createSections
: Landing page sections- Settings
components
: An array of components to display on the landing pagecreateLandingHero
: Landing page hero section- Settings
byline
: ReactNode component to display the byline textimageUrl
: Image URL for the hero sectionshowSecondaryText
: Boolean to display secondary textshowTertiaryText
: Boolean to display tertiary textsignupRoute
: The sign up page route
- Settings
createLandingMerits
: Display merit items on landing page- Settings
meritItems
: Merit items to display on the landing pagesignupRoute
: The sign up page route
- Settings
createLandingHowToUse
: How to use section of the landing page- Settings
signupRoute
: The sign up page routestepItems
: Steps on how to use items
- Settings
createLandingFAQ
: FAQ section- Settings
faqItems
: The FAQ itemssignupRoute
: The sign up page route
- Settings
- Validators
- None
- Settings
-
createOrganizationApplicationCreate
: Organization application form- Settings
organizationApi
: The organizationAPI serviceprivacyPolicyUrl
: The URL of the private policy pagesuccessRoute
: The route of the page upon successful sign upuserAgreementUrl
: The URL of the user agreement page
- Validators
- None
- Settings
-
createOrganizationApplicationComplete
:- Settings
returnToTopRoute
: The route to the landing page upon application completion
- Validators
- None
- Settings
-
createLogin
: THe login form- Settings
alreadyVerifiedRoute
: Route to page when user is logged in and verifiedauthApi
: The Authentication API serviceshowSignupLink
: The link to sign up pageuserApi
: The User API service
- Validators
- None
- Settings
-
createResetPasswordRequest
: Email form to request password reset- Settings
userApi
: The User API service
- Validators
- None
- Settings
-
createResetPasswordSubmit
: Reset password form- Settings
passwordValidateStrategy
: The strategy to validate the passworduserApi
: The User API service
- Validators
- None
- Settings
-
createResetPasswordSuccess
: Simple page after successful password reset- Settings
userApi
: The User API service
- Validators
- None
- Settings
-
createLogout
: Logout page- Settings
authApi
: The Authentication API servicelogoutRedirect
: Page to redirect to upon logging out
- Validators
- None
- Settings
-
createAcceptInvitation
: Create user form after accepting an invitation- Settings
passwordValidateStrategy
: The strategy to validate the passwordredirectAfterAcceptRoute
: The page to redirect to upon invitation acceptanceuserApi
: The User API serviceuserTypeId
: The user type ID
- Validators
isNotLoggedIn
: When the user is not logged in, it redirects to the application index page
- Settings
-
createProductsListForTenantOrganization
: Products/jobs list for the specific organization- Settings
catalogApi
: The Catalog API service for the jobs created by organizationcreateProductRoute
: The page to create a new product/jobshowProductRoute
: The details page of the product/jobupdateProductRoute
: The edit page of the product/job
- Validators
selectTenantFromOrganization
: Validates and sets tenant for user based on their organizationsisTenantOrganizationRegistered
: Makes sure that the organization is registeredneedsPaymentSetup
: Validates if user needs to setup payment details
- Settings
-
createShowProductDetailPage
: Display the details of the product/job- Settings
catalogApi
: The Catalog API service for the jobs created by organizationeditProductRoute
: The edit page of the product/jobdemandSiteProductUrl
: The demand site product/job URL
- Validators
selectTenantFromOrganization
: Validates and sets tenant for user based on their organizationsisTenantOrganizationRegistered
: Makes sure that the organization is registered
- Settings
-
createCreateProductForTenant
: Create product form page- Settings
attributeName
: The name of the attribute to retrieve fromcatalogApi
: The Catalog API service for the jobs created by organizationfileUploader
: Google Cloud Bucket for uploading imagessuccessRoute
: The route of the page to go to upon successful product create
- Validators
selectTenantFromOrganization
: Validates and sets tenant for user based on their organizationsisTenantOrganizationRegistered
: Makes sure that the organization is registeredneedsPaymentSetup
: Validates if user needs to setup payment details
- Settings
-
createUpdateProductForTenant
: Update product form page- Settings
attributeName
: The name of the attribute to retrieve fromcatalogApi
: The Catalog API service for the jobs created by organizationfileUploader
: Google Cloud Bucket for uploading imagessuccessRoute
: The route of the page to go to upon successful product update
- Validators
selectTenantFromOrganization
: Validates and sets tenant for user based on their organizationsisTenantOrganizationRegistered
: Makes sure that the organization is registeredneedsPaymentSetup
: Validates if user needs to setup payment details
- Settings
-
createOrdersListForTenantOrganization
: List of orders/job applications page- Settings
chatApi
: The Chat API servicechatFeature
: The route of the messages pageorderApi
: The Order API service to manage job applicationsshowOrderRoute
: The order/job application
- Validators
- Settings
-
createShowOrderDetailPage
: Show order/job application details page- Settings
chatApi
: The Chat API servicechatFeature
: The route of the messages pagecatalogApi
: The Catalog API service for the jobs created by organizationorderApi
: The Order API service to manage job applicationsproductShowPageRoute
: The route to the product details page
- Validators
selectTenantFromOrganization
: Validates and sets tenant for user based on their organizationsisTenantOrganizationRegistered
: Makes sure that the organization is registeredneedsPaymentSetup
: Validates if user needs to setup payment details
- Settings
-
createListMessagesAndTopicsForTenantOrganizationBlock
: List page of messages and topics for organization- Settings
chatApi
: The Chat API serviceorganizationApi
: The organizationAPI serviceorderShowRoute
: The order/job application details pageorganizationShowRoute
: The organization details pagesocketApi
: Web socket API servicetopicShowRoute
: The topics details pageuserApi
: The User API service
- Validators
selectTenantFromOrganization
: Validates and sets tenant for user based on their organizationsisTenantOrganizationRegistered
: Makes sure that the organization is registeredneedsPaymentSetup
: Validates if user needs to setup payment details
- Settings
-
createMyOrganizationPage
: Displays user's organization page- Settings
organizationApi
: The organizationAPI servicedemandSiteOrganizationUrl
: Organization URL on the demand siteeditCompanyRoute
: The edit organization/company page
- Validators
selectTenantFromOrganization
: Validates and sets tenant for user based on their organizationsisTenantOrganizationRegistered
: Makes sure that the organization is registered
- Settings
-
createOrganizationUpdate
: Organization update page- Settings
organizationApi
: The organizationAPI servicesuccessRoute
: The page to go to upon successful organization update
- Validators
- None
- Settings
-
createDashboardLink
: Get payment dashboard link- Settings
paymentApi
: Payment service for supply organization payments
- Validators
selectTenantFromOrganization
: Validates and sets tenant for user based on their organizationsisTenantOrganizationRegistered
: Makes sure that the organization is registered
- Settings
-
createOrganizationRegistration
: Organization registration form page- Settings
organizationApi
: The organizationAPI servicesuccessRoute
: The page to go to upon successful organization registration
- Validators
isLoggedIn
: When the user is not logged in, it redirects to the login pageselectTenantFromOrganization
: Validates and sets tenant for user based on their organizations
- Settings
-
createListSettingsPage
: User settings list page- Settings
changeEmailRoute
: The settings page to update their emailchangeNameRoute
: The settings page to update their namechangePasswordRoute
: The settings page to update their passwordchangePhoneNumberRoute
: The settings page to update their phone numberuserApi
: The User API service
- Validators
isLoggedIn
: When the user is not logged in, it redirects to the login page
- Settings
-
createChangeEmail
: User settings to edit their email- Settings
cancelRoute
: The page to go to upon cancelling settings updatesuccessRoute
: The page to go to upon successful settings updateuserApi
: The User API service
- Validators
isLoggedIn
: When the user is not logged in, it redirects to the login page
- Settings
-
createChangeName
: User settings to edit their name- Settings
cancelRoute
: The page to go to upon cancelling settings updatesuccessRoute
: The page to go to upon successful settings updateuserApi
: The User API service
- Validators
isLoggedIn
: When the user is not logged in, it redirects to the login page
- Settings
-
createChangePhoneNumber
: User settings to edit their phone number- Settings
cancelRoute
: The page to go to upon cancelling settings updatesuccessRoute
: The page to go to upon successful settings updateuserApi
: The User API service
- Validators
isLoggedIn
: When the user is not logged in, it redirects to the login page
- Settings
-
createVerifyChangeEmailSuccess
: Success page when updating email address- Settings
userApi
: The User API serviceverifiedRoute
: Page to go to upon verification
- Validators
- None
- Settings
-
createDashboardLink
:- Settings
paymentApi
: Payment service for supply organization payments
- Validators
- None
- Settings
-
createChangePassword
:- Settings
cancelRoute
: The page to go to upon cancelling password changesuccessRoute
: The page to go to upon successful password changeforgotPasswordUrl
: Forget password URLuserApi
: The User API service
- Validators
isLoggedIn
: When the user is not logged in, it redirects to the login page
- Settings
-
createPaymentPage
: Setup payment settings- Settings
dashboardRoute
: Route to payment dashboard page
- Validators
isLoggedIn
: When the user is not logged in, it redirects to the login pageselectTenantFromOrganization
: Validates and sets tenant for user based on their organizationsisTenantOrganizationRegistered
: Makes sure that the organization is registered
- Settings
Validators
Validators are run before the page renders. If the validator fails, the page does not render.
needsPaymentSetup
: Validates if user needs to setup payment details- Scenarios
User has not paid/setup payment
: Navigate tonotValidRedirect
pathUser has paid or is in trial phase
: Validator passed, display page
- Scenarios
Payment
Inside the supply frontend template, we can add the payment validator that checks our backend property needs_payment_method_setup
.
{
component: createProductsListForTenantOrganization({
catalogApi: dependencies.catalogApi,
createProductRoute: 'jobs.create',
showProductRoute: 'jobs.show',
updateProductRoute: 'jobs.update',
}),
name: 'jobs.index',
pageTitle: (t) => t('Geekle:jobsTitle'),
path: '/jobs',
validators: {
//...other validators
needsPaymentSetup: requiresPayment({
notValidRedirect: 'payment.index',
organizationApi: dependencies.organizationApi,
}),
},
In this example from the template, it has needsPaymentSetup
validator attached to this route. Which means you are required to have needs_payment_method_setup
set to false
. If it is set to true
, you will be redirect to the route payment.index
.
The logic can be changed here ./validators/requiresPayment
.