Skip to main content

Struttura dell'app

Il template Node delle applicazioni Riseact è un punto di partenza: puoi adattarlo al tuo progetto.

Struttura di base

├── client
│   ├── index.html
│   ├── LICENSE
│   ├── package.json
│   ├── public
│   │   └── riseact.png
│   ├── src
│   │   ├── assets
│   │   │   └── react.svg
│   │   ├── components
│   │   │   ├── Navbar
│   │   │   │   ├── index.tsx
│   │   │   │   └── NavButton.tsx
│   │   │   └── Page
│   │   │       └── index.tsx
│   │   ├── config
│   │   │   ├── network.ts
│   │   │   └── routing.ts
│   │   ├── hooks
│   │   │   └── useOrganization.ts
│   │   ├── main.tsx
│   │   ├── Router.tsx
│   │   ├── routes
│   │   │   ├── Campaigns
│   │   │   │   ├── Create.tsx
│   │   │   │   ├── Detail.tsx
│   │   │   │   ├── Form.tsx
│   │   │   │   ├── index.tsx
│   │   │   │   └── List
│   │   │   │       ├── Filters.tsx
│   │   │   │       ├── index.tsx
│   │   │   │       └── VisibilityBadge.tsx
│   │   │   └── Home
│   │   │       └── index.tsx
│   │   ├── utils
│   │   │   └── enumTranslate.ts
│   │   └── vite-env.d.ts
│   ├── tsconfig.json
│   └── vite.config.ts
├── common
│   ├── gql-codegen.ts
│   ├── package.json
│   ├── src
│   │   ├── gql
│   │   │   ├── fragment-masking.ts
│   │   │   ├── gql.ts
│   │   │   ├── graphql.ts
│   │   │   └── index.ts
│   │   ├── queries.ts
│   │   └── types.ts
│   └── tsconfig.json
├── Dockerfile
├── LICENSE
├── package.json
├── package-lock.json
├── prisma
│   ├── migrations
│   │   ├── 20231031142218_init
│   │   │   └── migration.sql
│   │   └── migration_lock.toml
│   └── schema.prisma
├── README.md
├── server
│   ├── package.json
│   ├── src
│   │   ├── config
│   │   │   ├── database.ts
│   │   │   └── riseact.ts
│   │   ├── controllers
│   │   │   └── organization.ts
│   │   ├── env.d.ts
│   │   └── index.ts
│   └── tsconfig.json
├── tsconfig.build.json
└── tsconfig.json

Client

Il front-end React, costruito con Vite.

  • public: file statici
  • src: codice sorgente
    • assets: immagini e file multimediali
    • components: componenti
    • config: configurazione di rete e routing
    • hooks: custom hook
    • main.tsx: punto di ingresso
    • Router.tsx: definizione delle rotte
    • routes: pagine
    • utils: utility

Common

Codice condiviso fra client e server.

  • gql-codegen.ts: configurazione della generazione dei tipi GraphQL
  • src/gql: tipi GraphQL generati
  • src/queries.ts: query GraphQL
  • src/types.ts: tipi TypeScript

Server

Il back-end.

  • src/config: configurazione di database e Riseact
  • src/controllers: controller
  • src/env.d.ts: tipi delle variabili d'ambiente
  • src/index.ts: punto di ingresso

Altri file

  • Dockerfile: immagine Docker dell'applicazione
  • prisma: schema e migrazioni del database (Prisma)
  • tsconfig.build.json: configurazione TypeScript per la build

Fonte: https://dev.riseact.org/docs/cli/app_structure. Copia automatica da dev.riseact.org: non modificare qui, le modifiche vanno fatte sulla documentazione Docusaurus.