<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>himashu</title><description>portfolio</description><link>https://hxnshu.space/</link><templateTheme>Firefly</templateTheme><templateThemeVersion>6.10.2</templateThemeVersion><templateThemeUrl>https://github.com/CuteLeaf/Firefly</templateThemeUrl><lastBuildDate>May 10, 2026 at 12:28:19 PM</lastBuildDate><item><title>Microservices</title><link>https://hxnshu.space/posts/microservice/</link><guid isPermaLink="true">https://hxnshu.space/posts/microservice/</guid><description>microservices project using nodejs</description><pubDate>Tue, 03 Feb 2026 00:00:00 GMT</pubDate><content:encoded>&lt;a href=&quot;https://github.com/Himanshu121865/microservices&quot; target=&quot;_blank&quot;&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;Himanshu121865&lt;/div&gt;&lt;/div&gt;&lt;div&gt;/&lt;/div&gt;&lt;div&gt;microservices&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;Waiting for api.github.com...&lt;/div&gt;&lt;div&gt;&lt;div&gt;00K&lt;/div&gt;&lt;div&gt;0K&lt;/div&gt;&lt;div&gt;0K&lt;/div&gt;&lt;span&gt;Waiting...&lt;/span&gt;&lt;/div&gt;&lt;/a&gt;
&lt;section&gt;&lt;h1&gt;microservices&lt;a href=&quot;#microservices&quot;&gt;&lt;span&gt;#&lt;/span&gt;&lt;/a&gt;&lt;/h1&gt;&lt;p&gt;This repository contains a backend system for a social media platform, built using a microservices architecture. The project demonstrates the principles of breaking down a monolithic application into smaller, independently deployable services that communicate with each other over the network. The system is designed to be scalable, maintainable, and resilient.&lt;/p&gt;&lt;section&gt;&lt;h2&gt;Architecture Overview&lt;a href=&quot;#architecture-overview&quot;&gt;&lt;span&gt;#&lt;/span&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;The system is composed of five main services, each with a distinct responsibility. An &lt;strong&gt;API Gateway&lt;/strong&gt; acts as the single entry point for all client requests, routing them to the appropriate downstream service. Communication between services is handled asynchronously using a &lt;strong&gt;RabbitMQ&lt;/strong&gt; message broker, promoting loose coupling and enabling an event-driven architecture.&lt;/p&gt;&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;API Gateway&lt;/strong&gt;: The client-facing entry point. It handles request routing, authentication (JWT validation), rate limiting, and basic security.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Identity Service&lt;/strong&gt;: Manages all aspects of user identity, including registration, login, and token management (access and refresh tokens).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Post Service&lt;/strong&gt;: Responsible for creating, reading, and deleting user posts. It publishes events to RabbitMQ when posts are created or deleted.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Media Service&lt;/strong&gt;: Handles the upload and management of media files. It integrates with Cloudinary for storage and listens for &lt;code&gt;post.deleted&lt;/code&gt; events to perform media cleanup.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Search Service&lt;/strong&gt;: Provides full-text search capabilities for posts. It consumes &lt;code&gt;post.created&lt;/code&gt; and &lt;code&gt;post.deleted&lt;/code&gt; events to keep its search index synchronized.&lt;/li&gt;
&lt;/ul&gt;&lt;section&gt;&lt;h3&gt;Technology Stack&lt;a href=&quot;#technology-stack&quot;&gt;&lt;span&gt;#&lt;/span&gt;&lt;/a&gt;&lt;/h3&gt;&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Backend&lt;/strong&gt;: Node.js, Express.js&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Database&lt;/strong&gt;: MongoDB with Mongoose ODM&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Caching&lt;/strong&gt;: Redis&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Message Broker&lt;/strong&gt;: RabbitMQ&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Media Storage&lt;/strong&gt;: Cloudinary&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Authentication&lt;/strong&gt;: JSON Web Tokens (JWT), Argon2 for password hashing&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Containerization&lt;/strong&gt;: Docker&lt;/li&gt;
&lt;/ul&gt;&lt;/section&gt;&lt;/section&gt;&lt;section&gt;&lt;h2&gt;Services&lt;a href=&quot;#services&quot;&gt;&lt;span&gt;#&lt;/span&gt;&lt;/a&gt;&lt;/h2&gt;&lt;section&gt;&lt;h3&gt;1. API Gateway&lt;a href=&quot;#1-api-gateway&quot;&gt;&lt;span&gt;#&lt;/span&gt;&lt;/a&gt;&lt;/h3&gt;&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Responsibility&lt;/strong&gt;: Acts as a reverse proxy, routing incoming requests to the correct microservice. It is the sole entry point for the frontend.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Features&lt;/strong&gt;:
&lt;ul&gt;
&lt;li&gt;JWT validation for protecting routes.&lt;/li&gt;
&lt;li&gt;Rate limiting using Redis to prevent abuse.&lt;/li&gt;
&lt;li&gt;Request logging and error handling.&lt;/li&gt;
&lt;li&gt;Proxies requests to &lt;code&gt;identity-service&lt;/code&gt;, &lt;code&gt;post-service&lt;/code&gt;, &lt;code&gt;media-service&lt;/code&gt;, and &lt;code&gt;search-service&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;&lt;/section&gt;&lt;section&gt;&lt;h3&gt;2. Identity Service&lt;a href=&quot;#2-identity-service&quot;&gt;&lt;span&gt;#&lt;/span&gt;&lt;/a&gt;&lt;/h3&gt;&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Responsibility&lt;/strong&gt;: Manages user accounts and authentication.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Features&lt;/strong&gt;:
&lt;ul&gt;
&lt;li&gt;User registration with username, email, and hashed password (Argon2).&lt;/li&gt;
&lt;li&gt;User login and generation of JWT access and refresh tokens.&lt;/li&gt;
&lt;li&gt;Refresh token rotation and secure storage.&lt;/li&gt;
&lt;li&gt;User logout, which invalidates the refresh token.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;&lt;/section&gt;&lt;section&gt;&lt;h3&gt;3. Post Service&lt;a href=&quot;#3-post-service&quot;&gt;&lt;span&gt;#&lt;/span&gt;&lt;/a&gt;&lt;/h3&gt;&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Responsibility&lt;/strong&gt;: Manages the lifecycle of user posts.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Features&lt;/strong&gt;:
&lt;ul&gt;
&lt;li&gt;CRUD operations for posts (Create, Read, Delete).&lt;/li&gt;
&lt;li&gt;Caches post data in Redis to reduce database load.&lt;/li&gt;
&lt;li&gt;Publishes &lt;code&gt;post.created&lt;/code&gt; and &lt;code&gt;post.deleted&lt;/code&gt; events to RabbitMQ.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;&lt;/section&gt;&lt;section&gt;&lt;h3&gt;4. Media Service&lt;a href=&quot;#4-media-service&quot;&gt;&lt;span&gt;#&lt;/span&gt;&lt;/a&gt;&lt;/h3&gt;&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Responsibility&lt;/strong&gt;: Handles media file uploads and storage.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Features&lt;/strong&gt;:
&lt;ul&gt;
&lt;li&gt;Uploads files (images, videos) to Cloudinary.&lt;/li&gt;
&lt;li&gt;Uses &lt;code&gt;multer&lt;/code&gt; for handling multipart/form-data.&lt;/li&gt;
&lt;li&gt;Subscribes to &lt;code&gt;post.deleted&lt;/code&gt; events to delete associated media from Cloudinary, preventing orphaned files.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;&lt;/section&gt;&lt;section&gt;&lt;h3&gt;5. Search Service&lt;a href=&quot;#5-search-service&quot;&gt;&lt;span&gt;#&lt;/span&gt;&lt;/a&gt;&lt;/h3&gt;&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Responsibility&lt;/strong&gt;: Provides search functionality across all posts.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Features&lt;/strong&gt;:
&lt;ul&gt;
&lt;li&gt;Subscribes to &lt;code&gt;post.created&lt;/code&gt; and &lt;code&gt;post.deleted&lt;/code&gt; events to maintain a consistent search index.&lt;/li&gt;
&lt;li&gt;Uses MongoDB’s native text search capabilities to index and query post content.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;&lt;/section&gt;&lt;/section&gt;&lt;section&gt;&lt;h2&gt;Event-Driven Communication&lt;a href=&quot;#event-driven-communication&quot;&gt;&lt;span&gt;#&lt;/span&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;The services communicate asynchronously through a &lt;code&gt;facebook_events&lt;/code&gt; exchange in RabbitMQ.&lt;/p&gt;&lt;ul&gt;
&lt;li&gt;&lt;code&gt;post.created&lt;/code&gt;: Published by the &lt;strong&gt;Post Service&lt;/strong&gt; when a new post is created. It is consumed by the &lt;strong&gt;Search Service&lt;/strong&gt; to add the new post to its search index.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;post.deleted&lt;/code&gt;: Published by the &lt;strong&gt;Post Service&lt;/strong&gt; when a post is deleted. It is consumed by:
&lt;ul&gt;
&lt;li&gt;The &lt;strong&gt;Search Service&lt;/strong&gt; to remove the post from its index.&lt;/li&gt;
&lt;li&gt;The &lt;strong&gt;Media Service&lt;/strong&gt; to delete any associated media files from Cloudinary.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;&lt;/section&gt;&lt;section&gt;&lt;h2&gt;Setup and Running the Project&lt;a href=&quot;#setup-and-running-the-project&quot;&gt;&lt;span&gt;#&lt;/span&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Each service is containerized using Docker. To run the entire application, you will need Docker, Node.js, and npm installed.&lt;/p&gt;&lt;section&gt;&lt;h3&gt;Environment Variables&lt;a href=&quot;#environment-variables&quot;&gt;&lt;span&gt;#&lt;/span&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;Before running, create a &lt;code&gt;.env&lt;/code&gt; file in the root directory of each service (&lt;code&gt;api-gateway&lt;/code&gt;, &lt;code&gt;identity-service&lt;/code&gt;, etc.). Populate them with the necessary configuration.&lt;/p&gt;&lt;section&gt;&lt;h4&gt;Common Variables&lt;a href=&quot;#common-variables&quot;&gt;&lt;span&gt;#&lt;/span&gt;&lt;/a&gt;&lt;/h4&gt;&lt;ul&gt;
&lt;li&gt;&lt;code&gt;MONGO_URI&lt;/code&gt;: Your MongoDB connection string.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;RABBITMQ_URL&lt;/code&gt;: Your RabbitMQ connection string.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;REDIS_URL&lt;/code&gt;: Your Redis connection URL.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;PORT&lt;/code&gt;: The port for the service to run on (e.g., 3001, 3002).&lt;/li&gt;
&lt;/ul&gt;&lt;/section&gt;&lt;section&gt;&lt;h4&gt;Service-Specific Variables&lt;a href=&quot;#service-specific-variables&quot;&gt;&lt;span&gt;#&lt;/span&gt;&lt;/a&gt;&lt;/h4&gt;&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;api-gateway/.env&lt;/strong&gt;:
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;JWT_SECRET&lt;/code&gt;: Secret key for JWT signing.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;IDENTITY_SERVICE_URL=http://localhost:3001&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;POST_SERVICE_URL=http://localhost:3002&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;MEDIA_SERVICE_URL=http://localhost:3003&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;SEARCH_SERVICE_URL=http://localhost:3004&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;identity-service/.env&lt;/strong&gt;:
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;JWT_SECRET&lt;/code&gt;: Secret key for JWT signing (must match the gateway’s).&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;media-service/.env&lt;/strong&gt;:
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;CLOUDNAME&lt;/code&gt;: Your Cloudinary cloud name.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;API_KEY&lt;/code&gt;: Your Cloudinary API key.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;API_SECRET&lt;/code&gt;: Your Cloudinary API secret.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;&lt;/section&gt;&lt;/section&gt;&lt;section&gt;&lt;h3&gt;Running with Docker&lt;a href=&quot;#running-with-docker&quot;&gt;&lt;span&gt;#&lt;/span&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;For each service, navigate to its directory and run the following commands:&lt;/p&gt;&lt;div&gt;&lt;figure&gt;&lt;figcaption&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;Terminal window&lt;/span&gt;&lt;/figcaption&gt;&lt;pre&gt;&lt;code&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;1&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;# Example for api-gateway&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;2&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;cd&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;api-gateway&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;3&lt;/div&gt;&lt;/div&gt;&lt;div&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;4&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;# Build the Docker image&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;5&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;docker&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;build&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;-t&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;api-gateway&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;6&lt;/div&gt;&lt;/div&gt;&lt;div&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;7&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;# Run the Docker container&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;8&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;# Replace 3000 with the port you want to expose&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;9&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;docker&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;run&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;-p&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;3000:3000&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;--env-file&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;.env&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;api-gateway&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;&lt;p&gt;Repeat this process for all other services (&lt;code&gt;identity-service&lt;/code&gt;, &lt;code&gt;post-service&lt;/code&gt;, &lt;code&gt;media-service&lt;/code&gt;, &lt;code&gt;search-service&lt;/code&gt;), ensuring you map the correct ports as defined in your environment files.&lt;/p&gt;&lt;/section&gt;&lt;section&gt;&lt;h3&gt;Running Locally (without Docker)&lt;a href=&quot;#running-locally-without-docker&quot;&gt;&lt;span&gt;#&lt;/span&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;For each service, navigate to its directory and run:&lt;/p&gt;&lt;div&gt;&lt;figure&gt;&lt;figcaption&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;Terminal window&lt;/span&gt;&lt;/figcaption&gt;&lt;pre&gt;&lt;code&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;1&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;# Example for api-gateway&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;2&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;cd&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;api-gateway&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;3&lt;/div&gt;&lt;/div&gt;&lt;div&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;4&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;# Install dependencies&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;5&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;npm&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;install&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;6&lt;/div&gt;&lt;/div&gt;&lt;div&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;7&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;# Run in development mode (with nodemon)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;8&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;npm&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;run&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;dev&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;9&lt;/div&gt;&lt;/div&gt;&lt;div&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;10&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;# Or run in production mode&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;11&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;npm&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;start&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/div&gt;&lt;/section&gt;&lt;/section&gt;&lt;section&gt;&lt;h2&gt;API Endpoints&lt;a href=&quot;#api-endpoints&quot;&gt;&lt;span&gt;#&lt;/span&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;All endpoints are accessed through the API Gateway and are prefixed with &lt;code&gt;/v1&lt;/code&gt;.&lt;/p&gt;&lt;section&gt;&lt;h3&gt;Identity Service (&lt;code&gt;/v1/auth&lt;/code&gt;)&lt;a href=&quot;#identity-service-v1auth&quot;&gt;&lt;span&gt;#&lt;/span&gt;&lt;/a&gt;&lt;/h3&gt;&lt;ul&gt;
&lt;li&gt;&lt;code&gt;POST /register&lt;/code&gt;: Register a new user.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;POST /login&lt;/code&gt;: Log in a user and receive access/refresh tokens.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;POST /refresh-token&lt;/code&gt;: Obtain a new access token using a refresh token.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;POST /logout&lt;/code&gt;: Log out a user.&lt;/li&gt;
&lt;/ul&gt;&lt;/section&gt;&lt;section&gt;&lt;h3&gt;Post Service (&lt;code&gt;/v1/posts&lt;/code&gt;)&lt;a href=&quot;#post-service-v1posts&quot;&gt;&lt;span&gt;#&lt;/span&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;&lt;em&gt;All routes require authentication.&lt;/em&gt;&lt;/p&gt;&lt;ul&gt;
&lt;li&gt;&lt;code&gt;POST /create-post&lt;/code&gt;: Create a new post.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;GET /all-posts&lt;/code&gt;: Get a paginated list of all posts.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;GET /:id&lt;/code&gt;: Get a single post by its ID.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;DELETE /:id&lt;/code&gt;: Delete a post.&lt;/li&gt;
&lt;/ul&gt;&lt;/section&gt;&lt;section&gt;&lt;h3&gt;Media Service (&lt;code&gt;/v1/media&lt;/code&gt;)&lt;a href=&quot;#media-service-v1media&quot;&gt;&lt;span&gt;#&lt;/span&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;&lt;em&gt;All routes require authentication.&lt;/em&gt;&lt;/p&gt;&lt;ul&gt;
&lt;li&gt;&lt;code&gt;POST /upload&lt;/code&gt;: Upload a media file. Expects &lt;code&gt;multipart/form-data&lt;/code&gt; with a field named &lt;code&gt;file&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;&lt;/section&gt;&lt;section&gt;&lt;h3&gt;Search Service (&lt;code&gt;/v1/search&lt;/code&gt;)&lt;a href=&quot;#search-service-v1search&quot;&gt;&lt;span&gt;#&lt;/span&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p&gt;&lt;em&gt;All routes require authentication.&lt;/em&gt;&lt;/p&gt;&lt;ul&gt;
&lt;li&gt;&lt;code&gt;GET /posts?query=&amp;lt;search_term&amp;gt;&lt;/code&gt;: Search for posts matching the query term.&lt;/li&gt;
&lt;/ul&gt;&lt;/section&gt;&lt;/section&gt;&lt;section&gt;&lt;h2&gt;License&lt;a href=&quot;#license&quot;&gt;&lt;span&gt;#&lt;/span&gt;&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;This project is licensed under the MIT License. See the &lt;a href=&quot;LICENSE&quot;&gt;LICENSE&lt;/a&gt; file for details.&lt;/p&gt;&lt;/section&gt;&lt;/section&gt;</content:encoded></item></channel></rss>