Node.js TypeScript project demonstrating a Prisma integration with PostgreSQL

Overview

Prisma with PostgreSQL, TypeScript, Serverless and Parameter Store

This project is the outcome of following the Prisma Getting Started guide.

In addition, Serverless features have been added for seamless AWS deployments.

Prerequisites

  • AWS account
  • A running PostgreSQL database e.g Amazon Aurora RDS PostgreSQL
  • A valid database connection string

To run this project:

npm i

Modify .env

See .env.sample

This step is only required if you plan on running the app on localhost.

DATABASE_URL=postgresql://user:password@host:port/db-name

Add secret database string to AWS Parameter Store

When Serverless builds the deployment package, it fetches the database connection string from Parameter Store.

Modify the provider block in serverless.yaml:

environment:
    DATABASE_URL: ${ssm:/dev/my-app/my-connection}

Then go to Parameter Store and create the following secret e.g

/dev/my-app/my-connection = postgresql://user:password@host:port/db-name

Create Prisma client

This generates a custom built Prisma client based on your schema

npx prisma generate

Run sample migration

This will create the desired tables for you

npx prisma migrate dev

Seed the DB

Next, create two users Alice and Bob

npm run db:seed

Deploy application to AWS Lambda

sls deploy

Test the service

Copy the API Gateway URL from the Serverless output in the console to Postman.

GET https://xxxxxxxxxx.execute-api.ap-southeast-2.amazonaws.com/dev/users/alice

Should return Alice:

{
    "id": 1,
    "email": "[email protected]",
    "name": "Alice"
}
You might also like...

Node, Typescript, PostgreSQL, Express

Objective Your challenge is to build out this full-stack todo app and get it looking as close to the design as possible. Brief Using the language spec

Oct 12, 2022

Demonstrating the Dashboard++ method of organizing a vault in Obsidian

Information This repository is an Obsidian vault that demonstrates using the Dashboard++ method for organizing and navigating notes. For further detai

Jan 3, 2023

A web app demonstrating how the Fourier series can be used to approximate user-inputted line drawing

Fourier Series Animation An interactive React web app that demonstrates how an arbitrary user-inputted line drawing can be approximated using the Four

Dec 22, 2022

WIP - Boilerplate for Node.js + TypeScript + Prisma + Serverless

Boilerplate Node.js + TypeScript for Serverless WIP - Boilerplate Node.js + TypeScript + Prisma + Serverless Setup Update project information In serve

Oct 16, 2022

RepoProvas API, a system for sharing tests between students, built with Typescript, Node.js, Express, Prisma and Postgres.

Repoprovas Built With 📋 Description RepoProvas API, a system for sharing tests between students, built with Typescript, Node.js, Express, Prisma and

Dec 13, 2022

An API built for an invoices manager app using TypeScript and Prisma with Node and Express.

Invoices App API An API built for the invoices manager app using TypeScript and Prisma with Node and Express. Run locally To run locally, you need to

Oct 17, 2022

Next.js + Tailwind + Typescript + Prisma + NextAuth starter project

This is a Next.js project bootstrapped with create-next-app. Getting Started First, run the development server: npm run dev # or yarn dev Open http://

Jan 3, 2023

Here's a RESTful API that interacts with a PostgreSQL database written in NodeJS with Typescript, RESTify, and Sequelize ORM.

Here's a RESTful API that interacts with a PostgreSQL database written in NodeJS with Typescript, RESTify, and Sequelize ORM.

Basic description REST (Representational State Transfer) is a standard architecture for building and communicating with web services, It typically man

Jan 14, 2022

This is boilerplate of express, typescript and postgreSql with typeorm and docker based setup

express-typescript-postgres-typeorm-docker-swagger-boilerplate This is boilerplate of express, typescript and postgreSql with typeorm and docker based

Jun 2, 2022
Owner
Christian Rich
Full-stack web developer with focus on Node.js, React and micro-services architecture. https://www.linkedin.com/in/christianrich/
Christian Rich
Remix TypeScript monorepo with Turborepo pipelines, Prisma, PostgreSQL, Docker deploy to Fly.io, pnpm, TailwindCSS and Tsyringe for DI.

Remix template with Turborepo, TypeScript and pnpm. The remix app deploys to fly.io or build to Docker image. Example packages for Database with prisma, Tsyringe dependency injection, UI, and internal TypeScript packages.

Philippe L'ATTENTION 33 Dec 29, 2022
A repository demonstrating functional techniques with C# 10 and the similarities between JavaScript, TypeScript, and C#.

Building up from JavaScript to TypeScript to C# 10 and .NET 6 This repository is meant to highlight some of the various functional techniques availabl

Charles Chen 67 Dec 30, 2022
Connect Web Integration illustrates the integration of Connect-Web in various JS frameworks and tooling

Connect Web Integration Connect Web Integration is a repository of example projects using Connect-Web with various JS frameworks and tooling. It provi

Buf 43 Dec 29, 2022
Prisma +2 generator to emit Yup schemas from your Prisma schema

Prisma Yup Generator Automatically generate Yup schemas from your Prisma Schema, and use them to validate your API endpoints or any other use you have

Omar Dulaimi 31 Dec 24, 2022
Prisma 2+ generator to emit Joi schemas from your Prisma schema

Prisma Joi Generator Automatically generate Joi schemas from your Prisma Schema, and use them to validate your API endpoints or any other use you have

Omar Dulaimi 26 Dec 24, 2022
Prisma +2 generator to emit a tRPC shield from your Prisma schema

Prisma tRPC Shield Generator Automatically generate a tRPC Shield from your Prisma Schema. Updates every time npx prisma generate runs. Table of Conte

Omar Dulaimi 27 Dec 24, 2022
Prisma 2+ generator to emit Zod schemas from your Prisma schema

Prisma Zod Generator Automatically generate Zod schemas from your Prisma Schema, and use them to validate your API endpoints or any other use you have

Omar Dulaimi 212 Dec 27, 2022
This is a library to alternate and self-host the Prisma Data Proxy (cloud.prisma.io)

Alternative Prisma Data Proxy This is a library to alternate and self-host the Prisma Data Proxy (cloud.prisma.io). In order to deploy your project to

AijiUejima 60 Dec 28, 2022
Open Horizon service container demonstrating Node-RED Object Detection

service-node-red-object-detection Open Horizon service container demonstrating Node-RED Object Detection. This is an Open Horizon configuration to dep

null 4 Dec 25, 2022
This project is an educational asset demonstrating the use of AWS amplify, Graphql API, Appsync, Material UI and amazon cognito. T

This project is an educational asset demonstrating the use of AWS amplify, Graphql API, Appsync, Material UI and amazon cognito. This project belongs to Black bird and this repo will remain dormant until final decision.

Shikhar 7 Oct 12, 2022