This repository contains a serverless application built with TypeScript and managed with npm and pnpm. The application uses the SST to manage the application infrastructure and Prisma for database access. The application also uses trpc for type-safe API calls.
The project is organized into several directories:
packages/core: This directory contains core business logic for the application. This wasn't used since this repo is just a demo of how to use trpc and prisma.packages/functions: This directory contains serverless functions for the application, including event handling and Prisma database access.layers/prisma: This directory contains the Prisma client for database access.prisma: This directory contains the Prisma schema for the application's database.stacks: This directory contains the AWS CDK stack definition for the application.
To use this application, you'll need to have Node.js, npm, and pnpm installed on your machine.
-
Clone the repository to your local machine.
-
Navigate to the project directory.
-
Create a .env file in the project directory with the following contents:
DATABASE_URL="YOUR_DATABASE_URL_HERE"
- Change the schema in
prisma/schema.prismato match your database schema. - Run
pnpm prisma generateto generate the Prisma client. - Run
pnpm installto install the project dependencies. - Run
pnpm sst devto start the application.
Please note that you may need to configure your AWS credentials and region before you can deploy the application.
Contributions are welcome! Please feel free to submit a pull request.
This project is licensed under the terms of the MIT license.