This repository houses a Docker-enabled-Nodejs/Typescript-MongoDB backend for a personal project of mine - CrossBlog 🔀
The project follows REST Principles and Folder structure, alongwith some basic Tests.
Note - This is a work in progress. The Frontend is yet to be made
CrossBlog 🔀 is my personal Blog management system/dashboard.
Often times, bloggers/writers write blog posts on one platform.
- They then promote the blog post as they usually would.
- A few days or a week later, when traffic is dying down, they syndicate the post or crosspost on Medium, or Dev.to, or Hashnode.
Anyone who has done it before can tell you, it’s tedious and somewhat annoying to do. Part of the reason for this is - the respective blogging platforms don’t make it easy to import robust content automatically. You have to go through and copy-and-paste everything, format it using their tools, and generally reconstruct the entire post every time.
CrossBlog
provides a Markdown
editor and previewer where I can write my blog posts using Markdown. Once I have written my post, I can save it on my database.
If the post is done with all the editing, I can publish on multiple blogging platforms that support Markdown content (eg. Medium, Dev.to, Hashnode, etc) with just a few clicks.
In order to publish on multiple platforms, I am making use of their APIs.
- create blog posts using Markdown and save them
- edit saved blog posts
- invite friends/collaborators to preview the posts
- allow previewers to comment, like on posts
- give editor level access to collaborators, proofreaders, etc.
- publish blog posts on multiple blogging platforms (Medium, Dev.to)
To run the cloned codebase directly, you need to have Node.js and Docker installed.
- Run
npm i
to install dependencies. - Run
sudo docker-compose up -d
to get a MongoDB instance running. - Make your own
.env
file in the project root, following the key name but not value used in.env.example
. - From there, any the following should work:
npm run test
npm run test-debug
npm start
npm run debug
"scripts": {
"start": "tsc && node --unhandled-rejections=strict ./dist/app.js",
"debug": "export DEBUG=* && npm start",
"test": "mocha -r ts-node/register 'test/**/*.test.ts' --unhandled-rejections=strict",
"test-debug": "export DEBUG=* && npm test"
},
- Add invite functionality.
- Create separate databases for test and production cases.
- Write documentation for the APIs.