Getting Started
Your First Steps
Welcome to CAP, and to capire, its one-stop documentation.
CAP [ˈkap(m)] — (unofficial) abbreviation for the "SAP Cloud Application Programming Model"
capire [ca·pì·re] — Italian for "understand"
Initial 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 — for using the
cds
command line interface (CLI) - A Text Editor → we recommend VS Code with CDS plugin.
Installation
With the prerequisites met, install the
cds
toolkit globally:shnpm add -g @sap/cds-dk
Visit the Troubleshooting guide if you encounter any errors.
Run
cds
to check whether installation was successful:shcds
You see some output like that:
shUSAGE 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
- Java & Maven — if you're going for Java development → see instructions.
- git — if you go for more than just some quick trials.
Starting Projects
Use
cds init
to start a CAP project, and then open it in VSCode:shcds init bookshop
shcode bookshop
Assumes you activated the
code
command on macOS as documented
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.
See an example for configuring custom project layouts...
{ ...
"cds": {
"folders": {
"db": "database/",
"srv": "services/",
"app": "uis/"
}
}
}
cds env ls defaults
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
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.