Skip to content

Repository developed during the ASP .NET Core Training course maintained by the company Luis Dev. In this project, concepts of development of Web APIs using .NET 6, Clean Architecture, CQRS, Entity Framework Core, Dapper, Repository Pattern, Unit Tests, Authentication and Authorization with JWT, Messaging and Microservices were applied.

License

Notifications You must be signed in to change notification settings

AllanDutra/dev-freela

Repository files navigation

💻 Dev Freela

Repository developed during the ASP .NET Core Training course maintained by the company Luis Dev. In this project, concepts of development of Web APIs using .NET 6, Clean Architecture, CQRS, Entity Framework Core, Dapper, Repository Pattern, Unit Tests, Authentication and Authorization with JWT, Messaging and Microservices were applied.

📫 Routes

Projects Controller

"/api/projects"

Get all Projects

required headers:

Authorization: Bearer {token JWT}

roles:

"client", "freelancer"

query params:

query?: string

response:

[
  {
     "id": int,
     "title": string,
     "createdAt": DateTime
  }
]

"/api/projects/{id}"

Get Project by your id

required headers:

Authorization: Bearer {token JWT}

roles:

"client", "freelancer"

route params:

id: int

response:

{
  "id": int,
  "title": string,
  "description": string,
  "totalCost": decimal,
  "startedAt"?: DateTime,
  "finishedAt"?: DateTime,
  "clientFullName": string,
  "freelancerFullName": string
}

"/api/projects"

Create a new Project

required headers:

Authorization: Bearer {token JWT}

roles:

"client"

body:

{
   "title": string,
   "description": string,
   "idClient": int,
   "idFreelancer": int,
   "totalCost": decimal
}

response:

{
   "title": string,
   "description": string,
   "idClient": int,
   "idFreelancer": int,
   "totalCost": decimal
}

"/api/projects/{id}/comments"

Adds a comment to an existing project using your id

required headers:

Authorization: Bearer {token JWT}

roles:

"client", "freelancer"

route params:

id: int

body:

{
   "content": string,
   "idProject": int,
   "idUser": int	
}

response: No content


"/api/projects/{id}"

Update a Project by your id

required headers:

Authorization: Bearer {token JWT}

roles:

"client"

route params:

id: int

body:

{
  "id": int,
  "title": string,
  "description": string,
  "totalCost": decimal
}

response: No content


"/api/projects/{id}/start"

Changes the status of a project to "InProgress" by your id

required headers:

Authorization: Bearer {token JWT}

roles:

"client"

route params:

id: int

response: No content


"/api/projects/{id}/finish"

Changes the status of a project to "PaymentPending" by your id and sends a message to the payment microservice using RabbitMQ

required headers:

Authorization: Bearer {token JWT}

roles:

"client"

route params:

id: int

body:

{
  "idProject": int,
  "creditCardNumber": string,
  "cvv": string,
  "expiresAt": string,
  "fullName": string,
  "amount": decimal
}

response: Accepted


"/api/projects/{id}"

Delete a project by your id

required headers:

Authorization: Bearer {token JWT}

roles:

"client"

route params:

id: int

response: No content


Skills Controller

"/api/skills"

Get all Skills

response:

[
  {
     "id": int,
     "description": string
  }
]

Users Controller

"/api/users/{id}"

Get a User by your id

required headers:

Authorization: Bearer {token JWT}

route params:

id: int

response:

{
  "fullName": string,
  "email": string
}

"/api/users"

Register a new User

body:

{
  "fullName": string,
  "password": string,
  "email": string,
  "birthDate": DateTime,
  "role": string
}

response:

{
  "fullName": string,
  "password": string,
  "email": string,
  "birthDate": DateTime,
  "role": string
}

"/api/users/login"

Generate a new JWT token

body:

{
  "email": string,
  "password": string
}

response:

{
  "email": string,
  "token": string
}

🌐 Status

Finished project ✅

🧰 Prerequisites

  • .NET 6.0 or +

  • Connection string to SQL Server BD in dev-freela/DevFreela.API/appsettings.json named as ConnectionStrings.DevFreelaCs

  • URL to Payment Microservice in dev-freela/DevFreela.API/appsettings.json named as Services.Payments

  • RabbitMQ

🔧 Installation

$ git clone https://github.com/AllanDutra/dev-freela.git

$ cd dev-freela/DevFreela.API

$ dotnet restore

$ cd ../DevFreela.Infrastructure

$ dotnet ef database update -s ../DevFreela.API/DevFreela.API.csproj

$ cd ../DevFreela.API

$ dotnet run

Server listenning at https://localhost:5000/!

🔨 Tools used

About

Repository developed during the ASP .NET Core Training course maintained by the company Luis Dev. In this project, concepts of development of Web APIs using .NET 6, Clean Architecture, CQRS, Entity Framework Core, Dapper, Repository Pattern, Unit Tests, Authentication and Authorization with JWT, Messaging and Microservices were applied.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages