
Unzip the app bundle, open in VSCode, review dependencies (express, sequelize, sqlite, nodemailer, multer, cookie-parser), install with npm install, and run npm run dev to start the server.
Initialize a Sequelize ORM with SQLite storage and sync the user model to the database. Define user attributes like email, handle, name, and image, and set timestamps to false.
Add maintenance functionality with a config folder to manage database and email configurations. Implement database migrations to control schema evolution rather than Sequelize auto-creating the database.
Implement robust signup error handling by validating user input with express validator and custom logic, using a shared error handler and mapped exceptions, handling email failures, and rollback scenarios.
Ensure a unique handle by checking the user table for conflicts before saving. If needed, append a short id derived from the first UUID segment via a shared utility.
Learn to validate user input in a Node blog app using express validator, ensuring non-null, non-empty email before saving, and map validation errors to a clean 400 response.
Implement the auth endpoint by creating an auth router and service, validating the registration token, updating the user, returning a DTO, and issuing an http-only app token cookie.
Implement an opaque, unique login token by creating a tokens table related to users, generating and storing the token with sequelize, and returning it to the user.
Implement logout by deleting the app token from the database using a post logout endpoint, read via cookies, clear the cookie, and ensure no token remains for the user.
Create the article resource with endpoints for create, update, and publish, enforce user-article association via custom middleware, and verify that update or publish requests come from the article owner.
Implement article publish functionality by toggling the published flag and published_at for a given article, using a patch endpoint /api/articles/{id}/publish and owner validation.
Add a get article by id or slug endpoint that fetches a single article with content, determines id or slug, includes the user, and handles not found errors.
Learn to build an endpoint that lists a user's articles with optional unpublished content for the logged-in user, using id or handle, pagination, and shared query logic.
Configure environment-specific upload directories with config, join root paths, and implement upload directory creation in a Node app; apply to static content and routing, then test dev and prod.
Implement update user functionality with a secured, authenticated put endpoint at api/users/:id, validating name length and handling image data while enforcing ownership.
Add a get user endpoint to fetch a single user by handle. Return a user DTO or throw not found, and expose a non-authenticated route at api/users/:handle for client-side display.
Define a reaction schema to validate article reactions, including entity type, entity id, and category, then implement a toggle reaction endpoint that adds or removes the reaction.
Are you ready to take your Node JS skills to the next level by building a complete, real-world application from scratch? Welcome to "Portfolio Project: Blogging Application with Node JS"! This hands-on course is designed to provide you with practical experience in using Node JS to develop a fully functional blogging platform.
In this course, we focus on the practical implementation of Node JS, bypassing lengthy theoretical explanations. You'll dive straight into coding, using Sequelize for robust database interactions, including both simple and complex queries. We'll also cover essential migration functionalities to help you manage database schema changes efficiently.
Our application will be configured to run in multiple environments, ensuring that it is versatile and ready for production. You'll implement key features such as user authentication with sign-up and login functionalities, complete with email verification. All user requests will be rigorously validated to ensure security and reliability.
Centralized error handling will be another focus, helping you manage and debug errors effectively. The course will guide you through creating and managing articles, allowing authorized users to submit, update, or modify their published state. Additionally, you'll implement file upload functionality to handle static files seamlessly.
To enhance user engagement, we’ll include a reactions resource, enabling users to like or bookmark articles. Plus, you’ll get a client application to test and see your backend in action, ensuring a comprehensive learning experience.
This course aims to provide a complete understanding of building a robust application from start to finish. Whether you're a beginner or an experienced developer looking to refine your skills, this course has something for you. Join us now and start building something amazing with Node JS!