This project is a Notification API built with Node.js and TypeScript. It allows for the sending of notifications via different channels (e.g., SMS, WhatsApp) and provides an interface for receiving status updates via webhooks.
Before you begin, ensure you have met the following requirements:
- Node.js (v18.x or higher)
- npm (v6.x or higher) or yarn (v1.22.x or higher)
- Bun (v1.x or higher)
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
- Clone the repository:
git clone https://github.com/yourusername/nodejs-ts-notifications-api.git
cd nodejs-ts-notifications-api
- Install the dependencies:
npm install
-
Set up environment variables: Configure your db connection in
./config/config.json
file. -
Run the migrations:
npx sequelize-cli db:migrate
To run the application in development mode, use the following command:
yarn start
For production, first build the project and then start it:
yarn build
yarn serve
To run the automated tests for this system:
yarn test
Once the application is running, you can access the API locally:
- Base URL: http://localhost:3000
Swagger URL: http://localhost:3000/api-docs Navigate to this URL in your web browser to view the Swagger UI, which provides detailed documentation of all the API endpoints, models, and allows you to execute API requests directly from the interface.
POST /notifications - Send a notification. GET /notifications/{id} - Retrieve a notification by ID. POST /webhooks - Endpoint for external services to send updates. Each endpoint allows for various operations which are detailed in the Swagger documentation, where you can also try out the API in real-time.
Alvaro Paçó – @alvaropaco – [email protected]