https://github.com/devgabrielcoelho/calendarapi
CallendarAPI is a RESTful API for calendar management, managing events and reminders with secure authentication. Features: authentication via JWT, email notifications, Serilog, Docker. How to install: Use Docker and set up your .env file. Endpoints get users, events, and reminders.
https://github.com/devgabrielcoelho/calendarapi
api asp-net-core callendar csharp docker jwt postgresql serilog
Last synced: about 2 months ago
JSON representation
CallendarAPI is a RESTful API for calendar management, managing events and reminders with secure authentication. Features: authentication via JWT, email notifications, Serilog, Docker. How to install: Use Docker and set up your .env file. Endpoints get users, events, and reminders.
- Host: GitHub
- URL: https://github.com/devgabrielcoelho/calendarapi
- Owner: DevGabrielCoelho
- Created: 2025-01-19T11:43:36.000Z (over 1 year ago)
- Default Branch: DevGabrielCoelho
- Last Pushed: 2025-02-10T16:25:51.000Z (over 1 year ago)
- Last Synced: 2025-08-29T08:42:31.433Z (10 months ago)
- Topics: api, asp-net-core, callendar, csharp, docker, jwt, postgresql, serilog
- Language: C#
- Homepage:
- Size: 43.9 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# CallendarAPI
A calendar management API that allows users to create, update, and manage events and reminders with secure authentication.
## ๐ ๏ธ Features
- User authentication and authorization with JWT.
- Creation and management of events and reminders.
- Email notifications for scheduled events.
- API logging using Serilog.
- Docker support for easy deployment.
## ๐ Prerequisites
Ensure you have the following tools installed on your machine before starting:
- **[Docker](https://www.docker.com/products/docker-desktop/)** (recommended latest version)
## ๐ Installation and Setup
1. **Clone the repository:**
```bash
git clone https://github.com/DevGabrielCoelho/CalendarApi.git
cd CallendarApi
```
2. **Configure the environment file:**
Create the `.env` file in the root of the project and add the following configurations (adjust as needed):
```.env
Logging_DOCKER_LogLevel__Default=Information
Logging_DOCKER_LogLevel__MicrosoftAspNetCore=Warning
Serilog_DOCKER_MinimumLevel=Information
Serilog_DOCKER_WriteTo__1__Args__rollingInterval=Day
AllowedHostsDOCKER="*"
ConnectionStrings_DOCKER_Npgsql='Host=localhost;Port=5432;Database=CalendarApi;Username=postgres;Password=mysecretpassword'
JWT_DOCKER_Issuer='http://localhost:5236'
JWT_DOCKER_Audience='http://localhost:5236'
JWT_DOCKER_SigninKey='YourStrongSigninKey' #Sha512
Email_DOCKER_SmtpServer='smtp.gmail.com'
Email_DOCKER_SmtpPort=587
Email_DOCKER_SmtpUser='your-email@gmail.com'
Email_DOCKER_SmtpPass='your-email-password or app password'
PasswordHasherSettings_DOCKER_SaltSize=16
PasswordHasherSettings_DOCKER_KeySize=32
PasswordHasherSettings_DOCKER_MemorySize=15360
PasswordHasherSettings_DOCKER_Iterations=2
PasswordHasherSettings_DOCKER_DegreeOfParallelism=1
PasswordHasherSettings_DOCKER_Delimiter=";"
POSTGRES_DOCKER_PASSWORD=mysecretpassword
POSTGRES_DOCKER_USER=postgres
POSTGRES_DOCKER_DB=CalendarApi
DOCKER_NPGSQL_PORT=5432:5432
DOCKER_ASP_NET_CORE_PORT=5236:5236
URLS=http://+:5236
```
3. **Start Docker build:**
```bash
docker-compose up -d --build
```
4. Access the API at:
```
http://localhost:5236 (or the port configured in .env)
```
## ๐งช API Endpoints
Here are the available routes and their main functionalities:
### ๐ก๏ธ Authentication
- **`POST /api/auth/register`**: Creates a new user.
- **`POST /api/auth/send-code`**: Send code to user email.
- **`POST /api/auth/validate-code`**: Validate user email.
- **`POST /api/auth/login`**: Performs user authentication.
### ๐
Events Management
- **`POST /api/events`**: Creates a new event.
- **`GET /api/events`**: Retrieves all events.
- **`GET /api/events/{id}`**: Retrieves events by id.
- **`PUT /api/events/{id}`**: Updates an existing event.
- **`DELETE /api/events/{id}`**: Deletes an event.
### โฐ Reminders Management
- **`GET /api/reminders`**: Retrieves all reminders.
- **`POST /api/reminders`**: Creates a new reminder.
- **`PUT /api/reminders/{id}`**: Updates an existing reminder.
- **`DELETE /api/reminders/{id}`**: Deletes a reminder.
## ๐ ๏ธ Technologies Used
- **C#**: Programming language.
- **ASP.NET Core**: Framework for building RESTful APIs.
- **PostgreSQL**: Relational database.
- **JWT**: For secure authentication.
- **Serilog**: For logging.
- **Docker**: For containerization and deployment.
## ๐ Project Structure
```
src/
โโโ Controllers/ # Controllers for API routes
โโโ Data/ # Database context
โโโ Docker/ # Docker setup files
โโโ Dtos/ # Data transfer objects
โโโ Interfaces/ # Contracts for abstractions
โโโ Mappers/ # DTO to Model conversions and vice versa
โโโ Migrations/ # Database migrations
โโโ Models/ # Data models
โโโ Properties/ # Project configurations
โโโ Repository/ # Data access logic
โโโ Services/ # Business logic implementations
```
## ๐ Contact
For questions, suggestions, or collaborations, feel free to reach out:
- **Gabriel Coelho**
- GitHub: [DevGabrielCoelho](https://github.com/DevGabrielCoelho)
- Email: [gabriel.coelhosousasantos.pv@gmail.com](mailto:gabriel.coelhosousasantos.pv@gmail.com)