{"id":30450134,"url":"https://github.com/abdultolba/friend.ly","last_synced_at":"2026-04-11T01:13:46.257Z","repository":{"id":128044243,"uuid":"287648959","full_name":"abdultolba/friend.ly","owner":"abdultolba","description":"A social media platform that uses 'cards' to connect people virtually, built with the PERN (previously MERN) stack.","archived":false,"fork":false,"pushed_at":"2025-08-14T21:54:55.000Z","size":8887,"stargazers_count":1,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-14T23:27:13.484Z","etag":null,"topics":["bcrypt","es6","esnext","express","javascript","postgres","postgresql","react","redux"],"latest_commit_sha":null,"homepage":"","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/abdultolba.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,"zenodo":null}},"created_at":"2020-08-15T00:24:15.000Z","updated_at":"2025-08-14T21:54:58.000Z","dependencies_parsed_at":"2025-08-06T22:18:10.007Z","dependency_job_id":null,"html_url":"https://github.com/abdultolba/friend.ly","commit_stats":null,"previous_names":["abdultolba/friend.ly"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/abdultolba/friend.ly","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abdultolba%2Ffriend.ly","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abdultolba%2Ffriend.ly/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abdultolba%2Ffriend.ly/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abdultolba%2Ffriend.ly/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/abdultolba","download_url":"https://codeload.github.com/abdultolba/friend.ly/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abdultolba%2Ffriend.ly/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271749048,"owners_count":24814115,"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-08-23T02:00:09.327Z","response_time":69,"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":["bcrypt","es6","esnext","express","javascript","postgres","postgresql","react","redux"],"created_at":"2025-08-23T13:25:04.316Z","updated_at":"2025-11-17T01:02:55.073Z","avatar_url":"https://github.com/abdultolba.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://res.cloudinary.com/friendly-social/image/upload/v1755207784/friendly_icon_horizontal_poaa8k.png\" alt=\"Friend.ly Logo\" width=\"200\" style=\"margin-bottom:-80px;\"\u003e\u003cbr\u003e\n  \u003cb\u003efriend.ly\u003c/b\u003e is a small social media platform that uses 'cards' to connect people virtually, built with the \u003ca href=\"https://www.geeksforgeeks.org/node-js/what-is-pern-stack/\"\u003e\u003ci\u003ePERN\u003c/i\u003e\u003c/a\u003e stack (PostgreSQL, Express.js, React, Node.js).\n\u003c/p\u003e\n\n## Features\n\n- User authentication (sign up/sign in)\n- Create and share posts\n- Like/unlike posts\n- User profiles with customizable descriptions\n- Real-time social interactions\n- Modern UI with React 18 and Bootstrap 5\n- Dark Mode theme\n\n## Tech Stack\n\n### Backend\n\n- **Node.js** with Express.js 5 (latest with modern async/await patterns)\n- **PostgreSQL 17** with [Sequelize ORM](https://sequelize.org/)\n- **JWT** for authentication\n- **bcrypt** for password hashing\n- **Cloudinary** for image storage (with local fallback)\n- **Multer** with manual upload handling for Express 5 compatibility\n- **Sharp** for image processing\n\n### Frontend\n\n- **React 19** with concurrent features and automatic memoization\n- **Redux Toolkit** for state management\n- **React Router 7** for enhanced navigation\n- **Bootstrap 5** for styling\n- **Vite 7** for lightning-fast development and bundling\n- **esbuild** for ultra-fast transpilation\n\n## 📋 Prerequisites\n\n- **Node.js** (v14 or higher)\n- **PostgreSQL 17** (or any modern version)\n- **npm** or **yarn**\n\n## 🔧 Installation\n\n### 1. Clone the repository\n\n```bash\ngit clone \u003crepository-url\u003e\ncd social-mern\n```\n\n### 2. Install PostgreSQL\n\n#### macOS (using Homebrew)\n\n```bash\nbrew install postgresql@17\nbrew services start postgresql@17\n```\n\n#### Ubuntu/Debian\n\n```bash\nsudo apt update\nsudo apt install postgresql postgresql-contrib\nsudo systemctl start postgresql\nsudo systemctl enable postgresql\n```\n\n#### Windows\n\nDownload and install from [PostgreSQL official website](https://www.postgresql.org/download/windows/)\n\n### 3. Set up the database\n\n```bash\n# Create the database\ncreatedb social_mern_db\n\n# Or use the npm script\nnpm run db:create --prefix server\n```\n\n### 4. Environment Configuration\n\nCopy the example environment file and configure your settings:\n\n```bash\ncp server/.env.example server/.env\n```\n\nEdit `server/.env` with your configuration:\n\n```env\n# Database Configuration\nDB_HOST=localhost\nDB_PORT=5432\nDB_NAME=social_mern_db\nDB_USERNAME=postgres\nDB_PASSWORD=your_password\n\n# JWT Secret Key (generate a random string)\nSECRET_KEY=your-super-secret-jwt-key-here\n\n# Cloudinary Configuration (optional)\nCLOUDINARY_CLOUD_NAME=your_cloud_name\nCLOUDINARY_API_KEY=your_api_key\nCLOUDINARY_API_SECRET=your_api_secret\n\n# Server Configuration\nNODE_ENV=development\nPORT=3000\n```\n\n### 5. Install dependencies\n\n```bash\nnpm run postinstall\n```\n\n## 🚦 Running the Application\n\n### Development Mode\n\n```bash\n# Run both client and server in development mode\nnpm run dev\n\n# Or run them separately:\n# Client only (with hot reload)\nnpm run serve --prefix client\n\n# Server only (with nodemon)\nnpm run dev --prefix server\n```\n\n### Production Mode\n\n```bash\n# Build and start the application\nnpm start\n```\n\nThe application will be available at:\n\n- **Frontend**: http://localhost:8080 (development) or http://localhost:3000 (production)\n- **Backend API**: http://localhost:3000/api\n\n## 📁 Project Structure\n\n```\nsocial-mern/\n├── client/                 # React frontend\n│   ├── src/\n│   │   ├── components/     # Reusable React components\n│   │   ├── pages/          # Page components\n│   │   ├── actions/        # Redux actions\n│   │   ├── reducers/       # Redux reducers\n│   │   ├── styles/         # SCSS stylesheets\n│   │   └── assets/         # Static assets\n│   ├── webpack.config.js   # Webpack configuration\n│   └── package.json\n├── server/                 # Node.js backend\n│   ├── routes/             # API routes\n│   ├── models/             # Sequelize models\n│   ├── middlewares/        # Express middlewares\n│   ├── db/                 # Database configuration\n│   ├── scripts/            # Serverside scripts\n│   ├── seeders/            # Database population\n│   ├── public/             # Static files\n│   └── package.json\n└── package.json            # Root package.json\n```\n\n## 🔄 Database Scripts\n\n```bash\n# Create database\nnpm run db:create --prefix server\n\n# Drop database\nnpm run db:drop --prefix server\n\n# Reset database (drop and recreate)\nnpm run db:reset --prefix server\n\n# Sync database schema\nnpm run db:sync --prefix server\n\n# Populate the database with user data (all passwords use 'password123')\nnpm run db:seed --prefix server\n```\n\n## 🛡️ Security Features\n\n- Password hashing with bcrypt\n- JWT token authentication\n- CORS configuration\n- Input validation and sanitization\n- Modern security headers\n\n## 🐛 Troubleshooting\n\n### PostgreSQL Connection Issues\n\n1. **Make sure PostgreSQL is running:**\n\n   ```bash\n   brew services start postgresql@17  # macOS\n   sudo systemctl start postgresql    # Linux\n   ```\n\n2. **Check if database exists:**\n\n   ```bash\n   psql -l\n   ```\n\n3. **Create user if needed:**\n   ```bash\n   createuser -s postgres\n   ```\n\n### Build Issues\n\n1. **Clear node_modules:**\n\n   ```bash\n   rm -rf node_modules client/node_modules server/node_modules\n   npm run postinstall\n   ```\n\n2. **Clear build cache:**\n   ```bash\n   rm -rf client/dist server/public\n   ```\n\n## 🤝 Contributing\n\n1. Fork the repository\n2. Create a feature branch (`git checkout -b feature/amazing-feature`)\n3. Commit your changes (`git commit -m 'Add some amazing feature'`)\n4. Push to the branch (`git push origin feature/amazing-feature`)\n5. Open a Pull Request\n\n## 📝 License\n\nThis project is licensed under the ISC License.\n\n## 🙏 Acknowledgments\n\n- Originally implemented with the MERN stack\n- Modernized with PostgreSQL, React 18, and latest dependencies\n- Security vulnerabilities fixed and dependencies updated\n\n## Demo\n\n![friend.ly demo](https://res.cloudinary.com/friendly-social/image/upload/v1599828700/github/demo_pekg8c.gif)\n\nMade with ❤️.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabdultolba%2Ffriend.ly","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fabdultolba%2Ffriend.ly","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabdultolba%2Ffriend.ly/lists"}