Code Monkey home page Code Monkey logo

sst-expo-api's Introduction


This is a template for building an Expo application connected to an SST Api. The project is built using the bun JavaScript runtime. It has not been tested using pnpm or npm, only bun. More can be found on setting up bun and other frameworks in this project at the end of this document.

Install the project using the following git command:

$ git clone https://github.com/chadwpry/sst-expo-api.git

Api

SST Api that includes two stacks, EventBus and Api. The Api includes a Todo model and can fetch a list of random items or create a new random item. It is secured using Amazon Cognito.

  1. EventBus - distributed processing of events
  2. Api - REST Api secured by a Cognito JWT implementation

Available endpoints

Start development environment

$ cd sst-expo-api
$ bun install
$ bun run dev

Mobile -> /apps/expo-app

React Native application using Expo. The application uses the design framework Tamagui in the packages/tamagui-frontend directory.

Create an expo development build

Generate a new eas.json using the eas.json.template. Transfer exports from SST ApiStack and CognitoStack variables into the eas.json. Exports can be found after creating the initial SST environment.

Hint: exports can also be found in /.sst/outputs.json

{
  "EXPO_PUBLIC_USER_POOL_CLIENT_ID": "",
  "EXPO_PUBLIC_USER_POOL_ID": "",
  "EXPO_PUBLIC_REGION": "us-east-1",
  "EXPO_PUBLIC_USER_POOL_HOST_URL": "",
  "EXPO_PUBLIC_API_ENDPOINT": "",
  "EXPO_PUBLIC_IDENTITY_POOL_ID": ""
}

Next, create a development build of the ios or android client. This can be done by executing one of the following two commands.

Note the difference:

The first command will run in the EAS cloud. It requires you create an expo account. A free account exists, so this should not be any payment required to get started.

The second is to run builds locally. More detail can be found in the expo docs at creating a development build.

eas build --platform ios --profile development
eas build --platform ios --profile development --local

Lastly deploy the development build, either from the cloud or local, to a simulator or a physical device. Launch the development build application and reference the next step for starting the local development environment. This development environment is where the development build will connect to serve the application.

Start expo development environment "expo dev client"

$ cd sst-expo-api/packages/tamagui-frontend
$ bun run start

Create Cognito user

Create and verify a new user within Cognito. Usage information can be found by running the following command.

$ bun run cognito:user

References

Links to libraries and frameworks included in the project.

sst-expo-api's People

Contributors

chadwpry avatar

Stargazers

Hunter Hancock avatar Patrick Naughton avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.