{"id":15099590,"url":"https://github.com/ressuman/user-posts-project","last_synced_at":"2026-01-07T04:39:12.265Z","repository":{"id":252852880,"uuid":"841562997","full_name":"ressuman/User-Posts-Project","owner":"ressuman","description":"This project is a simple React-based application for posting messages with an author and body. It provides a user-friendly interface to create, display, and manage posts. The application also integrates with a backend server for storing and retrieving posts. It also provides a RESTful API to store, retrieve, and manage posts.","archived":false,"fork":false,"pushed_at":"2024-08-14T20:26:17.000Z","size":4370,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-01T18:11:41.661Z","etag":null,"topics":["axios","css-modules","environment-variables","express","react","react-router","vite"],"latest_commit_sha":null,"homepage":"https://ressuman-user-posts-management-app-client.pages.dev/","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/ressuman.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-08-12T16:48:59.000Z","updated_at":"2024-08-14T20:44:03.000Z","dependencies_parsed_at":"2024-10-01T07:00:58.416Z","dependency_job_id":"535c8387-d213-49a2-ae1a-bab66a019c8a","html_url":"https://github.com/ressuman/User-Posts-Project","commit_stats":{"total_commits":8,"total_committers":1,"mean_commits":8.0,"dds":0.0,"last_synced_commit":"6090bd8013df84f65597a3aa71afce089d0705e0"},"previous_names":["ressuman/user-posts-project"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ressuman%2FUser-Posts-Project","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ressuman%2FUser-Posts-Project/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ressuman%2FUser-Posts-Project/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ressuman%2FUser-Posts-Project/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ressuman","download_url":"https://codeload.github.com/ressuman/User-Posts-Project/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245855588,"owners_count":20683538,"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":["axios","css-modules","environment-variables","express","react","react-router","vite"],"created_at":"2024-09-25T17:24:00.472Z","updated_at":"2026-01-07T04:39:12.206Z","avatar_url":"https://github.com/ressuman.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# React User Poster - Client-Side (Frontend)\n\nThis is the client-side (frontend) part of a Post Management Application built using React, Axios, and React Router. The application allows users to create, view, and interact with posts. It provides a user-friendly interface to create, display, and manage posts. The application also integrates with a backend server for storing and retrieving posts.\n\n## Table of Contents\n\n- [React User Poster - Client-Side (Frontend)](#react-user-poster---client-side-frontend)\n  - [Table of Contents](#table-of-contents)\n  - [Features](#features)\n  - [Technologies Used](#technologies-used)\n  - [Setup and Installation](#setup-and-installation)\n  - [Environment Variables](#environment-variables)\n  - [Running the Application](#running-the-application)\n  - [Available Scripts](#available-scripts)\n  - [Folder Structure](#folder-structure)\n  - [Components Overview](#components-overview)\n    - [`Post`](#post)\n    - [`PostList`](#postlist)\n    - [`NewPost`](#newpost)\n  - [Routing](#routing)\n  - [Loading \\\u0026 Error Handling](#loading--error-handling)\n    - [Loading State](#loading-state)\n    - [Error Handling](#error-handling)\n  - [Contributing](#contributing)\n  - [License](#license)\n    - [Gif](#gif)\n  - [](#)\n- [React + Vite](#react--vite)\n\n## Features\n\n- **Post Creation**: Users can create new posts with an author and body.\n- **Post Listing**: Posts are fetched from the backend and displayed in a list.\n- **Post Details**: Each post can be clicked to view its details.\n- **Responsive Design**: Built using Tailwind CSS for responsiveness.\n- **Modal-based Post Creation Form**: A modal is used to create new posts.\n- **Integration with Backend**: Communicates with a RESTful backend API.\n- **Prop Validation**: Components use PropTypes for validation to ensure data integrity.\n- **Loading State**: A loading spinner is displayed while data is being fetched.\n- **Error Handling**: Errors during data fetching or post creation are handled gracefully and logged to the console.\n\n## Technologies Used\n\n- **React**: A JavaScript library for building user interfaces.\n- **Axios**: A promise-based HTTP client for making API requests.\n- **React Router**: For managing navigation within the app.\n- **React Icons**: For adding icons to the UI.\n- **Tailwind CSS**: A utility-first CSS framework for styling.\n- **Vite**: A fast build tool and development server for modern web projects.\n- **PropTypes**: For prop validation in React components.\n\n## Setup and Installation\n\n1. **Clone the repository:**\n\n   ```bash\n   git clone \u003crepository-url\u003e\n   cd client\n   ```\n\n2. **Install dependencies:**\n\n   ```bash\n   npm install\n   ```\n\n   or if you're using Yarn:\n\n   ```bash\n   yarn install\n   ```\n\n## Environment Variables\n\nCreate a `.env` file in the root of the `client` directory with the following content:\n\n```plaintext\nVITE_REACT_USER_POSTS_BACKEND_SERVER=http://localhost:8080/posts\n```\n\nThis environment variable points to the backend server URL where the posts are stored.\n\n## Running the Application\n\nTo start the development server:\n\n```bash\nnpm run dev\n```\n\nor if you're using Yarn:\n\n```bash\nyarn dev\n```\n\nThe application will be available at `http://localhost:5173`.\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n- `yarn dev`: Starts the development server.\n- `yarn build`: Builds the app for production.\n- `yarn serve`: Serves the production build locally.\n- `yarn lint`: Lints the code using ESLint.\n\n## Folder Structure\n\nHere's an overview of the project structure:\n\n```plaintext\n├── public/\n├── src/\n│   ├── components/\n│   │   ├── MainHeader/\n│   │   │   ├── MainHeader.jsx\n│   │   │   └── MainHeader.module.css\n│   │   ├── Modal/\n│   │   │   ├── Modal.jsx\n│   │   │   └── Modal.module.css\n│   │   ├── NewPost/\n│   │   │   ├── NewPost.jsx\n│   │   │   └── NewPost.module.css\n│   │   ├── Post/\n│   │   │   ├── Post.jsx\n│   │   │   └── Post.module.css\n│   │   └── PostList/\n│   │       ├── PostList.jsx\n│   │       └── PostList.module.css\n│   ├── pages/              # Pages\n│   ├── App.jsx             # Main application component\n│   ├── index.css           # Global styles\n│   └── main.jsx            # Entry point\n├── .env                    # Environment variables\n├── package.json            # Project dependencies and scripts\n└── README.md               # Project documentation\n```\n\n- **MainHeader**: The header component with the logo and a button to create a new post.\n- **Modal**: The modal component used to display the post creation form.\n- **NewPost**: The form component for creating a new post.\n- **Post**: The component for displaying individual posts.\n- **PostList**: The component that manages and displays the list of posts.\n\n## Components Overview\n\n### `Post`\n\n- **Props**:\n\n  - `id` (string): The unique identifier for the post.\n  - `author` (string): The author of the post.\n  - `body` (string): The content of the post.\n\n- **Usage**: Displays a single post. Clicking on the post redirects to its details page.\n\n### `PostList`\n\n- **Props**: None.\n- **Usage**: Fetches and displays a list of posts. Handles loading and error states.\n\n### `NewPost`\n\n- **Props**:\n\n  - `onAddPost` (function): Callback function to add a new post.\n\n- **Usage**: Provides a form to create a new post.\n\n## Routing\n\n- **`/`**: Home page displaying the list of posts.\n- **`/create-post`**: Page to create a new post.\n- **`/post/:id`**: Post details page for viewing a single post.\n\n## Loading \u0026 Error Handling\n\n### Loading State\n\n- A loading spinner is shown while the posts are being fetched. The spinner is managed using the `isFetching` state in the `PostList` component.\n\n### Error Handling\n\n- Errors during the fetching of posts or the creation of a new post are caught using `try/catch` blocks. Errors are logged to the console and can be extended to show error messages to the user.\n\n## Contributing\n\nContributions are welcome! Please follow these steps to contribute:\n\n1. Fork the repository.\n2. Create a new branch (`git checkout -b feature/your-feature-name`).\n3. Make your changes.\n4. Commit your changes (`git commit -m 'Add your feature'`).\n5. Push to the branch (`git push origin feature/your-feature-name`).\n6. Open a pull request.\n\n## License\n\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for more details.\n\n### Gif\n\nHere is an expected gif of the preview of the App(React User Post Management App)\n\n## ![React User Post Management App gif](./src/assets/user-posts.gif)\n\n---\n\n# React + Vite\n\nThis template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.\n\nCurrently, two official plugins are available:\n\n- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh\n- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh\n\n```\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fressuman%2Fuser-posts-project","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fressuman%2Fuser-posts-project","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fressuman%2Fuser-posts-project/lists"}