Skip to content

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.

Notifications You must be signed in to change notification settings

Dbrown127/basic_login_register_api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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"
}

About

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.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages