Skip to content

qasim2020/playground

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Playground is a mini-CMS, where I host my websites. Techstack includes Nodejs, MongoDB, Handlebars and Pjax.

Screenshot 2024-10-17 at 12 55 39 AM

Benefits

  • CMS - Content Management System - Content is "data" and "modules". For example, "SendMail" module is written & maintained once, and it works for all the websites hosted on CMS. Now next time I am building a website, I do not need to copy paste the code. You just need to call this module, and it is available to you. Nice ;).
  • It is easier to work on a single project (this CMS is one project). Code doesn't go lost in the void. Before building it, everytime I wrote my million dollar idea, some days later it just goes lost in the void. So, some actual workable ideas goes flat with that.
  • Do all of that in 6 USD Digital Ocean droplet (I started with this benefit in mind, but now realise there are other ways too to save money - humbled).

Kinds of request you can make to playground

How it works

All requests reaching the server are formatted in following syntax;

app.get(
'/:brand/:permit/:requiredType/:module/:input', 
replyFunction 
);
  1. :brand is a brand's unique key. The website unique key (for example 7am) in this url :- https://7amuniforms.com/7am/data/page/landingPage/n.
  2. :permit is the request authentication type. It has three types; gen, auth, admin. Gen is general level request. Auth is for owners of the website. And Admin is for the super admins.
  3. :requiredType is the type of request you are making to the website. It has three types also; page, data, and pjax. Page is when user wants the rendered website. Data is when user is looking only for the data (the JSON). and Pjax is when he is looking for a portion of the website.
  4. :module is the name of the module. For example, when sending mail, the sendMail module in the server is accessible. Just send the email, mail text, email template and it sends the email to website owner's email address (or ship a newsletters to many subscribers).
  5. :input is the kind of input that you send to the module. For example showBlog module takes the blog-slug as its input. Slug is a unique identifier for each blog post in the database.
  • replyFunction then constructs a webPage || a data object || a pjax page and returns the website to the client.

This is a work in progress...

Leave a comment, some feedback, that you think can help me improve my code.

About

CMS built on Mongodb, Nodejs, Handlebars to ease content updation, and start working on new projects.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •