{"id":17712614,"url":"https://github.com/mhmdfais/sudo-write-thoughts","last_synced_at":"2026-05-05T21:35:40.516Z","repository":{"id":258129095,"uuid":"870793547","full_name":"MhmdFais/sudo-write-thoughts","owner":"MhmdFais","description":"Blogging platform","archived":false,"fork":false,"pushed_at":"2024-10-21T18:40:33.000Z","size":498,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-10-22T20:48:21.067Z","etag":null,"topics":["express","jwt-auth","jwt-token","react","rest-api"],"latest_commit_sha":null,"homepage":"https://sudo-write-thoughts.vercel.app/","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/MhmdFais.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":"2024-10-10T17:16:53.000Z","updated_at":"2024-10-21T18:35:27.000Z","dependencies_parsed_at":"2024-10-25T10:19:54.160Z","dependency_job_id":null,"html_url":"https://github.com/MhmdFais/sudo-write-thoughts","commit_stats":null,"previous_names":["mhmdfais/sudo-write-thoughts"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MhmdFais%2Fsudo-write-thoughts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MhmdFais%2Fsudo-write-thoughts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MhmdFais%2Fsudo-write-thoughts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MhmdFais%2Fsudo-write-thoughts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MhmdFais","download_url":"https://codeload.github.com/MhmdFais/sudo-write-thoughts/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246450475,"owners_count":20779421,"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","jwt-auth","jwt-token","react","rest-api"],"created_at":"2024-10-25T09:05:47.412Z","updated_at":"2026-05-05T21:35:40.485Z","avatar_url":"https://github.com/MhmdFais.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Sudo Write { Thoughts } - Blogging Platform\n\nSudo Write { Thoughts } is a blogging platform where users can read articles, comment on posts, and interact with others. Registered users can create, update, and comment on posts, while unregistered users can view content and comments but cannot participate until logged in.\n\nThe platform includes a React frontend and an Express backend with the following functionalities:\n\n- Frontend: Displays articles, allows user registration, and enables users to post comments.\n- Backend: Handles authentication, article management (CRUD), and comment posting.\n\n# Live Preview\n\nClick [Here](https://sudo-write-thoughts.vercel.app/)\n\n# Screenshots\n\n![image](https://github.com/user-attachments/assets/5a550b0e-2d0e-4b18-b8d3-7fd190548757)\n\n![image](https://github.com/user-attachments/assets/eaa58161-0335-495d-8420-1391fbf9ea85)\n\n![image](https://github.com/user-attachments/assets/e4b5daf7-c13f-4a26-87d3-bbf4f3cafe6c)\n\n![image](https://github.com/user-attachments/assets/3814ab77-5630-47bb-ba97-7bd7af2eb4c8)\n\n![image](https://github.com/user-attachments/assets/7494fc95-3b3d-441f-9795-c4a3829fbf45)\n\n![image](https://github.com/user-attachments/assets/cda97272-628c-4a2f-a637-1ccf296f256d)\n\n![image](https://github.com/user-attachments/assets/139e7a93-ce41-4c1f-9049-3ee25afb4633)\n\n![image](https://github.com/user-attachments/assets/042f9a40-be66-45c8-9d1b-09a5f2566293)\n\n![image](https://github.com/user-attachments/assets/d8fc5296-00c0-44ff-9a63-b0c99acdfc99)\n\n![image](https://github.com/user-attachments/assets/3e257c65-acc0-489c-9716-4d02875ce05c)\n\n![image](https://github.com/user-attachments/assets/a8d45791-bd8b-4d00-9593-14db6a802892)\n\n![image](https://github.com/user-attachments/assets/a2d05c87-aa14-405d-b5ef-3473ce8ed552)\n\n# Key Features\n\n- User Authentication: Only logged-in users can comment or post articles.\n- Role-Based Access: Admin users can manage (create, update, delete) posts.\n- Commenting System: Users can post comments, and admins can delete inappropriate comments.\n- TinyMCE Editor: Articles are created and displayed using TinyMCE in read-only mode.\n- Protected Routes: Users must log in to access certain features, like posting comments.\n\n# Frontend Installation\n\n1. Clone the repository\n\n```\ngit clone https://github.com/MhmdFais/sudo-write-thoughts\ncd client\n```\n\n2. Install dependencies\n\n```\nnpm install\n```\n\n3. Set up environment variables\n\n# Backend Installation\n\n1. Navigate to the backend folder\n\n```\ncd ../server\n```\n\n2. Install backend dependencies\n\n```\nnpm install\n```\n\n3. Set up environment variables\n\n4. Make sure you have a PostgreSQL database running\n\n5. Run database migrations to set up the database schema\n\n```\nnpx prisma migrate deploy\n```\n\n# Environment Variables\n\nFrontend .env\n\n```\nVITE_REACT_APP_API_URL=\u003cyour_backend_base_url\u003e   # Example: http://localhost:4000\nVITE_MCE_API_KEY=\u003cyour_tinymce_api_key\u003e          # Get from https://www.tiny.cloud/\n```\n\nBackend .env\n\n```\nPORT=4000\nDATABASE_URL=\u003cyour_postgresql_database_url\u003e      # Example: postgresql://user:pass@localhost:5432/db_name\nJWT_SECRET=\u003cyour_jwt_secret\u003e                     # Secret key for JWT signing\n```\n\n# How to Run\n\n## Backend\n\n1. Navigate to the backend folder\n\n```\ncd server\n```\n\n2. Start the backend server\n\n```\nnpm run dev\n```\n\n## Frontend\n\n1. Navigate to the frontend folder\n\n```\ncd client\n```\n\n2. Start the frontend development server\n\n```\nnpm run dev\n```\n\n# Technologies\n\n## Frontend:\n\n- React: Library for building the UI.\n- React Router: Client-side routing.\n- Axios: To make HTTP requests to the backend.\n- TinyMCE: WYSIWYG editor for creating and displaying post content.\n- Vite: Fast development server and build tool.\n\n## Backend:\n\n- Node.js: Backend runtime environment.\n- Express.js: Web framework for building the backend.\n- PostgreSQL: Database for storing user and blog data.\n- Prisma: ORM for database queries.\n- JWT: For user authentication.\n- bcrypt: For password hashing.\n\n# API Endpoints\n\n## Auth Routes\n\n- POST /auth/register: Register a new user.\n- POST /auth/login: Log in and get a JWT.\n- POST /auth/logout: Log out the user by invalidating the refresh token.\n\n## Post Routes\n\n- GET /posts: Get all blog posts.\n- GET /posts/:id: Get details of a single post.\n- POST /admin/posts: Create a new post (Admin only).\n- PATCH /admin/posts/:id: Edit an existing post (Admin only).\n- DELETE /admin/posts/:id: Delete a post (Admin only).\n\n## Comment Routes\n\n- POST /posts/:id/comment: Add a comment to a post (Logged-in users only).\n- DELETE /admin/posts/:id/comment/:commentId: Delete a comment (Admin only).\n\n# Contributions\n\nFeel free to fork this project, open issues, or submit pull requests to improve the platform!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmhmdfais%2Fsudo-write-thoughts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmhmdfais%2Fsudo-write-thoughts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmhmdfais%2Fsudo-write-thoughts/lists"}