|
1 | | -# Getting Started with Serverless Stack (SST) |
| 1 | +# SST Demo Notes App [](https://console.seed.run/serverless-stack/demo-notes-app) |
2 | 2 |
|
3 | | -This project was bootstrapped with [Create Serverless Stack](https://docs.serverless-stack.com/packages/create-serverless-stack). |
| 3 | +The [Serverless Stack Guide](https://serverless-stack.com/#guide) is a comprehensive open source tutorial for building and deploying full-stack apps using serverless and React on AWS. |
4 | 4 |
|
5 | | -Start by installing the dependencies. |
| 5 | +We create a [note taking app](https://demo.serverless-stack.com) from scratch. Using React.js, AWS Lambda, API Gateway, DynamoDB, and Cognito. |
| 6 | + |
| 7 | + |
| 8 | + |
| 9 | +This repo is a full-stack serverless app built with [SST](https://github.com/serverless-stack/serverless-stack). |
| 10 | + |
| 11 | +- The `lib/` directory defines our AWS infrastructure using AWS CDK. |
| 12 | +- The `src/` directory contains the Lambda functions that power the CRUD API. |
| 13 | +- The `frontend/` directory contains the React app. |
| 14 | + |
| 15 | +It's a single-page React app powered by a serverless CRUD API. We also cover how add user authentication, handle file uploads, and process credit card payments with Stripe. |
| 16 | + |
| 17 | +### Usage |
| 18 | + |
| 19 | +Clone this repo. |
6 | 20 |
|
7 | 21 | ```bash |
8 | | -$ npm install |
| 22 | +$ git clone https://github.com/serverless-stack/demo-notes-app |
9 | 23 | ``` |
10 | 24 |
|
11 | | -## Commands |
| 25 | +Install dependencies. |
| 26 | + |
| 27 | +``` bash |
| 28 | +$ npm install |
| 29 | +``` |
12 | 30 |
|
13 | | -### `npm run start` |
| 31 | +#### Developing Locally |
14 | 32 |
|
15 | | -Starts the local Lambda development environment. |
| 33 | +Start the [Live Lambda Dev Environment](https://docs.serverless-stack.com/live-lambda-development). |
16 | 34 |
|
17 | | -### `npm run build` |
| 35 | +``` bash |
| 36 | +$ npx sst start |
| 37 | +``` |
18 | 38 |
|
19 | | -Build your app and synthesize your stacks. |
| 39 | +Install dependencies for the frontend React app. |
20 | 40 |
|
21 | | -Generates a `.build/` directory with the compiled files and a `.build/cdk.out/` directory with the synthesized CloudFormation stacks. |
| 41 | +``` bash |
| 42 | +$ cd frontend |
| 43 | +$ npm install |
| 44 | +``` |
22 | 45 |
|
23 | | -### `npm run deploy [stack]` |
| 46 | +Start the React local dev environment from the `frontend/` dir. |
24 | 47 |
|
25 | | -Deploy all your stacks to AWS. Or optionally deploy, a specific stack. |
| 48 | +``` bash |
| 49 | +$ npm start |
| 50 | +``` |
26 | 51 |
|
27 | | -### `npm run remove [stack]` |
| 52 | +#### Running Tests |
28 | 53 |
|
29 | | -Remove all your stacks and all of their resources from AWS. Or optionally removes, a specific stack. |
| 54 | +From the project root. |
30 | 55 |
|
31 | | -### `npm run test` |
| 56 | +``` bash |
| 57 | +$ npx sst test |
| 58 | +``` |
32 | 59 |
|
33 | | -Runs your tests using Jest. Takes all the [Jest CLI options](https://jestjs.io/docs/en/cli). |
| 60 | +#### Deploying to Prod |
34 | 61 |
|
35 | | -## Documentation |
| 62 | +Run this in the project root to deploy it to prod. |
36 | 63 |
|
37 | | -Learn more about the Serverless Stack. |
38 | | -- [Docs](https://docs.serverless-stack.com) |
39 | | -- [@serverless-stack/cli](https://docs.serverless-stack.com/packages/cli) |
40 | | -- [@serverless-stack/resources](https://docs.serverless-stack.com/packages/resources) |
| 64 | +``` bash |
| 65 | +$ npx sst deploy |
| 66 | +``` |
41 | 67 |
|
42 | | -## Community |
| 68 | +--- |
43 | 69 |
|
44 | | -[Follow us on Twitter](https://twitter.com/ServerlessStack) or [post on our forums](https://discourse.serverless-stack.com). |
| 70 | +Join the SST community over on [Slack](https://launchpass.com/serverless-stack) and follow us on [Twitter](https://twitter.com/ServerlessStack). |
0 commit comments