Thanks to visit codestin.com
Credit goes to github.com

Skip to content

castell0riz0n/TeamA.DevFollow

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

TeamA.DevFollow.API

Overview

TeamA.DevFollow.API is a .NET 9 web API designed to manage habits and tags. It provides endpoints for creating, updating, retrieving, and deleting habits and tags, with support for HATEOAS links and data shaping.

Table of Contents

Features

  • CRUD operations for habits and tags
  • HATEOAS support for navigation links
  • Data shaping for optimized responses
  • FluentValidation for request validation
  • OpenTelemetry for observability
  • Docker support for containerized deployment

Technologies

  • .NET 9
  • ASP.NET Core
  • Entity Framework Core
  • FluentValidation
  • OpenTelemetry
  • PostgreSQL
  • Docker

Getting Started

Prerequisites

Installation

  1. Clone the repository:

  2. Set up the database:

    • Update the connection string in appsettings.json to point to your PostgreSQL instance.
  3. Apply database migrations:

    • dotnet ef database update

Running the Application

  1. Run the application:

    • dotnet run
  2. Alternatively, you can use Docker:

    • docker-compose up

API Endpoints

Tags

  • GET /tags: Retrieve all tags
  • GET /tags/{id}: Retrieve a specific tag by ID
  • POST /tags: Create a new tag
  • PUT /tags/{id}: Update an existing tag
  • DELETE /tags/{id}: Delete a tag

Habits

  • GET /habits: Retrieve all habits
  • GET /habits/{id}: Retrieve a specific habit by ID
  • POST /habits: Create a new habit
  • PUT /habits/{id}: Update an existing habit
  • PATCH /habits/{id}: Partially update a habit
  • DELETE /habits/{id}: Delete a habit

Validation

The project uses FluentValidation to validate incoming requests. Validators are defined for DTOs such as CreateTagDto and CreateHabitDto.

Example validation rules for CreateTagDto:

public sealed class CreateTagDtoValidator : AbstractValidator<CreateTagDto> 
{ 
    public CreateTagDtoValidator() 
    { 
        RuleFor(x => x.Name).NotEmpty().MinimumLength(3);
         RuleFor(x => x.Description).MaximumLength(50); 
    } 
}

Contributing

Contributions are welcome! Please follow these steps:

  1. Fork the repository.
  2. Create a new branch (git checkout -b feature/your-feature).
  3. Commit your changes (git commit -am 'Add new feature').
  4. Push to the branch (git push origin feature/your-feature).
  5. Create a new Pull Request.

License

This project is licensed under the MIT License. See the LICENSE file for details.

About

TeamA.DevFollow.API is a .NET 9 web API designed to manage habits and tags. It provides endpoints for creating, updating, retrieving, and deleting habits and tags, with support for HATEOAS links and data shaping.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors