Skip to content

CodingTumbleweed/Chai

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Chai API

Chai API is a .NET Web API project that provides a robust backend service for user account management and location-based data handling. It follows a clean architecture pattern with separate layers for API, Data Services, and Models. It was originally intended as bootstrap system for building remittance system.

Project Structure

The solution consists of three main projects:

  • Chai.API: The Web API layer handling HTTP requests and responses
  • CHAI.DataService: Data access layer with repositories and database context
  • Chai.Models: Domain models, DTOs, and contracts

Features

  • User Account Management (registration, authentication)
  • JWT-based Authentication
  • Location Management (Countries, States, Cities)
  • Gender and App Configuration Management
  • Password Recovery System
  • Swagger API Documentation
  • Exception Handling and Logging
  • Input Validation
  • AutoMapper for Object Mapping

Technology Stack

  • ASP.NET Web API 2
  • Entity Framework
  • Unity for Dependency Injection
  • JWT for Authentication
  • Swagger/Swashbuckle for API Documentation
  • AutoMapper
  • Newtonsoft.Json

Getting Started

Prerequisites

  • Visual Studio 2017 or later
  • .NET Framework 4.5 or later
  • SQL Server (version compatible with Entity Framework)

Setup

  1. Clone the repository
  2. Open the solution in Visual Studio
  3. Restore NuGet packages
  4. Update the connection string in Web.config
  5. Build the solution
  6. Run the application

API Documentation

Once the application is running, you can access the Swagger documentation at:

http://localhost:[port]/swagger

Project Architecture

API Layer (Chai.API)

  • Controllers for handling HTTP requests
  • JWT configuration and validation
  • Exception handling and logging
  • Model validation filters
  • Custom response handlers

Data Service Layer (CHAI.DataService)

  • Generic repository pattern implementation
  • Database context and configurations
  • Data access logic
  • CRUD operations

Models Layer (Chai.Models)

  • POCO classes for domain entities
  • Data Transfer Objects (DTOs)
  • Interface contracts
  • Data annotations for validation

API Endpoints

The API provides the following main endpoints:

  • /api/Account - User account management
  • /api/AppConfig - Application configuration
  • /api/City - City management
  • /api/Country - Country management
  • /api/State - State management
  • /api/Gender - Gender types
  • /api/Password - Password recovery

Security

  • JWT-based authentication
  • Password complexity requirements
  • Input validation and sanitization
  • Exception handling and logging
  • Token validation middleware

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Commit your changes
  4. Push to the branch
  5. Create a Pull Request

License

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

About

Remittance Made Easy!

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors