Skip to content

cardbox/frontend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cardbox Frontend

code style: prettier Commitizen friendly Conventional Commits

Get Started

  1. Clone repository

  2. Prepare local certificate authorithy

    Setup via mkcert:

    mkcert -install

    Then generate your personal local certificates for cardbox:

    yarn prepare:certs
  3. 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
  4. 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 provider
  • src/app/server.tsx — Express server, that renders React to stream
  • src/app/client.tsx — Browser side entry point, that hydrates stores and react app
  • src/index.tsx — Node.js entry point, that have hot module replacement and imports server

pages

  • src/pages/index.tsx — Pages component
  • src/pages/:page-name/index.tsx — View for single specific page
  • src/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 libraries
  • src/ui — Internal UIKit
  • src/lib/effector — START event name to use as page property