https://github.com/toreylittlefield/serverless-mailer
https://github.com/toreylittlefield/serverless-mailer
netlify nodemailer serverless turso typescript vitest
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/toreylittlefield/serverless-mailer
- Owner: toreylittlefield
- Created: 2024-04-16T10:58:37.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2024-06-23T16:09:56.000Z (almost 2 years ago)
- Last Synced: 2025-02-01T12:14:27.209Z (about 1 year ago)
- Topics: netlify, nodemailer, serverless, turso, typescript, vitest
- Language: TypeScript
- Homepage:
- Size: 340 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Serverless Mailer
A simple email sender using nodemailer and Turso database.
- Nodemailer is used to send emails.
- Turso database is used to store email templates.
- Netlify to host the serverless functions and is AWS Lambda compatible.
## Installation
```bash
pnpm install # Install the dependencies
```
## Usage
### Environment Variables
Create a `.env` file in the root directory and add the following environment variables or use npx/pndm dlx to create the `.env` file.
See https://www.dotenv.org/docs/quickstart for CLI commands
Example:
```bash
pnpm dlx dotenv-vault@latest push # push to dotenv-vault
pnpm dlx dotenv-vault@latest pull # pull from dotenv-vault
```
See list of `pnpm run env:` commands in the `package.json` file.
---
## Turso Database
Turso is a simple database that uses SQLite3. It has a generous free tier.
See https://turso.tech/ for more information.
You can use the Turso database to store email templates.
Open the `./scripts/db.ts` file to create the database and tables.
```bash
pnpm run db:create # Create the database
```
Modify the `dump.sql` file to change the database schema and/or populate the tables.
---
## Local Development
```bash
pnpm run dev # Start the server
```
---
## Build
```bash
pnpm run build # Build the project
```
Output will be in the `./dist` directory.
---
## Test
```bash
pnpm run test # Run the tests
```
### Coverage
```bash
pnpm run coverage # Run the tests with coverage
```
---
## Deploy to Netlify from CLI (Optional)
```bash
pnpm run deploy # Deploy to Netlify
```
or push to your repository and Netlify will automatically deploy the changes.