website

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 15, 2023 License: MIT Imports: 3 Imported by: 0

README ΒΆ

QuantumLab Frontend

πŸ› οΈ Environment Setup

Install node_modules:

npm install

Provided Scripts

Ant Design Pro provides some useful script to help you quick start and build with web project, code style check and test.

Scripts provided in package.json. It's safe to modify or add additional script:

Start project
npm start
Build project
npm run build
Check code style
npm run lint

You can also use script to auto fix some lint error:

npm run lint:fix
Test code
npm test

πŸ“ Folder Structure Guide

General

β”œβ”€β”€ config                   # umi configuration, includes routes, build, etc.
β”œβ”€β”€ jest                     # jest config
β”œβ”€β”€ cypress                  # e2e test
β”œβ”€β”€ mock                     # mock api for development
β”œβ”€β”€ public                   # static resources
β”œβ”€β”€ src
β”‚   β”œβ”€β”€ assets               # local static resources
β”‚   β”œβ”€β”€ components           # common components
β”‚   β”œβ”€β”€ layouts              # common layouts
β”‚   β”œβ”€β”€ models               # global dva models
β”‚   β”œβ”€β”€ pages                # page entry points and commonly used templates
β”‚   β”œβ”€β”€ services             # backend interface services
β”‚   β”œβ”€β”€ utils                # utility library
β”‚   β”œβ”€β”€ locales              # internationalization resources
β”‚   β”œβ”€β”€ global.less          # global styles
β”‚   └── global.ts            # global JS
β”œβ”€β”€ cypress.config.js        # cypress config
β”œβ”€β”€ README.md
└── package.json

Pages

Check out the Page Code Structure documentation.

Example:

src
β”œβ”€β”€ components         // Common components
└── pages
    β”œβ”€β”€ Welcome        // Routed Page Component
    |   β”œβ”€β”€ components // components only used in this page
    |   β”œβ”€β”€ Form.tsx
    |   β”œβ”€β”€ index.tsx  // Code of page component
    |   └── index.less // Page style
    β”œβ”€β”€ Workspace
    |   β”œβ”€β”€ components // Workspace page group components
    |   β”œβ”€β”€ Create      // 'Create' page component under Workspace page group
    |   └── util.ts    // Workspace page group common utility functions
    └── *              // Others

Running Tests with Cypress

Prerequisites
  • Ensure you have Node.js installed.
  • Install Cypress via npm:
    npm install cypress --save-dev
    
Running Cypress Tests

Before running any tests, make sure you are in the directory of /website.

  1. Open Cypress Test Runner:

    • You can open the Cypress Test Runner with the following command:
      npx cypress open
      
    • This will open the Cypress GUI where you can select and run individual test files.
  2. Run Cypress Tests Headlessly:

    • To run Cypress tests in headless mode (without opening the GUI), use the following command:
      npx cypress run
      
    • This will execute all the test suites in the background and provide a summary of the results in your terminal.
  3. Running Specific Test Files:

    • If you want to run a specific test file, use the following command format:
      npx cypress run --spec "website/cypress/e2e/testfile.specs.js"
      
    • Replace testfile.spec.js with the actual path to your Cypress test file.

Documentation ΒΆ

Index ΒΆ

Constants ΒΆ

This section is empty.

Variables ΒΆ

This section is empty.

Functions ΒΆ

func InitWebsite ΒΆ

func InitWebsite(engine *gin.Engine)

InitWebsite load the website assets and transfer default router control to frontend framework.

Types ΒΆ

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL