{"id":49889726,"url":"https://github.com/kevinbdx35/punchline","last_synced_at":"2026-05-15T20:10:43.002Z","repository":{"id":134988420,"uuid":"467961576","full_name":"kevinbdx35/punchline","owner":"kevinbdx35","description":"  API REST moderne pour gérer des citations   inspirantes avec interface React. Inclut   authentification sécurisée, recherche   avancée et déploiement CI/CD automatisé.","archived":false,"fork":false,"pushed_at":"2026-02-25T16:56:14.000Z","size":10183,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-25T20:08:29.651Z","etag":null,"topics":["docker","express","github-actions","jwt","nodejs","react","rest-api","sqlite"],"latest_commit_sha":null,"homepage":"https://kevinbdx35.github.io/punchline/","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/kevinbdx35.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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-03-09T14:30:02.000Z","updated_at":"2026-02-25T16:57:23.000Z","dependencies_parsed_at":null,"dependency_job_id":"9dac3332-b097-4851-b319-2f4f7b3d0e5c","html_url":"https://github.com/kevinbdx35/punchline","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/kevinbdx35/punchline","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kevinbdx35%2Fpunchline","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kevinbdx35%2Fpunchline/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kevinbdx35%2Fpunchline/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kevinbdx35%2Fpunchline/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kevinbdx35","download_url":"https://codeload.github.com/kevinbdx35/punchline/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kevinbdx35%2Fpunchline/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33078257,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-15T20:05:40.333Z","status":"ssl_error","status_checked_at":"2026-05-15T20:05:38.672Z","response_time":103,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["docker","express","github-actions","jwt","nodejs","react","rest-api","sqlite"],"created_at":"2026-05-15T20:10:42.149Z","updated_at":"2026-05-15T20:10:42.990Z","avatar_url":"https://github.com/kevinbdx35.png","language":"JavaScript","funding_links":["https://ko-fi.com/W7W61I0YBJ"],"categories":[],"sub_categories":[],"readme":"# 🎯 Punchline API\n\n\u003e Modern REST API for managing inspirational quotes with React frontend. Features secure authentication, search functionality, and automated CI/CD deployment.\n\n[![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/W7W61I0YBJ)\n\n![Screen Capture](https://github.com/kevinbdx35/punchline/blob/main/screencapture-genuine-dragon-4b0e59-netlify-app-2022-04-26-20_11_52.png?raw=true)\n\n[![Node.js Version](https://img.shields.io/badge/node-%3E%3D20.0.0-brightgreen.svg)](https://nodejs.org/)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![Test Coverage](https://img.shields.io/badge/coverage-90%25-brightgreen.svg)](https://github.com/kevinbdx35/punchline)\n[![Docker](https://img.shields.io/badge/docker-ready-blue.svg)](https://www.docker.com/)\n\n## ✨ Features\n\n### 🔧 **Backend API**\n- **🔒 Security First**: Helmet.js, rate limiting, input validation with Joi\n- **⚡ High Performance**: In-memory caching, compression, optimized SQLite queries\n- **🔍 Advanced Search**: Full-text search with relevance scoring\n- **📊 Real-time Stats**: Quote statistics and analytics\n- **📖 Comprehensive API**: RESTful endpoints with OpenAPI documentation\n- **🏥 Health Monitoring**: Built-in health checks and error handling\n\n### 🎨 **Frontend Interface**\n- **📱 Responsive Design**: Mobile-first approach with modern UI\n- **🎲 Random Quotes**: Get inspired with random quote generation\n- **🔍 Smart Search**: Real-time search with filters\n- **❤️ Favorites System**: Save your favorite quotes locally\n- **📄 Pagination**: Smooth navigation through quote collections\n- **⚡ Loading States**: Elegant loading indicators and error handling\n\n### 🛠 **Developer Experience**\n- **🧪 Full Test Suite**: 90%+ test coverage with Jest\n- **🐳 Docker Ready**: Multi-stage builds and Docker Compose\n- **🚀 CI/CD Pipeline**: Automated testing and deployment\n- **📝 TypeScript Support**: Type-safe development\n- **🎯 ESLint**: Consistent code quality\n\n## 🚀 Quick Start\n\n### 🌐 Live Demo\n**[View Live Application →](https://kevinbdx35.github.io/punchline/)**\n\nThe application automatically deploys to GitHub Pages on every commit to `main`.\n\n### Prerequisites\n- Node.js 20+ \n- npm or yarn\n- Docker (optional)\n\n### 🏃‍♂️ Local Development\n\n```bash\n# Clone the repository\ngit clone https://github.com/kevinbdx35/punchline.git\ncd punchline\n\n# Install dependencies\nnpm install\n\n# Set up environment variables\ncp .env.example .env\n\n# Start development server\nnpm run dev\n\n# The API will be available at http://localhost:3000\n```\n\n### 🐳 Docker Deployment\n\n```bash\n# Build and run with Docker Compose\ndocker-compose up --build\n\n# Production deployment\ndocker-compose -f docker-compose.yml up -d\n```\n\n**Live Demo**: https://kevinbdx35.github.io/punchline/\n\n**Local Development**:\n- **API**: http://localhost:3000\n- **Frontend**: http://localhost:1234\n\n## 📚 API Documentation\n\n### Base URL\n```\nhttp://localhost:3000\n```\n\n### Key Endpoints\n\n| Method | Endpoint | Description |\n|--------|----------|-------------|\n| `GET` | `/quotes` | Get quotes with pagination and filters |\n| `GET` | `/quotes/:id` | Get specific quote by ID |\n| `GET` | `/quotes/random` | Get random quote |\n| `POST` | `/quotes` | Create new quote |\n| `GET` | `/quotes/stats` | Get API statistics |\n| `GET` | `/health` | Health check |\n\n### Example Usage\n\n```javascript\n// Get quotes with search\nconst response = await fetch('/quotes?search=inspiration\u0026page=1\u0026lang=en');\nconst data = await response.json();\n\n// Create new quote\nconst newQuote = {\n  lang: 'en',\n  quote: 'The only way to do great work is to love what you do.',\n  author: 'Steve Jobs'\n};\n\nawait fetch('/quotes', {\n  method: 'POST',\n  headers: { 'Content-Type': 'application/json' },\n  body: JSON.stringify(newQuote)\n});\n```\n\n📖 **[Full API Documentation](./API_DOCUMENTATION.md)** | 🚀 **[Deployment Guide](./DEPLOYMENT_GUIDE.md)**\n\n## 🛠 Available Scripts\n\n### Backend\n```bash\nnpm start          # Start production server\nnpm run dev        # Start development server with nodemon\nnpm test           # Run test suite\nnpm run test:watch # Run tests in watch mode\nnpm run test:coverage # Run tests with coverage report\nnpm run lint       # Run ESLint\nnpm run lint:fix   # Fix ESLint issues\n```\n\n### Frontend\n```bash\ncd punchline-front\nnpm start          # Start development server\nnpm run build      # Build for production\n```\n\n## 🏗 Project Structure\n\n```\npunchline/\n├── 📁 middleware/          # Express middleware\n│   ├── errorHandler.js     # Error handling\n│   └── validation.js       # Input validation\n├── 📁 routes/              # API routes\n│   └── quotes.js           # Quote endpoints\n├── 📁 services/            # Business logic\n│   ├── db.js              # Database service\n│   └── quotes.js          # Quote service\n├── 📁 tests/              # Test suites\n│   ├── services/          # Service tests\n│   ├── routes/            # Route tests\n│   └── middleware/        # Middleware tests\n├── 📁 punchline-front/    # React frontend\n│   ├── 📁 src/\n│   │   ├── 📁 components/ # React components\n│   │   ├── 📁 hooks/      # Custom hooks\n│   │   └── 📁 sass/       # Styles\n├── 📁 .github/workflows/  # CI/CD pipelines\n├── 🐳 Dockerfile          # Docker configuration\n├── 🐳 docker-compose.yml  # Multi-container setup\n├── ⚙️ config.js           # Application config\n└── 🚀 main.js             # Application entry point\n```\n\n## 🔧 Environment Variables\n\nCreate a `.env` file in the root directory:\n\n```env\n# Server Configuration\nPORT=3000\nNODE_ENV=development\n\n# Database\nDATABASE_PATH=./quotes.db\n\n# API Configuration\nLIST_PER_PAGE=20\nAPI_BASE_URL=http://localhost:3000\n\n# Frontend\nFRONTEND_URL=http://localhost:1234\n\n# Security\nRATE_LIMIT_WINDOW_MS=900000\nRATE_LIMIT_MAX_REQUESTS=100\nJWT_SECRET=your-secret-key-here\n\n# Cache\nCACHE_TTL=300\n```\n\n## 🧪 Testing\n\nThe project includes comprehensive test coverage:\n\n```bash\n# Run all tests\nnpm test\n\n# Run tests with coverage\nnpm run test:coverage\n\n# Run tests in watch mode\nnpm run test:watch\n```\n\n### Test Coverage\n- **Services**: Database operations, quote logic\n- **Routes**: API endpoints, validation, error handling  \n- **Middleware**: Authentication, validation, error handling\n- **Integration**: End-to-end API testing\n\n## 🚀 Deployment\n\n### 🌐 Automatic GitHub Pages Deployment\n\nEvery push to the `main` branch automatically deploys the application to GitHub Pages:\n\n1. **Push to main branch**\n2. **GitHub Actions runs tests**\n3. **Builds the application**\n4. **Deploys to gh-pages branch**\n5. **Available at `https://kevinbdx35.github.io/punchline/`**\n\n**Setup**: The `gh-pages` branch is created automatically on deployment.\n\n📖 **[Complete Deployment Guide](./DEPLOYMENT_GUIDE.md)** | 🚀 **[First Deployment Instructions](./FIRST_DEPLOYMENT.md)**\n\n### Production with Docker\n\n```bash\n# Build production images\ndocker-compose build\n\n# Deploy to production\ndocker-compose -f docker-compose.yml up -d\n\n# Scale services\ndocker-compose up --scale api=3\n```\n\n### Manual Deployment\n\n```bash\n# Install production dependencies\nnpm ci --only=production\n\n# Set environment to production\nexport NODE_ENV=production\n\n# Start application\nnpm start\n```\n\n## 🤝 Contributing\n\nWe welcome contributions! Please follow these steps:\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### Development Guidelines\n- Write tests for new features\n- Follow ESLint rules\n- Update documentation\n- Use conventional commits\n\n## 📈 Performance \u0026 Features\n\n- **⚡ Response Time**: \u003c 100ms average\n- **🔄 Caching**: Multi-layer caching strategy  \n- **📦 Compression**: Gzip/Brotli compression\n- **🗄️ Database**: Optimized SQLite with indexes\n- **🚀 Rate Limiting**: 100 requests per 15 minutes\n- **🎲 Random Quotes**: Inspirational content on demand\n- **🔍 Smart Search**: Real-time filtering and pagination\n- **❤️ Favorites**: Persistent user preferences\n\n## 🔒 Security\n\n- **🛡️ Helmet.js**: Security headers\n- **🚫 Rate Limiting**: DDoS protection\n- **✅ Input Validation**: Joi schema validation\n- **🔐 CORS**: Configured cross-origin policies\n- **🔒 Environment Variables**: Secure configuration\n\n## 📊 Monitoring\n\n- **🏥 Health Checks**: `/health` endpoint\n- **📈 Metrics**: Request/response tracking\n- **📝 Logging**: Structured logging with Morgan\n- **🚨 Error Tracking**: Comprehensive error handling\n\n## 📝 License\n\nThis project is licensed under the **MIT License** - see the [LICENSE](LICENSE) file for details.\n\n## 👥 Authors\n\n- **Kevin** - *Lead Developer*\n- **Rony** - *Backend Developer*  \n- **Victor** - *Frontend Developer*\n\n## 🙏 Acknowledgments\n\n- Express.js community for the robust framework\n- React team for the excellent frontend library\n- SQLite for the lightweight database solution\n- GitHub Pages for free hosting\n- All contributors and testers\n\n## Improvements\n\n- Fixed critical route ordering bug in `routes/quotes.js`: `GET /random` and `GET /stats` were declared after `GET /:id`, causing Express to match them as `/:id` with `id=\"random\"` / `id=\"stats\"` (returns NaN → 400 \"Invalid quote ID\"). Moved `/random` and `/stats` before `/:id`.\n- Removed `X-UA-Compatible` meta tag from `punchline-front/public/index.html`\n- Fixed `\u003cscript\u003e` tag placed after `\u003c/body\u003e` → moved inside `\u003cbody\u003e` (valid HTML)\n\n---\n\n\u003cdiv align=\"center\"\u003e\n\n**⭐ Star this repository if you found it helpful!**\n\n[Live Demo](https://kevinbdx35.github.io/punchline/) • [Report Bug](https://github.com/kevinbdx35/punchline/issues) • [Documentation](./API_DOCUMENTATION.md)\n\n\u003c/div\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkevinbdx35%2Fpunchline","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkevinbdx35%2Fpunchline","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkevinbdx35%2Fpunchline/lists"}