Giter Site home page Giter Site logo

tondevelop / grocery-serverless-app Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ahsanplusplus/grocery-serverless-app

0.0 0.0 0.0 310 KB

This is a mock grocery purchase app built on the serverless technology. 1. Serverless Lambda Functions were written to serve as a backend REST APIs. 2. Front End is done with React which uses those APIs

JavaScript 97.75% HTML 1.01% CSS 1.24%

grocery-serverless-app's Introduction

What this app about ?

This is a mock grocery purchase app built on the serverless technology.

  1. Serverless Lambda Functions were written to serve as a backend REST APIs.
  2. Front End is done with React which uses those APIs

Motivation

To explore the limit of serverless framework

Tech Stack

image

Functionalities

App will have users who can register / login

  1. List of grocery items based on various categories (Eatable, drinkable, cookable, hyigene)
  2. Add items to cart if that stock is present for a grocery item.
  3. Checking out from a cart to place order
  4. Payment for an order / Cancelling the order

To be built

  1. A global search bar for item search
  2. Chat functionality between users and customer support (Admin of the app)

Prerequisites:

  1. Install AWS CLI
  2. Add user based on AWS credentials which will be shared directly.
  3. Auth will be currently based on AWS Cognito. Login / Registration will be handled by the front end auth module directly with the cognito. Lambda functions won't be responsible for auth. It requires an userId (AccessKeyId) based on which we will maintain the DB.
  4. All other APIs will be working locally.
  5. Front End would be developed locally and finally deployed on S3.

Accounts Required to deploy on cloud

  1. Cognito user pool to be created which will manage users in the app. You need to specify it on the front end as mentioned later in the readme. Also For backend refer To Setup Backend point 10
  2. Deployment will use S3, API gateway and lambda functions along with DynamoDB. Ensure that you have access in your AWS on which it will be deployed

To setup Backend:

  1. Choose a region as per AWS (Our App is ap-south-1).
  2. Check out utils/config.js and change the region as per that. Choose db url locally or accordingly on Cloud. For more details look at https://docs.aws.amazon.com/general/latest/gr/rande.html
  3. Install AWS DynamoDB for this region locally and run the server which will default to port 8000.
  4. npm run initialize-db to create all db tables with populated value (Local / cloud depending upon the config url)
  5. At any moment you can use npm run reinitialize-db to flush all the data present in the tables.
  6. For the current version auth should be used with cognito.
  7. npm install -g serverless to install serverless globally
  8. npm install in the backend repository.
  9. npm run start will start the serverless backend offline.
  10. Certain routes are protected by cognito pool. Change the serverles.yaml as per your cognito pool to have authenticated routes.

To setup Frontend:

  1. Create .env file under packages/CB-serverless-frontend folder with below variables: REACT_APP_REGION=XXXXXX REACT_APP_URL=http://localhost:3000 REACT_APP_REGION=XXXXXX REACT_APP_USER_POOL_ID=XXXXXX REACT_APP_APP_CLIENT_ID=XXXXXX REACT_APP_IDENTITY_POOL_ID=XXXXXX

you can use 4242 4242 4242 4242 for card number or refer stripe for more.

  1. npm install to install
  2. npm run start to start

grocery-serverless-app's People

Contributors

ethanswe 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.