https://github.com/falexandrou/notification-preference-center
A micro API which can be used as a preference center for notifications
https://github.com/falexandrou/notification-preference-center
api microservice notifications prisma typescript
Last synced: about 1 year ago
JSON representation
A micro API which can be used as a preference center for notifications
- Host: GitHub
- URL: https://github.com/falexandrou/notification-preference-center
- Owner: falexandrou
- License: mit
- Created: 2022-04-08T09:55:17.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2022-08-19T08:02:41.000Z (over 3 years ago)
- Last Synced: 2025-01-17T17:38:40.865Z (about 1 year ago)
- Topics: api, microservice, notifications, prisma, typescript
- Language: TypeScript
- Homepage:
- Size: 991 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
## Notification Preference Center
The notification center, is an API you can use as a micro-service in order to store notification consents provided by your users
### Running the project with Docker
To run the project with Docker, simply run:
```
docker-compose up
```
This will start a MySQL and the App containers, migrate the database and start the server. The app will be available at [http://localhost:3000](http://localhost:3000)
### Running without Docker
To start the project without docker you need to do the following:
- Install the project's dependencies with `yarn`
- Specify a database URL in the proper format, for example `mysql://root:qwerty1@localhost:3306/notifications`
- Use the database URL and start the server
```
DATABASE_URL= nodemon src/index.ts
```
### Developing
The development version uses [`nodemon`](https://www.npmjs.com/package/nodemon) which means that whenever you save a file, the application server will restart
### Running the tests
If you're using Docker, you can just enter the container by running
```
docker exec -it notifiations_center_app /bin/sh
```
then inside the container, run
```
yarn test
```
If you're not Docker, you need to specify the URL for the test database, for example `mysql://root:qwerty1@localhost:3306/notifications_test_db` then run
```
APP_PORT=4000 DATABASE_URL= && yarn run prisma migrate reset --force && jest --bail --verbose
```
### Documentation
The API's documentation can be found on the following URL: https://www.falexandrou.com/notification-preference-center/
### Reporting issues / Pull Request
Reporting issues and submit a pull requests is more than welcome. Please feel free to contribute