{"id":19390496,"url":"https://github.com/hassonor/ts-node-express-redis-bull-template","last_synced_at":"2025-04-14T03:42:33.002Z","repository":{"id":197627435,"uuid":"699016564","full_name":"hassonor/ts-node-express-redis-bull-template","owner":"hassonor","description":null,"archived":false,"fork":false,"pushed_at":"2023-10-01T17:29:07.000Z","size":126,"stargazers_count":11,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-27T17:46:43.232Z","etag":null,"topics":["boilerplate","bull","bunyan","express","nodejs","queues","socket-io","template-project","ts","workers"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/hassonor.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}},"created_at":"2023-10-01T17:14:01.000Z","updated_at":"2024-09-16T14:13:13.000Z","dependencies_parsed_at":null,"dependency_job_id":"c73cc60e-6c35-4bc1-abae-baa966f39bda","html_url":"https://github.com/hassonor/ts-node-express-redis-bull-template","commit_stats":null,"previous_names":["hassonor/ts-node-express-redis-bull-template"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hassonor%2Fts-node-express-redis-bull-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hassonor%2Fts-node-express-redis-bull-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hassonor%2Fts-node-express-redis-bull-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hassonor%2Fts-node-express-redis-bull-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hassonor","download_url":"https://codeload.github.com/hassonor/ts-node-express-redis-bull-template/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248818804,"owners_count":21166468,"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":["boilerplate","bull","bunyan","express","nodejs","queues","socket-io","template-project","ts","workers"],"created_at":"2024-11-10T10:21:20.508Z","updated_at":"2025-04-14T03:42:32.977Z","avatar_url":"https://github.com/hassonor.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TS-Node-Express-Redis-Bull Template\n\nWelcome to the **TS-Node-Express-Redis-Bull** template!\nDive into a world-class development experience with this cutting-edge template,\ntailored for developers who seek excellence.\nHarness the power of TypeScript, Node.js, Express, Redis,\nand Bull to craft scalable, efficient, and robust web applications.\n\n## 📂 Structure\n\n- **src/app.ts**: The main application entry point.\n- **src/config.ts**: Configuration settings for the application.\n- **src/routes.ts**: Defines the application routes.\n- **src/setupDatabase.ts**: Set up the database connection.\n- **src/setupServer.ts**: Configures and sets up the Express server.\n- **src/shared/globals/helpers/error-handler.ts**: Global error handler.\n- **src/shared/globals/helpers/helpers.ts**: Utility and helper functions.\n- **src/shared/services/db/auth.service.ts**: Authentication service.\n- **src/shared/services/db/user.service.ts**: User service.\n- **src/shared/services/emails/mail.transport.ts**: Email transport configuration.\n- **src/shared/services/queues/auth.queue.ts**: Authentication queue.\n- **src/shared/services/queues/base.queue.ts**: Base queue.\n- **src/shared/services/queues/email.queue.ts**: Email queue.\n- **src/shared/services/queues/user.queue.ts**: User queue.\n- **src/shared/services/redis/base.cache.ts**: Base cache for Redis.\n- **src/shared/services/redis/redis.connection.ts**: Redis connection setup.\n- **src/shared/services/redis/user.cache.ts**: User cache in Redis.\n- **src/shared/sockets/user.socket.ts**: User socket configuration.\n- **src/shared/workers/auth.worker.ts**: Authentication worker.\n\n\n## 🌟 Features\n\n- **TypeScript**: Strongly-typed JavaScript for better developer experience.\n- **Node.js \u0026 Express**: Fast and scalable backend framework.\n- **Redis**: In-memory data structure store used for caching and as a message broker.\n- **Bull**: A Node.js library that provides robust job and message queue based on Redis.\n- **Modular Structure**: Organized and modular code structure for scalability and maintainability.\n- **Error Handling**: Global error handler for handling exceptions and errors.\n- **Authentication**: Built-in authentication using JWT.\n- **Email Service**: Integrated email service for sending emails.\n- **Web Sockets**: Real-time bidirectional event-based communication.\n- **Workers**: Separate workers for handling background tasks.\n  ... and more!\n\n## Getting Started\n\n1. Redis: Set it up with this [Guide](https://redis.io/docs/getting-started/installation/install-redis-on-windows/)\n2. Redis Commander: Get it running with this [Guide](https://www.npmjs.com/package/redis-commander)\n3. Install dependencies: `npm i`\n4. Start the development server: `npm run dev`\n5. Run tests: `npm run test`\n6. Redis Cache URL: `http://localhost:8081`\n7. Bull Queues: `http://localhost:5000/queues/queue/auth`\n\n# API Request Examples\n\n## 1. SignUp Request\n### To set your avatar image, you'll need to provide the image in a Base64 encoded format. Here's an example of the expected JSON structure:\n**Endpoint:**  \n`POST` http://localhost:5000/api/v1/signup\n\n**Raw Body:**\n```json\n{\n    \"username\": \"orh4\",\n    \"password\": \"zfq23546ydfg\",\n    \"email\": \"or3424234assf@gmail.com\",\n    \"avatarColor\": \"red\",\n    \"avatarImage\": \"YOUR_BASE64_ENCODED_IMAGE_HERE\"\n}\n```\n\n## 2. SignIn Request\n\n**Endpoint:**  \n`POST` http://localhost:5000/api/v1/signin\n\n**Raw Body:**\n```json\n{\n   \"username\": \"orh4\",\n   \"password\": \"zfq23546ydfg\"\n}\n```\n\n## 3. Forgot Password Request\n\n**Endpoint:**  \n`POST` http://localhost:5000/api/v1/forgot-password\n\n**Raw Body:**\n```json\n{\n   \"email\": \"or3424234assf@gmail.com\"\n}\n```\n\n## 4. Reset Password Request\n`Note: You need to paste the token from the mail.\n`\n**Endpoint:**  \n`POST` http://localhost:5000/api/v1/forgot-password/:token\n\n**Raw Body:**\n```json\n{\n   \"password\": \"someNewPassword\",\n   \"confirmPassword\": \"someNewPassword\"\n}\n```\n\n## 5. SignOut Request\n\n**Endpoint:**  \n`GET` http://localhost:5000/api/v1/signout\n\n## 6. CurrentUser Request\n\n**Endpoint:**  \n`GET` http://localhost:5000/api/v1/currentUser\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhassonor%2Fts-node-express-redis-bull-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhassonor%2Fts-node-express-redis-bull-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhassonor%2Fts-node-express-redis-bull-template/lists"}