{"id":30733726,"url":"https://github.com/poetryofcode/blogging-platform","last_synced_at":"2025-09-03T18:51:12.590Z","repository":{"id":181075407,"uuid":"666178853","full_name":"poetryofcode/Blogging-Platform","owner":"poetryofcode","description":null,"archived":false,"fork":false,"pushed_at":"2023-07-14T23:19:05.000Z","size":38,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-30T15:33:43.444Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/poetryofcode.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-07-13T22:44:19.000Z","updated_at":"2024-04-22T13:37:49.000Z","dependencies_parsed_at":"2024-06-02T03:45:22.050Z","dependency_job_id":"8664090b-2f8f-4f53-a660-967e866cf20f","html_url":"https://github.com/poetryofcode/Blogging-Platform","commit_stats":null,"previous_names":["vitalipri/blogging-platform","codeofpoetry/blogging-platform","craftingweb/blogging-platform","poetryofcode/blogging-platform"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/poetryofcode/Blogging-Platform","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/poetryofcode%2FBlogging-Platform","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/poetryofcode%2FBlogging-Platform/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/poetryofcode%2FBlogging-Platform/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/poetryofcode%2FBlogging-Platform/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/poetryofcode","download_url":"https://codeload.github.com/poetryofcode/Blogging-Platform/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/poetryofcode%2FBlogging-Platform/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273492843,"owners_count":25115600,"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","status":"online","status_checked_at":"2025-09-03T02:00:09.631Z","response_time":76,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2025-09-03T18:50:57.652Z","updated_at":"2025-09-03T18:51:12.574Z","avatar_url":"https://github.com/poetryofcode.png","language":"JavaScript","readme":"# Blogging-Platform\n\n\nhttps://github.com/VitaliPri/Blogging-Platform/assets/101225909/74e54cee-0ea7-4bd4-a222-025dc78da6e0\n\n\nThis repository contains the source code for a Blogging Platform built using the PERN (PostgreSQL, Express.js, React, Node.js) stack. The platform allows users to register, create posts, add comments, and perform various CRUD (Create, Read, Update, Delete) operations on posts and comments.\n\n## Table of Contents\n\n- [Database Setup and Relationships](#database-setup-and-relationships)\n- [User Registration and Login](#user-registration-and-login)\n- [User Authentication and Authorization](#user-authentication-and-authorization)\n- [CRUD Operations for Posts](#crud-operations-for-posts)\n- [CRUD Operations for Comments](#crud-operations-for-comments)\n- [Installation](#installation)\n- [Usage](#usage)\n- [API Endpoints](#api-endpoints)\n- [Testing](#testing)\n- [Contributing](#contributing)\n- [License](#license)\n\n## Database Setup and Relationships\n\nTo set up the database, follow these steps:\n\n1. Install PostgreSQL on your system.\n2. Create a new PostgreSQL database for the blogging platform.\n3. Update the database credentials in the configuration file (`config/config.js`) with your PostgreSQL connection details.\n4. Run the Sequelize migrations to generate the necessary tables and relationships.\n\n## User Registration and Login\n\nThe platform provides user registration and login functionality with hashed passwords. To register and login:\n\n1. Use the provided API endpoints to register a new user and obtain an authentication token.\n2. Authenticate the user by sending the token in the request headers.\n3. Use the token to create a session cookie upon successful login.\n\n## User Authentication and Authorization\n\nTo protect routes that require authentication:\n\n1. Implement middleware functions to validate the session cookie and ensure user authentication.\n2. Apply the middleware to the appropriate routes.\n3. Test the authentication and authorization flow using Postman, ensuring only authenticated users can access protected routes.\n\n## CRUD Operations for Posts\n\nThe platform supports CRUD operations for posts. Use the provided API endpoints to:\n\n- Create a new post\n- Retrieve all posts\n- Retrieve a specific post by ID\n- Update a post\n- Delete a post\n\nEnsure that only authenticated users can perform these operations on posts.\n\n## CRUD Operations for Comments\n\nThe platform supports CRUD operations for comments. Use the provided API endpoints to:\n\n- Create a new comment\n- Retrieve all comments for a specific post\n- Retrieve a specific comment by ID\n- Update a comment\n- Delete a comment\n\nEnsure that only authenticated users can perform these operations on comments.\n\n## Installation\n\nTo run the Blogging Platform locally, follow these steps:\n\n1. Clone this repository: `git clone https://github.com/VitaliPri/Blogging-Platform.git`\n2. Navigate to the project directory: `cd Blogging-Platform`\n3. Install the dependencies for the backend server: `cd server \u0026\u0026 npm install`\n4. Install the dependencies for the frontend client: `cd ../client \u0026\u0026 npm install`\n5. Configure the database connection in `server/config/config.json`\n6. Run the database migrations: `cd ../server \u0026\u0026 npx sequelize-cli db:migrate`\n\n## Usage\n\nTo start the Blogging Platform, follow these steps:\n\n1. Start the backend server: `cd server \u0026\u0026 npm start`\n2. In a separate terminal, start the frontend client: `cd ../client \u0026\u0026 npm start`\n3. Open your browser and navigate to `http://localhost:4000` to access the Blogging Platform.\n\n## API Endpoints\n\nThe API endpoints provided by the server are as follows:\n\n- `POST /api/users/register`: Register a new user.\n- `POST /api/users/login`: Login a user and obtain an authentication token.\n- `GET /api/posts`: Retrieve all posts.\n- `GET /api/posts/:id`: Retrieve a specific post by ID.\n- `POST /api/posts`: Create a new post.\n- `PUT /api/posts/:id`: Update a post.\n- `DELETE /api/posts/:id`: Delete a post.\n- `GET /api/posts/:id/comments`: Retrieve all comments for a specific post.\n- `GET /api/comments/:id`: Retrieve a specific comment by ID.\n- `POST /api/comments`: Create a new comment.\n- `PUT /api/comments/:id`: Update a comment.\n- `DELETE /api/comments/:id`: Delete a comment.\n\nPlease refer to the API documentation for more details on request and response formats.\n\n## Testing\n\nThe platform can be tested using Postman or other API testing tools. The provided API endpoints should be used to perform various operations on users, posts, and comments. Ensure that you test the authentication and authorization flow as well.\n\n## Contributing\n\nContributions to the Blogging Platform are welcome! If you find any issues or have suggestions for improvements, please open an issue or submit a pull request. Contributions should align with the project's coding style and follow the guidelines specified in the repository.\n\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpoetryofcode%2Fblogging-platform","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpoetryofcode%2Fblogging-platform","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpoetryofcode%2Fblogging-platform/lists"}