Coder Social home page Coder Social logo

mandava / saas-express-starter-kit Goto Github PK

View Code? Open in Web Editor NEW

This project forked from makeitcount/saas-express-starter-kit

1.0 0.0 0.0 273 KB

A boilerplate for any real world SaaS with features such as authentication, email service, etc.

License: MIT License

Shell 2.82% JavaScript 52.11% CSS 0.88% Dockerfile 0.64% EJS 43.55%

saas-express-starter-kit's Introduction

Web SaaS Starter Kit - Node.js, Express

Boilerplate for a web app with common features that every SaaS(Software as a Service) needs

Every time, I wanted to build a new web app, I used to code everything from scratch. Login, signup, session management, email notifications, and whatnot. Eventually, when I had found the right tools and code for everything, I kept that as a starter template for myself so I wouldn't need to solve the challenges that I had already solved.

Am I the only person who needs these features for a new project? Or does everyone needs the same features in their web-based SaaS tool? Why not open-source this and let everyone bootstrap their projects with this template!

I hope, this saves some time and helps you invest your time and energy in making system design and programming decisions that are unique to your SaaS web app. Start a project a little ahead of the starting line, where some common features are already implemented and well tested.

Features

  • Signup and signin
  • Session management
  • Reset password
  • Email notifications EmailService.sendEmail()
  • Queues and jobs WorkerService.addJob
  • Cron jobs WorkerService.addCronJob
  • Feature flagging
  • Single file to configure features(e.g. API keys, settings)

Made to last long

For most of these features, I have used other stable and well-maintained open-source projects. So you don't need to rely on me to keep this starter kit up-to-date(well, except updating once in a while, which I can certainly find time for).

Get started

  • Clone this repo
  • npm install
  • Update the config for development (config/development.env)
  • For email templates, we use MJML. To update them, update the views/email-templates/**/html.mjml file and export it to html.ejs in the same folder. For which you can either use editor plugins such as vscode-mjml or mjml javascript library
  • Make your changes to the code
  • npm start

Folder structure

  • app.js - The main file that spawns the server
  • routes - You may call it controller as well. The purpose of this code is to route requests to appropriate service after validation
  • middleware - Different routes want to apply some common logic before the request is processed e.g. "is this a request from an authenticated user?". This folder contains code for those common things you want to do before the request is processed. If you know express, you know this already. If not, check routes/auth.js to see how you can call a middleware on a route.
  • services - The purpose of this code is to make request to database or external APIs. Controllers(routes) and other services use the services available here
  • views - Frontend html code. We use ejs here as the templating langugage
  • views/email-templates - All the email templates written in mjml and then exported to ejs
  • public - Frontend side assets including styles and javascript code
  • config - The configurations, you'll likely want to change to suit your project

Configuration

  • Update them at config/development.js or config/production.js
  • SITE_DOMAIN_URL
  • SITE_TITLE
  • REPO_URL
  • SUPERTOKENS_CORE_URI
  • SUPERTOKENS_CORE_API_KEY

Checklist for production deployment

  1. Update the config for production (config/production.env)
  2. Make sure to run the server with NODE_ENV=production (e.g. node app.js --prod)

Made with awesome open-source projects ๐Ÿ‘‰ express, cors, morgan, nodemailer, mjml, supertokens and more

License - MIT

saas-express-starter-kit's People

Contributors

makeitcount avatar

Stargazers

 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.