You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/docs/quick-start.md
+17-17Lines changed: 17 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -34,7 +34,7 @@ Then change into that directory, yarn install, and start the development server:
34
34
```
35
35
cd my-cedar-project
36
36
yarn install
37
-
yarn cedarjs dev
37
+
yarn cedar dev
38
38
```
39
39
40
40
Your browser should automatically open to [http://localhost:8910](http://localhost:8910) where you'll see the Welcome Page, which links out to many great resources:
@@ -48,7 +48,7 @@ From dev to deploy, the CLI is with you the whole way.
48
48
And there's quite a few commands at your disposal:
49
49
50
50
```
51
-
yarn cedarjs --help
51
+
yarn cedar --help
52
52
```
53
53
54
54
For all the details, see the [CLI reference](cli-commands.md).
@@ -81,39 +81,39 @@ defining your app's data models. And Prisma
81
81
migrations hassle-free:
82
82
83
83
```
84
-
yarn cedarjs prisma migrate dev
84
+
yarn cedar prisma migrate dev
85
85
86
86
# ...
87
87
88
88
? Enter a name for the new migration: › create posts
89
89
```
90
90
91
+
You'll be prompted for the name of your migration. `create posts` will do.
92
+
91
93
:::tip
92
94
93
-
If you feel `cedarjs` is too long to type out all the time, you can use `cdr` as
94
-
an alias:
95
+
If you feel `yarn cedar` is too long to type out all the time, you can add
96
+
`alias cedar='yarn cedar'` as an alias to your shell and then just use `cedar`
95
97
96
98
```
97
-
yarn cdr prisma migrate dev
98
-
yarn cdr dev
99
+
cedar prisma migrate dev
100
+
cedar dev
99
101
# etc
100
102
```
101
103
102
104
:::
103
105
104
-
You'll be prompted for the name of your migration. `create posts` will do.
105
-
106
106
Now let's generate everything we need to perform all the CRUD (Create, Retrieve, Update, Delete) actions on our `Post` model:
107
107
108
108
```
109
-
yarn cedarjs generate scaffold post
109
+
yarn cedar generate scaffold post
110
110
```
111
111
112
112
Navigate to [http://localhost:8910/posts/new](http://localhost:8910/posts/new), fill in the title and body, and click "Save":
113
113
114
114
<imgsrc="https://user-images.githubusercontent.com/300/73028004-72262c00-3de9-11ea-8924-66d1cc1fceb6.png"alt="Create a new post" />
115
115
116
-
Did we just create a post in the database? Yup! With `yarn cedarjs generate scaffold <model>`, Cedar created all the pages, components, and services necessary to perform all CRUD actions on our posts table.
116
+
Did we just create a post in the database? Yup! With `yarn cedar generate scaffold <model>`, Cedar created all the pages, components, and services necessary to perform all CRUD actions on our posts table.
117
117
118
118
## Frontend first with Storybook
119
119
@@ -122,23 +122,23 @@ That's more than ok — Cedar integrates Storybook so that you can work on desig
122
122
Mockup, build, and verify your React components, even in complete isolation from the backend:
123
123
124
124
```
125
-
yarn cedarjs storybook
125
+
yarn cedar storybook
126
126
```
127
127
128
128
Seeing "Couldn't find any stories"?
129
129
That's because you need a `*.stories.{tsx,jsx}` file.
130
130
The CedarJS CLI makes getting one easy enough — try generating a [Cell](./cells), CedarJS's data-fetching abstraction:
131
131
132
132
```
133
-
yarn cedarjs generate cell examplePosts
133
+
yarn cedar generate cell examplePosts
134
134
```
135
135
136
136
The Storybook server should hot reload and now you'll have four stories to work with.
137
137
They'll probably look a little bland since there's no styling.
138
138
See if the CedarJS CLI's `setup ui` command has your favorite styling library:
139
139
140
140
```
141
-
yarn cedarjs setup ui --help
141
+
yarn cedar setup ui --help
142
142
```
143
143
144
144
## Testing with Vitest
@@ -147,7 +147,7 @@ It'd be hard to scale from side project to startup without a few tests.
147
147
Cedar fully integrates Vitest with both the front- and back-ends, and makes it easy to keep your whole app covered by generating test files with all your components and services:
148
148
149
149
```
150
-
yarn cedarjs test
150
+
yarn cedar test
151
151
```
152
152
153
153
To make the integration even more seamless, CedarJS augments Vitest with database [scenarios](testing.md#scenarios) and [GraphQL mocking](testing.md#mocking-graphql-calls).
@@ -157,15 +157,15 @@ To make the integration even more seamless, CedarJS augments Vitest with databas
157
157
CedarJS is designed for both serverless deploy targets like Netlify and Vercel and serverful deploy targets like Render and AWS:
158
158
159
159
```
160
-
yarn cedarjs setup deploy --help
160
+
yarn cedar setup deploy --help
161
161
```
162
162
163
163
Don't go live without auth!
164
164
Lock down your app with CedarJS's built-in, database-backed authentication system ([dbAuth](authentication.md#self-hosted-auth-installation-and-setup)), or integrate with
0 commit comments