{"id":26491911,"url":"https://github.com/karprabha/blog-api","last_synced_at":"2026-04-09T15:42:53.342Z","repository":{"id":199571129,"uuid":"699842986","full_name":"karprabha/blog-api","owner":"karprabha","description":"CodeGeekCentral is a JAMstack-powered platform, empowers users to share their thoughts, explore exciting content, and engage with the community.","archived":false,"fork":false,"pushed_at":"2024-01-02T09:01:55.000Z","size":3421,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-01-02T10:24:08.863Z","etag":null,"topics":["express-validator","expressjs","jwt","jwt-token","mongodb","nextjs13","nodejs","react","react-router-v6","reactjs","rest-api","restful-api","tailwindcss","vite"],"latest_commit_sha":null,"homepage":"https://codegeekcentral.vercel.app/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/karprabha.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null}},"created_at":"2023-10-03T13:01:23.000Z","updated_at":"2023-11-03T09:18:35.000Z","dependencies_parsed_at":"2023-10-18T19:36:59.383Z","dependency_job_id":"738af14d-4472-45b2-ba7c-830c3aff389a","html_url":"https://github.com/karprabha/blog-api","commit_stats":null,"previous_names":["karprabha/blog-api"],"tags_count":0,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karprabha%2Fblog-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karprabha%2Fblog-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karprabha%2Fblog-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karprabha%2Fblog-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/karprabha","download_url":"https://codeload.github.com/karprabha/blog-api/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244583173,"owners_count":20476233,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["express-validator","expressjs","jwt","jwt-token","mongodb","nextjs13","nodejs","react","react-router-v6","reactjs","rest-api","restful-api","tailwindcss","vite"],"created_at":"2025-03-20T08:51:13.360Z","updated_at":"2025-12-30T18:53:41.806Z","avatar_url":"https://github.com/karprabha.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CodeGeekCentral - Your Ultimate Blogging Platform\n\n![CodeGeekCentral Logo](./docs/images/codegeekcentral-logo.png)\n\n-   [Project Overview](#project-overview)\n-   [Quick Links](#quick-links)\n-   [Backend](#backend)\n    -   [API Endpoints](#api-endpoints)\n    -   [Technical Details](#technical-details)\n-   [Frontend: CodeGeekCentral-CMS](#frontend-codegeekcentral-cms)\n    -   [Key Features](#key-features)\n-   [Frontend: CodeGeekCentral (Main Site)](#frontend-codegeekcentral-main-site)\n    -   [SSR and SEO](#ssr-and-seo)\n-   [Upcoming Features](#upcoming-features)\n-   [Dependency Graph](#dependency-graph)\n    -   [Backend](#backend-dependency)\n    -   [CMS](#cms-dependency)\n    -   [Main Site](#main-site-dependency)\n-   [Contributing](#contributing)\n    -   [Setting Up the Development Environment](#setting-up-the-development-environment)\n        -   [Backend](#backend-setup)\n        -   [CMS](#cms-setup)\n        -   [Main Site](#main-site-setup)\n-   [Credits](#credits)\n\n## Project Overview\n\nWelcome to CodeGeekCentral, your comprehensive blogging platform that brings together bloggers, readers, and content enthusiasts. CodeGeekCentral is a JAMstack-powered platform, empowers users to share their thoughts, explore exciting content, and engage with the community. Whether you're a seasoned writer or an avid reader, CodeGeekCentral is your go-to destination for all things blogs.\n\n![CodeGeekCentral Home](./docs/images/1.png)\n\n### Quick Links\n\n-   [Main Site](https://codegeekcentral.vercel.app/)\n-   [CMS (Content Management System)](https://codegeekcentral-cms.netlify.app/)\n-   [API Documentation](https://documenter.getpostman.com/view/27019239/2s9YR3cFq2)\n\n## Backend\n\nCodeGeekCentral's backend is built with Node.js, Express.js, and MongoDB. It offers a set of powerful API endpoints to manage users, blogs, comments, authentication, and file uploads.\n\n### API Endpoints\n\n1. User Endpoint\n2. Blogs Endpoint\n3. Comments Endpoint\n4. Auth Endpoint\n5. Upload Endpoint\n\nFor detailed information about each endpoint, refer to our [Postman API Documentation](https://documenter.getpostman.com/view/27019239/2s9YR3cFq2).\n\n### Technical Details\n\n-   **Authentication**: Secure authentication with JWT. Refresh tokens are stored in HTTP-only cookies, and access tokens are included in API responses.\n-   **Security Measures**: Robust query sanitization, data validation using Express Validator, and cascade delete for dependent Mongoose models.\n-   **File Upload**: Utilizes Multer for server-side file processing, validation, and Cloudinary integration for storing and processing images.\n-   **Role-Based Access Control (RBAC)**: Assigning roles to users for access control.\n-   **Performance**: Implementing indexing for efficient data retrieval. Supports pagination for large datasets.\n-   **Hosting**: The server is hosted on [CodeGeekCentral Server](https://codegeekcentral.onrender.com).\n\n## Frontend: CodeGeekCentral-CMS\n\nCodeGeekCentral's Content Management System (CMS) is built with Vite-React, TypeScript, React Router, and Tailwind CSS. It provides a user-friendly interface for bloggers to manage their content and profile.\n\n### Key Features\n\n-   **Routes**: Extensive routing for user authentication, profile management, blog creation, editing, and more.\n-   **Validation**: Comprehensive form validation to ensure data integrity and security.\n-   **State Management**: Access tokens stored securely in state for protection against XSS and CSRF.\n-   **Custom Hooks**: Utilizes custom hooks for improved code organization.\n-   **Profile Section**: Supports profile avatar upload with URL or file upload options.\n-   **User Access Control**: Strict access control ensures only authors can edit their posts.\n\n## Frontend: CodeGeekCentral (Main Site)\n\nCodeGeekCentral's main site is built with Next.js, offering SEO-friendly routes and features like SSG, ISR, and SSR for optimal performance.\n\n### SSR and SEO\n\n-   **Routes**: Optimized for reading and commenting.\n-   **SSG**: Key routes are statically generated for efficient delivery.\n-   **Revalidation Time**: Frequent data change routes revalidate every 1 minute, while blogs revalidate every 1 hour.\n\n## Upcoming Features\n\nWe have exciting plans for the future, including:\n\n-   **Search and Discovery**: Implement advanced search and discovery functionalities to help users find relevant content.\n-   **Featured Section**: Showcase top-rated and handpicked blog posts to provide users with a curated reading experience.\n\n## Dependency Graph\n\n### Backend Dependency\n\n![Backend Dependency Graph](./backend/dependency-graph.svg)\n\n### CMS Dependency\n\n![CMS Dependency Graph](./frontend/cms/dependency-graph.svg)\n\n### Main Site Dependency\n\n![Main Site Dependency Graph](./frontend/codegeekcentral/dependency-graph.svg)\n\n## Contributing\n\nWe welcome contributions from the community! If you'd like to get involved, please follow our [Contribution Guidelines](./CONTRIBUTING.md) to help us improve CodeGeekCentral.\n\n## Setting Up the Development Environment\n\n### Backend Setup\n\nIf you intend to work on the backend of CodeGeekCentral, follow these steps:\n\n1. Clone the [CodeGeekCentral repository](https://github.com/karprabha/blog-api):\n\n    ```bash\n    git clone https://github.com/karprabha/blog-api\n    ```\n\n2. Change your working directory to the backend:\n\n    ```bash\n    cd blog-api/backend\n    ```\n\n3. Rename the \\`**.env.example**\\` file to \\`**.env**\\` and configure the following environment variables:\n\n    ```env\n    MONGODB_URI=your_mongodb_uri\n    CLOUDINARY_CLOUD_NAME=your_cloudinary_cloud_name\n    CLOUDINARY_API_KEY=your_cloudinary_api_key\n    CLOUDINARY_API_SECRET=your_cloudinary_api_secret\n    JWT_SECRET=your_jwt_secret\n    REFRESH_TOKEN_SECRET=your_refresh_token_secret\n    ACCESS_TOKEN_EXPIRY=your_access_token_expiry\n    REFRESH_TOKEN_EXPIRY=your_refresh_token_expiry\n    COOKIE_MAX_AGE=your_cookie_max_age\n    NODE_ENV=development\n    MORGAN_LOG_FORMAT=dev\n    CMS_URI=http://localhost:5173\n    CLIENT_URI=http://localhost:5000\n    ```\n\n4. Generate new values for JWT_SECRET and REFRESH_TOKEN_SECRET using:\n\n    ```bash\n    node -e \"console.log(require('crypto').randomBytes(64).toString('hex'))\"\n    ```\n\n5. To start the development server, run:\n\n    ```bash\n    npm run dev\n    ```\n\n### CMS Setup\n\nFor CMS development, these are the steps:\n\n1. Clone the [CodeGeekCentral repository](https://github.com/karprabha/blog-api):\n\n    ```bash\n    git clone https://github.com/karprabha/blog-api\n    ```\n\n2. Change your working directory to the CMS frontend:\n\n    ```bash\n    cd blog-api/frontend/cms\n    ```\n\n3. Rename the \\`**.env.example**\\` file to \\`**.env**\\` and set your environment variables:\n\n    ```env\n    VITE_API_URI=http://localhost:3000\n    VITE_DEMO_USERNAME=your_demo_username\n    VITE_DEMO_PASSWORD=your_demo_password\n    ```\n\n4. To start the development server, run:\n\n    ```bash\n    npm start\n    ```\n\n### Main Site Setup\n\nFor working on the main site:\n\n1. Clone the [CodeGeekCentral repository](https://github.com/karprabha/blog-api):\n\n    ```bash\n    git clone https://github.com/karprabha/blog-api\n    ```\n\n2. Change your working directory to the main site frontend:\n\n    ```bash\n    cd blog-api/frontend/codegeekcentral\n    ```\n\n3. Rename the \\`**.env.local.example**\\` file to \\`**.env.local**\\` and configure the following environment variables:\n\n    ```env\n    NEXT_PUBLIC_API_URI=http://localhost:3000\n    NEXT_PUBLIC_GA_MEASUREMENT_ID=your_ga_measurement_id\n    ```\n\n4. To start the server, run:\n\n    ```bash\n    npm run dev\n    ```\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](./LICENSE) file for details.\n\n## Credits\n\nWe'd like to express our gratitude to the following resources:\n\n-   **Cloudinary**: We've utilized [Cloudinary](https://cloudinary.com/) to manage files like user avatar.\n\nYour contributions have made this project truly special!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkarprabha%2Fblog-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkarprabha%2Fblog-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkarprabha%2Fblog-api/lists"}