https://github.com/robson-carvalho/thenews-tech-backend
A REST API that sends daily emails to subscribers with the latest technology news.
https://github.com/robson-carvalho/thenews-tech-backend
Last synced: 3 months ago
JSON representation
A REST API that sends daily emails to subscribers with the latest technology news.
- Host: GitHub
- URL: https://github.com/robson-carvalho/thenews-tech-backend
- Owner: Robson-Carvalho
- Created: 2025-02-08T13:52:59.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2025-02-19T13:51:15.000Z (3 months ago)
- Last Synced: 2025-02-19T14:31:00.768Z (3 months ago)
- Language: TypeScript
- Homepage: https://thenews-tech-api.vercel.app
- Size: 41 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
The News Tech API 💻
Technologies •
Getting Started •
API Endpoints •
Collaborators •
Contribute
A REST API that sends daily emails to subscribers with the latest technology news.
![]()
![]()
![]()
![]()
![]()
💻 Technologies
- Node.js
- Express
- Node-Cron
- PostgreSQL
- Nodemailer
- TypeScript🚀 Getting started
Here you describe how to run your project locally
Prerequisites
- [Node.js](https://nodejs.org/)
- [Git](https://git-scm.com/)
- [PostgreSQL](https://www.postgresql.org/)Cloning
```bash
git clone https://github.com/Robson-Carvalho/thenews-tech-backend.git
```Config .env variables
Use the `.env.example` as reference to create your configuration file `.env` with the required variables:
```yml
PORT=
DATABASE_URL=EXTERNAL_NEWS_API=
UNSUBSCRIBER_LINK=NODEMAILER_EMAIL_USER=
NODEMAILER_PASSWORD=
```Starting
```bash
cd thenews-tech-backend
npm install
npm start
```📍 API Endpoints
| Route | Method | Description |
| ------------------------------- | ------ | ----------------------------------- |
| POST v1/subscriber | POST | Subscribes a user to the newsletter |
| GET v1/subscriber | GET | Returns the number of subscribers |
| DELETE v1/subscriber | DELETE | Unsubscriber |POST v1/subscriber
**REQUEST**
```json
{
"email": "[email protected]"
}
```**RESPONSE**
```json
{
"status": "Success",
"message": "Registered"
}
```GET v1/subscriber/count
**RESPONSE**
```json
{
{
"status": "Success",
"data": {
"count": 1
}
}
}
```DELETE v1/subscriber
**REQUEST**
```json
{
"email": "[email protected]"
}
```**RESPONSE**
```json
{
"status": "Success",
"message": "Deleted"
}
```🤝 Collaborators
📫 Contribute
1. Fork this repository
2. Create a new branch: `git checkout -b feature/your-feature`
3. Commit your changes: `git commit -m 'Add some feature'`
4. Push to the branch: `git push origin feature/your-feature`
5. Open a Pull Request explaining your contribution---
Made with ❤️ by [Robson Carvalho](https://www.linkedin.com/in/robson-carvalho-souza/).