Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

generator-jkv2

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

generator-jkv2

Opinionated Yeoman generator for full-stack mono-repo TypeScript projects.

  • 0.1.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

JKv2 Yeoman generator

Opinionated generator for mono-repo web apps.

Features:

  • Monorepo with npm7 workspaces (backend, core, frontend)
  • No framework. Plain Typescript functions and API Gateway routing to Lambdas running in VPC
  • TypeORM & Postgres
  • Cognito

Quickstart

Pre-requisites

  • npm 7
  • yeoman
  • jkv2 generator
npm i -g npm@7 yo generator-jkv2
yo jkv2

Useful commands

  • yo jkv2:model # Create a new TypeORM model and CRUD for it

  • yo jkv2:api # Create a new API endpoint for a model

  • npm run db:init:local # Re-creates local DB, migrates and seeds it

  • npm run db:migrate:generate -n $name # Create a new migrations

  • npm run sls:deploy:dev # Deploy to the dev environment

AWS services schema

VPC/Aurora Data API

Currently VPC connection is recommended.

It offers DB driver that doesn’t have problems with types unlike the one used by Aurora Data API. However using it is a bit more pricy and there are problems with Lambda timeouts after hitting 10 requests per second on a Lambda. Once the Data API is somewhat more mature we should consider switching to it.

API validation/serialization

lambda-middleware and class-validator packages are used for incoming request body validation.

Currently when serializing responses there’s no option to exclude unwanted fields.

Setting up Cognito

In your .env.local or in your env variables config on e.g. Netlify you'll have to assign the following env variables:

REACT_APP_COGNITO_IDENTITY_POOL_ID,
REACT_APP_COGNITO_REGION,
REACT_APP_COGNITO_IDENTITY_POOL_REGION,
REACT_APP_COGNITO_USER_POOL_ID,
REACT_APP_COGNITO_USER_POOL_APP_CLIENT_ID,
REACT_APP_API_REGION

To find some of the values you should login to your aws account

REACT_APP_COGNITO_USER_POOL_ID

REACT_APP_COGNITO_USER_POOL_APP_CLIENT_ID

REACT_APP_IDENTITY_POOL_ID

Keywords

FAQs

Package last updated on 15 Jan 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc