Why βπ€
After each online coaching sessions, at the beginning, that was a pain to find a good invoice generator platform as I was not yet ready for a 20β¬ monthly subscription just for handling the invoice part.
None was enough flexible for my own use π so.. I decided to build my own mini-invoice generator with Node Js β ( that took approx 1h max βοΈ )
No more talk..Straight to the point πͺπΌ
The main parts βοΈ:
1. Storing clients in Json :
Yep that one is simple..for now x)
(Note: these are fictional characters of course π )
2. Creating the route:
Using express router, just create a POST /invoice route.
const router = express.Router();
router.post('/', handleCreateInvoice);
Then add the Joi Schema. Why ? It allows to define schema and validate the schema before calling the controller/handler of invoice creation.
Source: https://joi.dev/
3. Handling the invoice creation:
I used the module pdf-kit to generate the pdf to be sent to the client.
4. Email sending:
A small function using gmail-send
npm module which accepts html as an input
Yep..so what about the result ?
A snapshot of my first trials ^^ ( yep that email should be more personnalized and better structure π )
Next steps:
- Front-end ( React π€ )
- Database πΏ
- make it online x)
- Iterate π
And you πͺπΌ?
Tell us in the comments which mini-project you built ππ
Wanna support me ?
I am blogging during my free time ^^ like most people on this platform π however I'm not against a small coffee if you want to support me πͺπΌ Link below:
P.S: I added the sample on Github ( https://github.com/njivaolafpro/invoice-management-sample
Top comments (28)
i built a mini project for knowing new chapters of mangΓ‘s in site and warn in my channel in discord when has new releases, basically my project did web scraping in specific web page.
github.com/laurencioScript/sakamot...
nice ^^ would love having an english version of the README though :/
Cool project.
thanks ^^ was just a small hobby ^^
Any link to the code?
Can you please share a sample PDF.
yep...I just edited the post to add the github link.
github.com/njivaolafpro/invoice-ma...
You could try to connect it to Toggl Track via their API.
Keep track of time, projects, clients etc.
Good idea ^^ will try that one ;) thanks
good read
Thanks for writing
no prob ;)
Nice work
thanks x)
How does one know the right library to use in this case of generation
for the pdf generation, there are some on npm, I usually use the most stable with a good community ;)
( I tend to avoid html -> pdf as there are some bugs in the zooming part )
Wow! Thanks
no prob ;)
So Nice!
A good short that goes straight to the main point. Hope you'll open source the project.
thanks ^^
It is on git
github.com/njivaolafpro/invoice-ma...
( need to clean up a bit the doc though ;) )
Awesome article.
thank you ^^
Glad I came across this.
Thanks for sharing, @ IDURAR , we use are using node.js react.js & redux
Here Tutorial about : π Building and Generate Invoice PDF with React.js , Redux and Node.js : dev.to/idurar/building-an-invoice-...
@ IDURAR , we use are using node.js react.js & redux
Here Tutorial about : π Building and Generate Invoice PDF with React.js , Redux and Node.js : dev.to/idurar/building-an-invoice-...