|
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> |
| 1 | +# NotifyLog |
4 | 2 |
|
5 | | -[circleci-image]: https://img.shields.io/circleci/build/github/nestjs/nest/master?token=abc123def456 |
6 | | -[circleci-url]: https://circleci.com/gh/nestjs/nest |
| 3 | + |
| 4 | + |
| 5 | + |
7 | 6 |
|
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)--> |
| 7 | +**NotifyLog** is a full-stack Node.js/NestJS microservice for sending email/SMS notifications, logging messages/errors, and managing webhooks, paired with a Next.js/React frontend to visualize notification and error log history. Features an interactive **Swagger UI** for API exploration. |
23 | 8 |
|
24 | | -## Description |
| 9 | +## Table of Contents |
| 10 | +- [Features](#features) |
| 11 | +- [Tech Stack](#tech-stack) |
| 12 | +- [Getting Started](#getting-started) |
| 13 | +- [Frontend Setup](#frontend-setup) |
| 14 | +- [API Documentation](#api-documentation) |
| 15 | +- [Contributing](#contributing) |
| 16 | +- [License](#license) |
25 | 17 |
|
26 | | -[Nest](https://github.com/nestjs/nest) framework TypeScript starter repository. |
| 18 | +## Features |
| 19 | +- Send notifications (email/SMS) with a strategy pattern. |
| 20 | +- Dual logging: Winston for info logs, MongoDB for error logs. |
| 21 | +- Webhook subscriptions for real-time event notifications. |
| 22 | +- Advanced log filtering and retrieval. |
| 23 | +- Next.js/React frontend for notification and error log history. |
| 24 | +- **Swagger UI** for interactive API documentation. |
27 | 25 |
|
28 | | -## Project setup |
| 26 | +## Tech Stack |
| 27 | +- **Backend**: Node.js, NestJS, MongoDB, Mongoose, Winston, TypeScript |
| 28 | +- **Frontend**: Next.js, React, Tailwind CSS, React Query |
| 29 | +- **Tools**: Swagger UI, Prettier, ESLint |
29 | 30 |
|
30 | | -```bash |
31 | | -$ npm install |
32 | | -``` |
| 31 | +## Getting Started (Backend) |
| 32 | +### Prerequisites |
| 33 | +- Node.js (>=18.x) |
| 34 | +- MongoDB (local or Atlas) |
| 35 | +- Git |
33 | 36 |
|
34 | | -## Compile and run the project |
| 37 | +### Installation |
| 38 | +1. Clone the repository: |
| 39 | + ```bash |
| 40 | + git clone https://github.com/your-username/NotifyLog.git |
| 41 | + cd NotifyLog |
35 | 42 |
|
36 | | -```bash |
37 | | -# development |
38 | | -$ npm run start |
39 | 43 |
|
40 | | -# watch mode |
41 | | -$ npm run start:dev |
| 44 | +Install dependencies:npm install |
42 | 45 |
|
43 | | -# production mode |
44 | | -$ npm run start:prod |
45 | | -``` |
46 | 46 |
|
47 | | -## Run tests |
| 47 | +Create .env:MONGO_URI=mongodb://localhost:27017/notifylog |
48 | 48 |
|
49 | | -```bash |
50 | | -# unit tests |
51 | | -$ npm run test |
52 | 49 |
|
53 | | -# e2e tests |
54 | | -$ npm run test:e2e |
| 50 | +Start MongoDB:mongod |
55 | 51 |
|
56 | | -# test coverage |
57 | | -$ npm run test:cov |
58 | | -``` |
59 | 52 |
|
60 | | -## Deployment |
| 53 | +Run the backend:npm run start |
61 | 54 |
|
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. |
63 | 55 |
|
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: |
65 | 56 |
|
66 | | -```bash |
67 | | -$ npm install -g @nestjs/mau |
68 | | -$ mau deploy |
69 | | -``` |
| 57 | +Testing |
70 | 58 |
|
71 | | -With Mau, you can deploy your application in just a few clicks, allowing you to focus on building features rather than managing infrastructure. |
| 59 | +Access Swagger UI: http://localhost:3000/api |
| 60 | +Send notification:curl -X POST http://localhost:3000/api/notifications \ |
| 61 | +-H 'Content-Type: application/json' \ |
| 62 | +-d '{"recipient":"test@example.com","subject":"Test","body":"Message ID: MSG123.","mediaType":"EMAIL","notificationType":"message-id"}' |
72 | 63 |
|
73 | | -## Resources |
74 | 64 |
|
75 | | -Check out a few resources that may come in handy when working with NestJS: |
| 65 | +Get logs:curl http://localhost:3000/api/logs?level=error&context=NotificationController |
76 | 66 |
|
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). |
85 | 67 |
|
86 | | -## Support |
87 | 68 |
|
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). |
| 69 | +Frontend Setup |
| 70 | +Prerequisites |
89 | 71 |
|
90 | | -## Stay in touch |
| 72 | +Node.js (>=18.x) |
| 73 | +Backend running at http://localhost:3000 |
91 | 74 |
|
92 | | -- Author - [Kamil Myśliwiec](https://twitter.com/kammysliwiec) |
93 | | -- Website - [https://nestjs.com](https://nestjs.com/) |
94 | | -- Twitter - [@nestframework](https://twitter.com/nestframework) |
| 75 | +Installation |
95 | 76 |
|
96 | | -## License |
| 77 | +Clone the frontend (or navigate to directory):git clone https://github.com/your-username/notifylog-frontend.git |
| 78 | +cd notifylog-frontend |
97 | 79 |
|
98 | | -Nest is [MIT licensed](https://github.com/nestjs/nest/blob/master/LICENSE). |
| 80 | + |
| 81 | +Install dependencies:npm install |
| 82 | + |
| 83 | + |
| 84 | +Run the frontend:npm run dev |
| 85 | + |
| 86 | + |
| 87 | +Access at http://localhost:3001. |
| 88 | + |
| 89 | +API Documentation |
| 90 | +Explore APIs interactively via Swagger UI at http://localhost:3000/api. Test endpoints like /api/notifications, /api/webhooks, and /api/logs with a user-friendly interface. |
| 91 | +Contributing |
| 92 | +Contributions are welcome! Check CONTRIBUTING.md for guidelines and issues for tasks (good first issue, hacktoberfest). Join our Discord. |
| 93 | +License |
| 94 | +MIT License. See LICENSE.``` |
0 commit comments