Awesome
Cardbox Frontend
Get Started
-
Clone repository
-
Prepare local certificate authorithy
Setup via mkcert:
mkcert -install
Then generate your personal local certificates for cardbox:
yarn prepare:certs
-
Setup local env for development
Copy from
.env.sample
file and make sure the default settings are correct# Change some if you need RAZZLE_SESSION_TOKEN=XXXXXX CLIENT_PUBLIC_PATH=https://localhost:9101/ PORT=9100 BACKEND_URL=https://cardbox.sova.dev/api/internal
-
Install and run:
yarn install yarn start
Other commands
yarn api # update api by codegen
yarn lint # lint project with fix
Development
HotReload
Sometime you should manually restart server for new changes
# Just type and press ENTER:
rs
Effector
- Use
import {} from "effector-root"
instead of"effector"
. All units should be created in the root domain. - Use
import { debug } from "patronum"
for debug effector units
Structure
Project designed by FeatureSliced
WIP: Project is migrating from FSv1 to FSv2
app
src/app/application.tsx
— Application component, that have global styles and effector providersrc/app/server.tsx
— Express server, that renders React to streamsrc/app/client.tsx
— Browser side entry point, that hydrates stores and react appsrc/index.tsx
— Node.js entry point, that have hot module replacement and imports server
pages
src/pages/index.tsx
— Pages componentsrc/pages/:page-name/index.tsx
— View for single specific pagesrc/pages/:page-name/model.ts
— Business-logic for specific page, that contains single level logic layer
shared
WIP: soon will be placed at
src/shared
src/lib
— Internal librariessrc/ui
— Internal UIKitsrc/lib/effector
— START event name to use as page property