Giter VIP home page Giter VIP logo

webapiusers's Introduction

Users Web API

Sections

Description

Features

Tools required

Testing the application

Libraries and technologies

Description

🇬🇧 This repository contains a study project of a Web API using .NET 7 with the goal of implementing CRUD (Create, Read, Update, Delete) functionalities for users, including JWT Bearer authentication and secure password storage.

🇧🇷 Este repositório contém um projeto de estudo da criação de uma API web em .NET 7 com o objetivo de implementar um CRUD completo (Create, Read, Update, Delete) de usuários, incluindo autenticação com JWT Bearer Authentication e armazenamento seguro de senhas.

Features

Method Route JSON Body Action
POST /Login Email + Password Generates the access token
POST /User Name + Email + Password Creates the user
GET /User?offset=5&limit=5 Returns the list of users
GET /User/Id/{id} Returns the user of the id
GET /User/Email/{email} Returns the user of the email
PUT /User/UpdateName Id + Name Updates the user's name
PUT /User/UpdateEmail Id + Email Updates the user's email
PUT /User/UpdatePassword Id + Password Updates the user's password
DELETE /User/Delete/{id} Deletes the user

Request body example

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

Response body example

{
  "data": {
    "id": 0,
    "name": "string",
    "email": "string"
  },
  "message": "string",
  "statusCode": 100,
  "error": "string"
}

Tools required

To run the application, you must have these tools installed:

Testing the application

Download or clone the project from: https://github.com/MatheusMGrassano/WebApiUsers.git

Connection String

Change the database connection credentials in the appsettings.json file.

Set the "Data Source" of the connection string using your SQL Server's name and in the "DataBase" choose a name for the database that will be created.

ConnectionString example:

  "ConnectionStrings": {
    "Default": "Data Source=YourServer;Database=YourDatabase;Trusted_connection=true;Encrypt=false;TrustServerCertificate=true"
  }

Generating the migration for the database creation

At your terminal, access the project's root folder and type the following commands:

dotnet tool install --global dotnet-ef
dotnet ef migrations add DataBaseCreation
dotnet ef database update

Running the application

At your terminal, access the project's root folder and type the following command:

dotnet watch run

Then, a new browser tab will open with the Swagger UI, showing all the features of the API.

Libraries and technologies

webapiusers's People

Contributors

matheusmgrassano avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.