{"id":50373404,"url":"https://github.com/vardhin/politicalgossips","last_synced_at":"2026-05-30T08:04:23.308Z","repository":{"id":293076177,"uuid":"982222684","full_name":"vardhin/politicalgossips","owner":"vardhin","description":null,"archived":false,"fork":false,"pushed_at":"2025-10-26T12:06:24.000Z","size":13043,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-26T12:25:23.407Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://politicalgossips.vercel.app","language":"JavaScript","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/vardhin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-05-12T14:54:02.000Z","updated_at":"2025-10-26T12:06:27.000Z","dependencies_parsed_at":"2025-10-26T12:15:03.152Z","dependency_job_id":"86fb2e42-21ab-4d2d-9e20-86c756a8f5c0","html_url":"https://github.com/vardhin/politicalgossips","commit_stats":null,"previous_names":["vardhin/politicalgossips"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/vardhin/politicalgossips","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vardhin%2Fpoliticalgossips","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vardhin%2Fpoliticalgossips/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vardhin%2Fpoliticalgossips/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vardhin%2Fpoliticalgossips/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vardhin","download_url":"https://codeload.github.com/vardhin/politicalgossips/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vardhin%2Fpoliticalgossips/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33684419,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-30T02:00:06.278Z","response_time":92,"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":"2026-05-30T08:04:23.192Z","updated_at":"2026-05-30T08:04:23.291Z","avatar_url":"https://github.com/vardhin.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Political Gossips 🗳️\n\nA modern full-stack web application for political news and gossip, built with cutting-edge technologies and designed for scalability and performance.\n\n## 🚀 Tech Stack\n\n### Frontend\n- **Framework**: [SvelteKit](https://kit.svelte.dev/) - Modern web framework with server-side rendering\n- **Language**: JavaScript with Svelte 5 (Runes)\n- **Styling**: CSS with custom themes (light/dark mode)\n- **Icons**: [Lucide Svelte](https://lucide.dev/) - Beautiful \u0026 consistent icon library\n- **Build Tool**: Vite\n- **Package Manager**: npm\n\n### Backend\n- **Runtime**: [Node.js](https://nodejs.org/)\n- **Framework**: [Express.js](https://expressjs.com/)\n- **Database**: [MongoDB](https://www.mongodb.com/) with [Mongoose ODM](https://mongoosejs.com/)\n- **Authentication**: JWT (JSON Web Tokens) with refresh token rotation\n- **Password Security**: bcrypt for hashing\n- **File Upload**: Multer for handling image uploads\n- **Environment**: dotenv for configuration management\n\n### Security \u0026 Features\n- **Content Security Policy (CSP)** with nonce-based protection\n- **CORS** enabled for cross-origin requests\n- **JWT Authentication** with access/refresh token system\n- **Role-based Access Control** (Admin/User roles)\n- **Image Upload \u0026 Storage** for article images\n- **Server-Side Rendering (SSR)** for better SEO\n- **Theme System** with localStorage persistence\n\n## 📁 Project Structure\n\n```\npoliticalgossips/\n├── frontend/                 # SvelteKit frontend application\n│   ├── src/\n│   │   ├── routes/          # File-based routing\n│   │   ├── lib/             # Shared components and utilities\n│   │   └── app.html         # Main HTML template\n│   └── .svelte-kit/         # Generated SvelteKit files\n├── backend/                 # Express.js backend API\n│   ├── index.js            # Main server file\n│   ├── articleService.js   # Article business logic\n│   └── README.md\n└── README.md               # This file\n```\n\n## 🎯 Features\n\n### Public Features\n- **Featured Articles**: Curated political news on homepage\n- **Category-based Browsing**: Organized content by political topics\n- **Responsive Design**: Mobile-first approach with dark/light themes\n- **SEO Optimized**: Server-side rendering for better search visibility\n\n### Admin Features\n- **Admin Dashboard**: Content management interface\n- **Article Management**: Create, edit, and manage political articles\n- **Image Upload**: Support for article images with multiple formats\n- **Featured Article Control**: Mark articles as featured\n- **Category Management**: Organize content by political categories\n\n### Technical Features\n- **Real-time Theme Switching**: Instant dark/light mode toggle\n- **Optimized Loading**: Lazy loading and code splitting\n- **Secure Authentication**: JWT-based auth with refresh tokens\n- **Image Processing**: Automatic image optimization and storage\n- **Error Handling**: Comprehensive error boundaries and fallbacks\n\n## 🛠️ Installation \u0026 Setup\n\n### Prerequisites\n- Node.js (v18 or higher)\n- MongoDB (local or cloud instance)\n- npm or yarn package manager\n\n### Backend Setup\n\n1. **Clone the repository**\n```bash\ngit clone https://github.com/vardhin/politicalgossips.git\ncd politicalgossips/backend\n```\n\n2. **Install dependencies**\n```bash\nnpm install\n```\n\n3. **Environment Configuration**\nCreate a `.env` file in the backend directory:\n```env\nPORT=5000\nMONGODB_URI=mongodb://localhost:27017/politicalgossips\nJWT_SECRET=your_jwt_secret_key\nREFRESH_TOKEN_SECRET=your_refresh_token_secret\nACCESS_TOKEN_EXPIRES_IN=15m\nREFRESH_TOKEN_EXPIRES_IN=7d\n```\n\n4. **Start the backend server**\n```bash\nnpm start\n```\n\n### Frontend Setup\n\n1. **Navigate to frontend directory**\n```bash\ncd ../frontend\n```\n\n2. **Install dependencies**\n```bash\nnpm install\n```\n\n3. **Start development server**\n```bash\nnpm run dev\n```\n\n4. **Build for production**\n```bash\nnpm run build\nnpm run preview\n```\n\n## 🌐 API Endpoints\n\n### Authentication\n- `POST /api/auth/login` - User login\n- `POST /api/auth/refresh` - Refresh access token\n- `POST /api/auth/logout` - User logout\n\n### Articles\n- `GET /api/articles` - Get all articles (with pagination)\n- `GET /api/articles/featured` - Get featured articles\n- `GET /api/articles/category/:category` - Get articles by category\n- `GET /api/articles/:id` - Get single article\n- `POST /api/articles` - Create new article (Admin only)\n- `PUT /api/articles/:id` - Update article (Admin only)\n- `DELETE /api/articles/:id` - Delete article (Admin only)\n\n## 🔒 Security Features\n\n- **JWT Authentication**: Secure token-based authentication\n- **Password Hashing**: bcrypt with salt rounds\n- **CORS Protection**: Configured for specific origins\n- **Content Security Policy**: Prevents XSS attacks\n- **Input Validation**: Comprehensive request validation\n- **Role-based Access**: Admin-only routes protection\n\n## 🎨 Theme System\n\nThe application features a sophisticated theme system:\n- **Auto Detection**: Respects system preference on first visit\n- **Persistence**: Saves user preference in localStorage\n- **Instant Switching**: No page reload required\n- **SSR Compatible**: Prevents flash of wrong theme\n\n## 📱 Responsive Design\n\n- **Mobile First**: Optimized for mobile devices\n- **Progressive Enhancement**: Works on all screen sizes\n- **Touch Friendly**: Optimized for touch interfaces\n- **Fast Loading**: Optimized bundle sizes and lazy loading\n\n## 🚀 Deployment\n\n### Backend Deployment\n```bash\n# Build and start\nnpm run build\nnpm start\n```\n\n### Frontend Deployment\n```bash\n# Build for production\nnpm run build\n\n# The built files will be in the 'build' directory\n# Deploy to your preferred hosting service (Vercel, Netlify, etc.)\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 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 MIT License - see the [LICENSE](LICENSE) file for details.\n\n## 👥 Authors\n\n- **Your Name** - Initial work - [@vardhin](https://github.com/vardhin)\n\n## 🙏 Acknowledgments\n\n- SvelteKit team for the amazing framework\n- MongoDB team for the robust database\n- Lucide team for beautiful icons\n- All contributors and supporters\n\n## 📞 Support\n\nIf you have any questions or need help, please:\n- Open an issue on GitHub\n\n---\n\n**Built with ❤️ for political transparency and information accessibility**","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvardhin%2Fpoliticalgossips","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvardhin%2Fpoliticalgossips","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvardhin%2Fpoliticalgossips/lists"}