Skip to content

0xsonu/AWS_Backend

Repository files navigation

GraphQL API with AWS AppSync and MongoDB Template

An example serverless app created with SST.

Getting Started

Read the tutorial

Install the example.

git clone https://github.com/SonuKumar81800/AWS_Backend.git
cd AWS_Backend
npm install || yarn install

Install and Configure AWS cli

  • Download AWS Cli too from AWS Official
  • Install it in your local system.
  • Once your local environment is ready, head over to the AppSync console and get your access key id and secret here.

Open Terminal and follow these steps.

aws configure
AWS Access Key ID: <your_access_key_id>
AWS Secret Access Key:  <your_access_key_secret>
Default region name:  <select_your_region>
Default output format: json

Start the Live Lambda Development environment.

$ npm sst start

These Key Value you need to add to .env file

MONGO_USERNAME=<env_value>
MONGO_PASSWORD=<env_value>
DATABASE_NAME=<env_value>
DATABASE=<env_value>
GRAPHQL_API_URL=<env_value>
GRAPHQL_API_KEY=<env_value>

Commands

npm run start

Starts the local Lambda development environment.

npm run build

Build your app and synthesize your stacks.

Generates a .build/ directory with the compiled files and a .build/cdk.out/ directory with the synthesized CloudFormation stacks.

npm run deploy [stack]

Deploy all your stacks to AWS. Or optionally deploy a specific stack.

npm run remove [stack]

Remove all your stacks and all of their resources from AWS. Or optionally remove a specific stack.

npm run test

Runs your tests using Jest. Takes all the Jest CLI options.

Documentation

Learn more about SST.

Community

Follow us on Twitter or post on our forums.