Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/teotimepacreau/express-newsletter
Newsletter project built with NodeJS, Express and SQLite
https://github.com/teotimepacreau/express-newsletter
express newsletter nodejs sqlite
Last synced: about 6 hours ago
JSON representation
Newsletter project built with NodeJS, Express and SQLite
- Host: GitHub
- URL: https://github.com/teotimepacreau/express-newsletter
- Owner: teotimepacreau
- Created: 2023-08-30T18:04:54.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2023-09-12T16:30:34.000Z (over 1 year ago)
- Last Synced: 2023-09-13T01:57:46.382Z (over 1 year ago)
- Topics: express, newsletter, nodejs, sqlite
- Language: JavaScript
- Homepage:
- Size: 2.44 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Express-Newsletter
A fully functional newsletter website, where you can subscribe and receive a welcoming email, and then receive periodically the newsletter. It also allows unsubscribing through a dedicated page.https://github.com/teotimepacreau/Express-Newsletter/assets/95431443/d6b3c398-e79c-48a6-b961-0542f5622d6c
# 🛠️ Built with :
- CSS : all UI design is from me, container queries, variable font, grid, flexbox...
- HTML : form best practice and validation, semantic...
- Javascript : async/await, fetch API
- NodeJS
- Express
- SQLite database and SQL queries# What I learned :
- how to use Express
- create and manage SQL database
- handle HTTP requests and responses
- work asynchronously and handle errors in Node.JS
- setup backend routes and controllers
- HTML emails (different support rules of the mail clients, specific CSS rules applying to it...)
- create templating for content
- organize a front-in-back architecture
- deploy a front-in-back on an online server# In-depth details of the project :
1. Subscription logic : Users can subscribe on homepage by filling and sending the form : lastName, firstName and email are added to SQLite Database. A notif confirms or infirms the subscription. An email confirms subscription and welcome new user.
2. Unsubscription logic : Users can unsubscribe on the /unsubscribe page. It updates the database accordingly by removing. Checks if email is already in the DB, if not sends an error notif to user
3. Newsletter Templates :
- Each newsletter is created within a template using handlebars
4. Composing Newsletters :
- Each newsletter dynamically retrieve lastName and firstName to personalize the mail
5. Sending newsletter :
- Middleware retrieve subscribers' information from the SQL DB
- Sendgrid npm package is used to send newsletters to the subscribers.
6. Allowing the client to render the email in browser :
- implemented a route that takes a query parameter to decide to render the "welcomeEmail" or the "newsletter" in a new tab.
7. Scheduling Newsletter Sending:
- Nodecron can send newsletters every Saturday. Not activating the function to not pollute email boxes of people trying the deployed version.
9. Deploy on fly.io