This is a Node/Express JS back-end app for issuing invoices by merchants of small businesses. The app handles registration for merchants and supports adding items and customers. Once there are items and customers, merchants can choose to generate invoices to save or send as email. Emails include a pdf of the invoice with a payment url which opens a payment portal. You can find front-end client for this app on invoice-app-client.
- Clone or download repository
- Go into the main app directory
- Install dependencies by running
npm install
- Run the application using
nodemon server
ornpm run server
- Express JS for routing http sequests
- Nodemon for automaticlly restarting server after editing.
- Mongoose for modeling data and connecting to database.
- BodyParser
- ejs for validating user requests with tokens.
- Bcrypt for generating and comparing password hashes.
- JsonWebToken for validating user requests with tokens.
- NodeMailer for sending invoice emails to customers.
- Stripe for handling secure payements.
- node-pdf-invoice for generating pdf invoices from json.
server.js
main entry in the app. Configures express server and main routes with corresponding controllers.models/
contains schema defenitions for users (merchants), customers, items, invoices and payments.controllers/
contains route controller for different models. For example the userController contains routes for adding, editing, authenticating users ...middleware/
contains middleware functions that validate requests.db/
contains configuration for Mongoose and MongoDB Atlasviews/
contains static files which are served for payments