Coder Social home page Coder Social logo

elijah-hensel / cope-notes-emailer Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 2.53 MB

This is a small email generation application. There is a front end that accepts user input for sign up and a node script, that when run, will send emails with a random message from a list of predetermined message objects.

JavaScript 84.54% CSS 15.46%

cope-notes-emailer's Introduction

Random Email Generator

Overview

This is a small email generation application. There is a front end that accepts user input for sign up and a node script, that when run, will send emails with a random message from a list of predetermined message objects.

Software Versions Used

Tech Version Notes
Node.js 18.7.17
React 18.2.0
Prisma ^4.3.1
Express ^4.18.1
Next 12.3.0
MySQL ^2.18.1

Application Setup for Local Development

First install all dependencies: npm install

To test that the application is installed locally and correctly, run: npm run dev

Once this command is run, you can open the application at localhost:3000

Set ENV variables

Create a .env file by running the following in your applications directory:

touch .env

Enter the following environment variables into your new .env file:

sender=<email address to be sent from>

HOSTNAME=localhost
SERVER_PORT=<Port your local server is running on>
HOST=http://$HOSTNAME:$SERVER_PORT

Running Prisma

This application is set up to use Prisma ORM and a local dev.db file to contain users and messages To get the database running in your local environment, as well as to display the Prisma UI in your browser, follow these instructions:

โ—๏ธ For the following steps, open a second terminal

npm install prisma --save-dev
npx prisma db push  (db may already be in sync with project)
npm run seed
npx prisma studio

Note: npx prisma studio will open Prisma's UI dashboard at localhost:5555

๐Ÿšจ 3 users and 10 messages will be created

note: you can use the frontend to create more users if you'd like

โ—๏ธ For the following steps, open a third terminal

Install NodeMailer

This application unitilizes nodemailer to process the request to send emails in an "easy as cake" way.

npm install nodemailer

Install MailHog

This application is set up to use mailhog SMTP as it's email transaction manager.

Install mailhog locally by running:

MacOS

brew update && brew install mailhog

other

sudo apt-get -y install golang-go
go get github.com/mailhog/MailHog

Then: run mailhog to start mail server

mailhog runs on http://localhost:8025/

Running sendMailers script

in a new terminal run npm run send-mail and watch the magic happen

cope-notes-emailer's People

Contributors

elijah-hensel avatar

Watchers

 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.