Skip to content

Latest commit

 

History

History
177 lines (114 loc) · 6.36 KB

index.md

File metadata and controls

177 lines (114 loc) · 6.36 KB
status
released

Getting Started

Your First Steps {.subtitle}

Welcome to CAP, and to capire, its one-stop documentation.

CAP [ˈkap(m)] — (unofficial) abbreviation for the "SAP Cloud Application Programming Model"{.learn-more .dict}

capire [ca·pì·re] — Italian for "understand"{.learn-more .dict}

<style scoped> a.dict { font-family: serif; font-weight: 100 } </style>

Initial Setup {#setup}

Follow the steps after this for a minimalistic local setup. Alternatively, you can use CAP in SAP Build Code, or other cloud-based setups, such as GitHub codespaces.

Prerequisites

  • Node.js — required for installing the cds command line interface
  • SQLite — included in macOS and Linux → install it on Windows
  • A Terminal{style="font-weight: 500"} — for using the cds command line interface (CLI)
  • A Text Editor{style="font-weight: 500"} → we recommend VS Code with CDS plugin

Installation

  • With the prerequisites met, install the cds toolkit globally:

    npm add -g @sap/cds-dk

    Visit the Troubleshooting guide if you encounter any errors. {.learn-more}

  • Run cds to check whether installation was successful:

    cds

    You see some output like that:

    USAGE
    
        cds <command> [<args>]
        cds <src>  =  cds compile <src>
        cds        =  cds help
    
    COMMANDS
    
        i | init        jump-start cds-based projects
        a | add         add a feature to an existing project
        c | compile     compile cds models to different outputs
        s | serve       run your services in local server
        w | watch       run and restart on file changes
        r | repl        read-eval-event loop
        e | env         inspect effective configuration
        b | build       prepare for deployment
        d | deploy      deploy to databases or cloud
        v | version     get detailed version information
        ? | help        get detailed usage information
    
      Learn more about each command using:
      cds help <command> or
      cds <command> --help
    

Optional

Starting Projects

Project Structure

The default file structure of CAP projects is as follows:

bookshop/        # Your project's root folder
├─ app/          # UI-related content
├─ srv/          # Service-related content
├─ db/           # Domain models and database-related content
├─ package.json  # Configuration for cds + cds-dk
└─ readme.md     # A readme placeholder

CAP has defaults for many things that you'd have to configure in other frameworks. The goal is that things should just work out of the box, with zero configuration, whenever possible. You can override these defaults by a specific configuration if you need to do so.

::: details See an example for configuring custom project layouts...

::: code-group

{ ...
  "cds": {
    "folders": {
       "db": "database/",
       "srv": "services/",
       "app": "uis/"
    }
  }
}
cds env ls defaults

Learn more about project-specific configuration.{.learn-more} :::

::: tip Convention over configuration We recommend sticking to CAP's way of Convention over Configuration to benefit from things just working out of the box. Only override the defaults if you really need to do so. :::

Learning More

{#next-steps}

After the initial setup, we recommend continuing as follows while you grow as you go...:

# Guide Description
1 Introduction – What is CAP? Learn about key benefits and value propositions.
2 Bookshop by capire Build your first CAP application within 4-44 minutes.
3 Best Practices Key concepts & rationales to understand → must read.
4 Anti Patterns Misconceptions & bad practices to avoid → must read.
5 Learn More Find samples, videos, blogs, tutorials, and so on.

Grow as you go...

After these getting started-level introductions, you would continuously revisit these guides to deepen your understanding and as reference docs:

# Guides & References Description
6 Cookbook Walkthroughs for the most common tasks.
7 CDS
Java
Node.js
Tools
The reference docs for these respective areas.
8 Plugins Curated list of recommended Calesi plugins.
9 Releases Your primary source to stay up to date.
10 Resources About support channels, community, ...

This also reflects the overall structure of this documentation.