Skip to content

Latest commit

 

History

History
62 lines (44 loc) · 3.17 KB

readme.md

File metadata and controls

62 lines (44 loc) · 3.17 KB

anticore-demo

An anticore demo just to provide a very simple example to see how to start a real world project.

Under the hood, it uses the following dependencies to simplify the job:

Install

git clone https://github.com/Lcfvs/anticore-demo
cd anticore-demo
npm i
npm start

Alternatively, you can simply make your own the Glitch project

The demo architecture

Preamble

If you don't know how anticore is working, maybe read the brief explanation and the first following demo to learn the library basics, it really often helps the beginners.

In short, the following jumps can also be useful to understand the most used features:

The front

You can find it into the ./src/assets

The JS part is divided like this (but you can choose the structure you want, it's just an example):

  • contracts: A directory containing all your anticore contracts
    • generics.js: A module importing the generic contracts, not related to a specific view, to declare some behaviors
    • trees.js: A module importing the tree contracts, altering the document
    • views.js: A module importing the view contracts, to handle the view-related behaviors
  • generics: A directory containing the lazy-loaded generic features, when a matching element is received by anticore
  • utils: A directory for your utilities, basically, it only contains a selectors shorthand
  • views: A directory containing the lazy-loaded view features, when a matching element is received by anticore
  • dist.js: A bundled version of your front code, for the browsers not yet supporting the import-map
  • main.js: The main entrypoint importing your contracts and triggering anticore In order, it imports the generics, the views, the trees, then the anticore/trigger.js You're strongly encouraged to preserve that order to keep your front optimized

The backend/ops

  • For the server-side things, read the anticore-server readme
  • To see how to install/uninstall some dependencies, read the jspmi one

License

MIT