|
1 | | -<p align="center"> |
2 | | - <a href="http://nestjs.com/" target="blank"><img src="https://nestjs.com/img/logo-small.svg" width="120" alt="Nest Logo" /></a> |
3 | | -</p> |
4 | | - |
5 | | -[circleci-image]: https://img.shields.io/circleci/build/github/nestjs/nest/master?token=abc123def456 |
6 | | -[circleci-url]: https://circleci.com/gh/nestjs/nest |
7 | | - |
8 | | - <p align="center">A progressive <a href="http://nodejs.org" target="_blank">Node.js</a> framework for building efficient and scalable server-side applications.</p> |
9 | | - <p align="center"> |
10 | | -<a href="https://www.npmjs.com/~nestjscore" target="_blank"><img src="https://img.shields.io/npm/v/@nestjs/core.svg" alt="NPM Version" /></a> |
11 | | -<a href="https://www.npmjs.com/~nestjscore" target="_blank"><img src="https://img.shields.io/npm/l/@nestjs/core.svg" alt="Package License" /></a> |
12 | | -<a href="https://www.npmjs.com/~nestjscore" target="_blank"><img src="https://img.shields.io/npm/dm/@nestjs/common.svg" alt="NPM Downloads" /></a> |
13 | | -<a href="https://circleci.com/gh/nestjs/nest" target="_blank"><img src="https://img.shields.io/circleci/build/github/nestjs/nest/master" alt="CircleCI" /></a> |
14 | | -<a href="https://discord.gg/G7Qnnhy" target="_blank"><img src="https://img.shields.io/badge/discord-online-brightgreen.svg" alt="Discord"/></a> |
15 | | -<a href="https://opencollective.com/nest#backer" target="_blank"><img src="https://opencollective.com/nest/backers/badge.svg" alt="Backers on Open Collective" /></a> |
16 | | -<a href="https://opencollective.com/nest#sponsor" target="_blank"><img src="https://opencollective.com/nest/sponsors/badge.svg" alt="Sponsors on Open Collective" /></a> |
17 | | - <a href="https://paypal.me/kamilmysliwiec" target="_blank"><img src="https://img.shields.io/badge/Donate-PayPal-ff3f59.svg" alt="Donate us"/></a> |
18 | | - <a href="https://opencollective.com/nest#sponsor" target="_blank"><img src="https://img.shields.io/badge/Support%20us-Open%20Collective-41B883.svg" alt="Support us"></a> |
19 | | - <a href="https://twitter.com/nestframework" target="_blank"><img src="https://img.shields.io/twitter/follow/nestframework.svg?style=social&label=Follow" alt="Follow us on Twitter"></a> |
20 | | -</p> |
21 | | - <!--[](https://opencollective.com/nest#backer) |
22 | | - [](https://opencollective.com/nest#sponsor)--> |
23 | | - |
24 | | -## Description |
25 | | - |
26 | | -[Nest](https://github.com/nestjs/nest) framework TypeScript starter repository. |
27 | | - |
28 | | -## Project setup |
| 1 | +# 📬 NotifyLog |
29 | 2 |
|
30 | | -```bash |
31 | | -$ npm install |
32 | | -``` |
| 3 | +> A microservice-based Notification Logger built with NestJS and Next.js to send, track, and analyze Email, SMS, and Webhook messages. |
| 4 | +
|
| 5 | + |
| 6 | + |
| 7 | + |
| 8 | + |
| 9 | + |
| 10 | +--- |
| 11 | + |
| 12 | +## 🌟 Highlights |
| 13 | + |
| 14 | +- 🚀 Microservice architecture using **NestJS** |
| 15 | +- 🌐 Clean and powerful **GraphQL API** |
| 16 | +- ✉️ Supports Email, SMS, and Webhook notifications |
| 17 | +- 📦 Centralized logging using **Winston** + **MongoDB** |
| 18 | +- 🎯 Extensible via plug-and-play notification providers |
| 19 | +- 🧪 Tested with **Jest** and designed for scalability |
| 20 | +- 💻 Lightweight **Next.js** frontend dashboard |
| 21 | + |
| 22 | +--- |
| 23 | + |
| 24 | +## 📖 Overview |
| 25 | + |
| 26 | +**NotifyLog** is a robust, plug-and-play Node.js-based notification microservice designed to handle multi-channel communication like Email, SMS, and Webhooks, all with centralized logging and GraphQL API support. Built using **NestJS** and **Next.js**, it follows clean architecture principles and is deployable in a distributed, containerized environment. |
| 27 | + |
| 28 | +Use NotifyLog as: |
| 29 | +- A backend service for sending and tracking messages |
| 30 | +- A standalone logger for notification events |
| 31 | +- An integration-ready module in any SaaS or enterprise app |
| 32 | + |
| 33 | +--- |
| 34 | +Sure! Here's a clean and properly formatted `README.md` file that includes all the content you provided: |
33 | 35 |
|
34 | | -## Compile and run the project |
| 36 | +--- |
| 37 | + |
| 38 | +```markdown |
| 39 | +# NotifyLog 🚨 |
| 40 | + |
| 41 | +A notification management system with logging, monitoring, and multi-channel delivery support. |
| 42 | + |
| 43 | +--- |
| 44 | + |
| 45 | +## ⚙️ Setup & Installation |
| 46 | + |
| 47 | +### 🔧 Prerequisites |
| 48 | + |
| 49 | +- **Node.js** ≥ 18.x |
| 50 | +- **Yarn** or **npm** |
| 51 | +- **MongoDB** or **MongoDB Atlas** |
| 52 | +- **Docker** (optional) |
| 53 | + |
| 54 | +--- |
| 55 | + |
| 56 | +## 🚀 Run Locally |
35 | 57 |
|
36 | 58 | ```bash |
37 | | -# development |
38 | | -$ npm run start |
| 59 | +# Clone repo |
| 60 | +git clone https://github.com/yourusername/notifylog.git && cd notifylog |
| 61 | + |
| 62 | +# Install dependencies |
| 63 | +yarn install |
39 | 64 |
|
40 | | -# watch mode |
41 | | -$ npm run start:dev |
| 65 | +# Setup environment variables |
| 66 | +cp .env.example .env |
| 67 | +# Fill in your email/SMS API keys, Mongo URI, etc. |
42 | 68 |
|
43 | | -# production mode |
44 | | -$ npm run start:prod |
| 69 | +# Start backend |
| 70 | +yarn start:dev:api |
| 71 | + |
| 72 | +# Start frontend |
| 73 | +yarn start:dev:ui |
45 | 74 | ``` |
46 | 75 |
|
47 | | -## Run tests |
| 76 | +--- |
| 77 | + |
| 78 | +## 🐳 Run with Docker |
48 | 79 |
|
49 | 80 | ```bash |
50 | | -# unit tests |
51 | | -$ npm run test |
| 81 | +docker-compose up --build |
| 82 | +``` |
52 | 83 |
|
53 | | -# e2e tests |
54 | | -$ npm run test:e2e |
| 84 | +--- |
55 | 85 |
|
56 | | -# test coverage |
57 | | -$ npm run test:cov |
58 | | -``` |
| 86 | +## 📌 Features |
| 87 | + |
| 88 | +✅ GraphQL API to manage notifications, logs, and subscriptions |
| 89 | +📧 Email Module (send emails using SendGrid/Mailgun) |
| 90 | +📲 SMS Module (Twilio integration) |
| 91 | +🔔 Webhook Support (event-based triggers to external services) |
| 92 | +📝 MongoDB Logging with Winston (request/response/errors) |
| 93 | +🧩 Extensible Providers (add your own integrations easily) |
| 94 | +💻 Next.js UI for monitoring and manual message dispatch |
59 | 95 |
|
60 | | -## Deployment |
| 96 | +--- |
| 97 | + |
| 98 | +## 🔬 Example GraphQL Query |
| 99 | + |
| 100 | +```graphql |
| 101 | +mutation SendEmail { |
| 102 | + sendNotification(input: { |
| 103 | + type: "EMAIL", |
| 104 | + to: "example@domain.com", |
| 105 | + subject: "Welcome!", |
| 106 | + message: "Hello from NotifyLog!" |
| 107 | + }) { |
| 108 | + success |
| 109 | + messageId |
| 110 | + } |
| 111 | +} |
| 112 | +``` |
61 | 113 |
|
62 | | -When you're ready to deploy your NestJS application to production, there are some key steps you can take to ensure it runs as efficiently as possible. Check out the [deployment documentation](https://docs.nestjs.com/deployment) for more information. |
| 114 | +--- |
63 | 115 |
|
64 | | -If you are looking for a cloud-based platform to deploy your NestJS application, check out [Mau](https://mau.nestjs.com), our official platform for deploying NestJS applications on AWS. Mau makes deployment straightforward and fast, requiring just a few simple steps: |
| 116 | +## 🧪 Testing |
65 | 117 |
|
66 | 118 | ```bash |
67 | | -$ npm install -g @nestjs/mau |
68 | | -$ mau deploy |
| 119 | +# Run all tests |
| 120 | +yarn test |
| 121 | + |
| 122 | +# Run coverage |
| 123 | +yarn test:cov |
69 | 124 | ``` |
70 | 125 |
|
71 | | -With Mau, you can deploy your application in just a few clicks, allowing you to focus on building features rather than managing infrastructure. |
| 126 | +--- |
| 127 | + |
| 128 | +## 📈 Roadmap |
| 129 | + |
| 130 | +- WebSocket-based real-time logs |
| 131 | +- Retry strategy for failed webhook calls |
| 132 | +- Admin dashboard analytics |
| 133 | +- SMTP transport fallback |
| 134 | +- Mobile-friendly UI |
| 135 | + |
| 136 | +--- |
| 137 | + |
| 138 | +## 🤝 Contributing |
72 | 139 |
|
73 | | -## Resources |
| 140 | +We welcome contributions of all kinds! |
74 | 141 |
|
75 | | -Check out a few resources that may come in handy when working with NestJS: |
| 142 | +1. Fork the repo |
| 143 | +2. Create your feature branch: `git checkout -b feat/amazing-feature` |
| 144 | +3. Commit your changes: `git commit -am 'Add amazing feature'` |
| 145 | +4. Push to the branch: `git push origin feat/amazing-feature` |
| 146 | +5. Open a pull request |
76 | 147 |
|
77 | | -- Visit the [NestJS Documentation](https://docs.nestjs.com) to learn more about the framework. |
78 | | -- For questions and support, please visit our [Discord channel](https://discord.gg/G7Qnnhy). |
79 | | -- To dive deeper and get more hands-on experience, check out our official video [courses](https://courses.nestjs.com/). |
80 | | -- Deploy your application to AWS with the help of [NestJS Mau](https://mau.nestjs.com) in just a few clicks. |
81 | | -- Visualize your application graph and interact with the NestJS application in real-time using [NestJS Devtools](https://devtools.nestjs.com). |
82 | | -- Need help with your project (part-time to full-time)? Check out our official [enterprise support](https://enterprise.nestjs.com). |
83 | | -- To stay in the loop and get updates, follow us on [X](https://x.com/nestframework) and [LinkedIn](https://linkedin.com/company/nestjs). |
84 | | -- Looking for a job, or have a job to offer? Check out our official [Jobs board](https://jobs.nestjs.com). |
| 148 | +For more info, see [CONTRIBUTING.md](CONTRIBUTING.md) |
85 | 149 |
|
86 | | -## Support |
| 150 | +--- |
87 | 151 |
|
88 | | -Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please [read more here](https://docs.nestjs.com/support). |
| 152 | +## 🐛 Issue Templates |
89 | 153 |
|
90 | | -## Stay in touch |
| 154 | +Need to report a bug or request a feature? Use the templates in `.github/ISSUE_TEMPLATE`: |
91 | 155 |
|
92 | | -- Author - [Kamil Myśliwiec](https://twitter.com/kammysliwiec) |
93 | | -- Website - [https://nestjs.com](https://nestjs.com/) |
94 | | -- Twitter - [@nestframework](https://twitter.com/nestframework) |
| 156 | +- 🐞 Bug Report |
| 157 | +- ✨ Feature Request |
| 158 | +- 📚 Documentation Update |
| 159 | +- 🆕 Good First Issue |
95 | 160 |
|
96 | | -## License |
| 161 | +--- |
97 | 162 |
|
98 | | -Nest is [MIT licensed](https://github.com/nestjs/nest/blob/master/LICENSE). |
| 163 | +## 🛡 License |
| 164 | + |
| 165 | +This project is licensed under the MIT License. |
| 166 | + |
| 167 | +--- |
| 168 | + |
| 169 | +## 📣 Contact & Credits |
| 170 | + |
| 171 | +Maintained by **Your Name** – feel free to connect on [LinkedIn] or [Twitter]. |
| 172 | + |
| 173 | +Special thanks to all contributors 💖 |
| 174 | +``` |
| 175 | + |
| 176 | +--- |
| 177 | + |
| 178 | +Let me know if you'd like this customized with your actual GitHub username, social links, or any branding tweaks! |
| 179 | + |
| 180 | +## 📂 Project Structure |
| 181 | + |
| 182 | +```bash |
| 183 | +notifylog/ |
| 184 | +├── apps/ |
| 185 | +│ ├── notifylog-api/ |
| 186 | +│ │ ├── src/ |
| 187 | +│ │ │ ├── application/ |
| 188 | +│ │ │ │ ├── factories/ |
| 189 | +│ │ │ │ │ └── notification.factory.ts |
| 190 | +│ │ │ │ └── strategies/ |
| 191 | +│ │ │ │ ├── email-notification.strategy.ts |
| 192 | +│ │ │ │ └── sms-notification.strategy.ts |
| 193 | +│ │ │ ├── domain/ |
| 194 | +│ │ │ │ └── interfaces/ |
| 195 | +│ │ │ │ ├── notification-repository.interface.ts |
| 196 | +│ │ │ │ └── webhook-repository.interface.ts |
| 197 | +│ │ │ ├── infrastructure/ |
| 198 | +│ │ │ │ └── repositories/ |
| 199 | +│ │ │ │ ├── notification.repository.ts |
| 200 | +│ │ │ │ └── webhook.repository.ts |
| 201 | +│ │ │ ├── presentation/ |
| 202 | +│ │ │ │ └── resolvers/ |
| 203 | +│ │ │ │ ├── notification.resolver.ts |
| 204 | +│ │ │ │ ├── webhook.resolver.ts |
| 205 | +│ │ │ │ └── log.resolver.ts |
| 206 | +│ │ │ ├── dto/ |
| 207 | +│ │ │ │ └── notification.dto.ts |
| 208 | +│ │ │ ├── services/ |
| 209 | +│ │ │ │ └── log.service.ts |
| 210 | +│ │ │ ├── app.module.ts |
| 211 | +│ │ │ └── main.ts |
| 212 | +│ │ ├── package.json |
| 213 | +│ │ ├── tsconfig.json |
| 214 | +│ │ └── .env.example |
| 215 | +│ └── notifylog-ui/ |
| 216 | +│ ├── src/ |
| 217 | +│ │ ├── app/ |
| 218 | +│ │ │ ├── page.tsx |
| 219 | +│ │ │ ├── notifications/ |
| 220 | +│ │ │ │ └── page.tsx |
| 221 | +│ │ │ ├── errors/ |
| 222 | +│ │ │ │ └── page.tsx |
| 223 | +│ │ │ ├── layout.tsx |
| 224 | +│ │ │ └── globals.css |
| 225 | +│ │ ├── components/ |
| 226 | +│ │ │ ├── Header.tsx |
| 227 | +│ │ │ ├── NotificationTable.tsx |
| 228 | +│ │ │ └── ErrorTable.tsx |
| 229 | +│ │ └── lib/ |
| 230 | +│ │ ├── api.ts |
| 231 | +│ │ └── types.ts |
| 232 | +│ ├── public/ |
| 233 | +│ ├── package.json |
| 234 | +│ └── next.config.js |
| 235 | +├── libs/ |
| 236 | +│ ├── logger/ |
| 237 | +│ │ ├── src/ |
| 238 | +│ │ │ ├── interfaces/ |
| 239 | +│ │ │ │ └── log-repository.interface.ts |
| 240 | +│ │ │ ├── persistence/ |
| 241 | +│ │ │ │ └── logger.schema.ts |
| 242 | +│ │ │ ├── repositories/ |
| 243 | +│ │ │ │ └── log.repository.ts |
| 244 | +│ │ │ └── services/ |
| 245 | +│ │ │ ├── logger.service.file.ts |
| 246 | +│ │ │ └── logger.service.db.ts |
| 247 | +│ │ ├── package.json |
| 248 | +│ │ └── tsconfig.json |
| 249 | +│ └── utils/ |
| 250 | +│ ├── src/ |
| 251 | +│ │ ├── helpers/ |
| 252 | +│ │ │ ├── string.utils.ts |
| 253 | +│ │ │ └── validation.utils.ts |
| 254 | +│ │ ├── interceptors/ |
| 255 | +│ │ │ └── logging.interceptor.ts |
| 256 | +│ │ └── constants/ |
| 257 | +│ │ └── app.constants.ts |
| 258 | +│ ├── package.json |
| 259 | +│ └── tsconfig.json |
| 260 | +├── prisma/ |
| 261 | +│ ├── schema.prisma |
| 262 | +│ └── migrations/ |
| 263 | +├── docker/ |
| 264 | +│ ├── Dockerfile.api |
| 265 | +│ ├── Dockerfile.ui |
| 266 | +│ └── docker-compose.yml |
| 267 | +├── .github/ |
| 268 | +│ ├── ISSUE\_TEMPLATE/ |
| 269 | +│ └── workflows/ |
| 270 | +│ └── ci.yml |
| 271 | +├── README.md |
| 272 | +├── CONTRIBUTING.md |
| 273 | +├── CODE\_OF\_CONDUCT.md |
| 274 | +├── LICENSE |
0 commit comments