Project Documentation
This is the documentation for Priyanshu's Blog, written by me — Priyanshu Anand. I'm building this platform as my BCA final-semester project (BCSP-064), and this page explains what I made, why, and how it works.
1. What I'm building
I'm building a complete, multi-user blogging website. Visitors can read and search published articles. Registered members can contribute their own posts — either by generating them with Artificial Intelligence or by writing them by hand in a rich-text editor. And as the administrator, I can manage the entire platform from a dedicated panel. Every article is automatically optimised for search engines, and I sanitise all content before it is published so the site renders safely.
2. My objectives
- Build a public blog website with browsing, live search and clean reading pages.
- Let members create blogs using AI (including long 2000+ word articles) or a manual editor.
- Automatically generate SEO data for every article I publish.
- Sanitise all content so it always renders safely.
- Give myself, as admin, full role-based control over users and content.
3. The technology I used
- Backend: Node.js with the Express.js framework.
- Views: EJS server-side templating.
- Database: MongoDB with the Mongoose ODM.
- AI: the Groq API (llama-3.3-70b-versatile) for content generation.
- Editor: a Quill rich-text editor for manual writing.
- Security: bcrypt password hashing, sessions stored in MongoDB, and HTML sanitisation.
- Images: free image APIs with the Sharp library for optimisation.
- Interface: a custom responsive UI with Font Awesome icons, glassmorphism and smooth animations.
4. The features I implemented
- Public site: a home feed, category pages, live "as-you-type" search and individual blog pages.
- AI generation: I turn a topic into a full SEO-ready article, with short to extra-long (2000+ word) options.
- Manual editor: headings, bold/italic/underline, lists, quotes, links, images and code blocks.
- Content status: every blog can be Published, kept as a Draft, or moved to Trash and restored — controlled by user role.
- SEO: a per-blog slug, meta description, keywords, Open Graph tags and a site sitemap.
- Admin panel: statistics, user management (ban / delete / create more admins), content moderation and editable API keys.
5. How the roles work
- Visitor: can browse, search and read published articles.
- Member: can create and manage their own blogs (publish, draft or trash).
- Administrator (me): has full control over users, content, statistics and system settings.
6. How it works behind the scenes
When a member submits a topic, I authenticate the request, call the Groq API to generate the article, attach SEO data and an optimised image, sanitise the content, and save the finished post to MongoDB before publishing it to the public feed. Manually written posts follow the same path after I sanitise their HTML. I oversee everything from the admin panel, which is protected by role-based access control so only administrators can reach it.