This project is a Notification Service developed as part of the Desafio Magalu. It's built using ASP.NET Core and aims to provide a robust API for scheduling, sending, and managing notifications.
- C# for the backend logic.
- ASP.NET Core for creating the web API.
- Entity Framework Core for database operations.
- Hangfire for job scheduling.
- PostgreSQL as the database.
- Docker for running the PostgreSQL database.
- .NET 5.0 SDK or later
- Visual Studio 2019 or JetBrains Rider 2024.1.4 or later
- Docker and Docker Compose
This project uses PostgreSQL as its database, running in a Docker container for development environments.
- Ensure Docker and Docker Compose are installed on your machine.
- After clone the repository, check if
docker-compose.yml
file in the root directory of the project with the following content:
version: "3"
services:
db:
image: postgres
restart: always
environment:
POSTGRES_USER: root
POSTGRES_PASSWORD: 123
POSTGRES_DB: magaludb
TZ: America/Sao_Paulo
volumes:
- ./data:/var/lib/postgresql/data
ports:
- 5432:5432
- Clone the repository:
https://github.com/GabrielGSD/Desafio-Backend-Magalu
- Navigate to the project directory:
cd DesafioMagalu
- Restore the .NET packages:
dotnet restore
- Update the database (if using Entity Framework Core):
dotnet ef database update
- Start the PostgreSQL database by running:
docker-compose up -d
- Run the command to generate the migrations:
dotnet ef migrations add <msg>
- Apply the migrations to the database to create the tables:
dotnet ef database update
- Start the application:
dotnet run
The API supports the following operations:
- POST /api/notification: Schedule a new notification.
- GET /api/notification?notificationId={id}: Retrieve a notification by its ID.
- DELETE /api/notification?notificationId={id}: Cancel a scheduled notification.
Contributions are welcome! Please feel free to submit a pull request or open an issue for any bugs or feature requests.
This project was inspired by the video tutorial "Resolvendo DESAFIO BACKEND da Magalu com Spring Boot, Scheduler e MySQL" from the Build & Run YouTube channel. The concepts and techniques demonstrated in the video were adapted and expanded upon to fit the specific needs and objectives of this project.
The GitHub repository for the solution can be found here: Build & Run - Repository
Check out the full announcement by clicking here: Desafio Magalu.