Skip to content

Latest commit

 

History

History
62 lines (52 loc) · 1.62 KB

File metadata and controls

62 lines (52 loc) · 1.62 KB

Basic User Authentication API

This project is a user authentication API built using C# with .NET 7, Dapper as the persistence client, and SQLite as the database. It provides endpoints to register users and authenticate them, using Swagger for endpoint testing.

Project Fignma Mindmap: image

Features

  • Language: C#
  • Framework:.NET v7/SDK 7
  • Database: SQLite v3
  • Persistence Client: Dapper
  • Payloads: Payloads: LoginRequestModel and RegisterRequestModel

Getting Started

Prerequisites

  • .NET 7 SDK
  • SQLite

Installation

  1. Clone the repository. git clone https://github.com/your-username/user-authentication-api.git
  2. Navigate to the project directory:
  3. Build and run the project dotnet build & dotnet run

Usage

  1. Access Swagger UI by navigating to http://localhost:/swagger in your web browser.
  2. Register a user by providing the following information:
  • First name
  • Last name
  • Email
  • Username
  • Password
  1. Use the registered username and password to log in.
  2. The API will verify the credentials against the database and return a "Login Successful!" message in the console.

Endpoints

POST/register

Register a new user.

Request Body(RegisterRequestModel):

{
  "firstName": "John",
  "lastName": "Doe",
  "email": "john@example.com",
  "username": "johndoe",
  "password": "secretpassword"
}

POST/login

Authenticate an existing user.

Request Body(LoginRequestModel):

{
  "username": "johndoe",
  "password": "secretpassword"
}