Demonstrates full-stack development, authentication, and security best practices with real-world users actively engaging with the platform.
A secure, full-stack blogging platform built with Angular and Node.js. Features strict role-based authentication, allowing developers to publish and manage technical content professionally.
Angular
Node.js
MongoDB
TypeScript
Html
MaterialUI
CSS


Code Blog is a secure, full-stack blogging platform designed for developers to create, share, and discover technical articles. Built with Angular on the frontend and Node.js/Express on the backend, the platform empowers users to publish content while maintaining strict role-based authorization and authentication.
Securing a single-page app (SPA) involves complex hurdles:
Maintaining login state without insecure `localStorage`.
Guarding admin routes from unauthorized users.
Attaching tokens to requests without code duplication.
Handling token expiration seamlessly.
The architecture followed MVC (Model-View-Controller) pattern:
Node.js with Express for API, MongoDB with Mongoose for data
Angular with modular component structure and service-based architecture
JWT tokens with Angular guards and interceptors
RxJS for reactive data flow
Vercel for frontend, Render for backend
Implemented AuthService with refresh token logic and localStorage persistence with expiration checks
Used Angular interceptors to globally handle errors and attach JWT tokens, implemented proper loading state management
Applied Angular Flex Layout and custom CSS Grid for adaptive layouts with extensive device testing
Configured CORS properly, used environment variables for API endpoints, set up CI/CD pipelines
| Method | Endpoint | Description | Auth |
|---|---|---|---|
| POST | /api/auth/register | Register a new user | Public |
| POST | /api/auth/login | Login user and return JWT | Public |
| GET | /api/users/profile | Get logged-in user's profile | Required |
| PUT | /api/users/profile | Update logged-in user's profile | Required |
| GET | /api/posts | Get all blog posts (paginated) | Public |
| GET | /api/posts/:id | Get a single blog post by ID | Public |
| POST | /api/posts | Create a new blog post | Required |
| PUT | /api/posts/:id | Edit a blog post | Required |
| DELETE | /api/posts/:id | Delete a blog post | Required |
| POST | /api/upload | Upload an image | Required |
$ cd backend && npm install && npm start; cd frontend && npm install && ng serveEstablished a reusable authentication pattern used in all subsequent projects, drastically reducing setup time. The project proved the ability to ship a full-stack feature set from concept to deployed product.