{"id":30700226,"url":"https://github.com/pankaj085/lotusascend","last_synced_at":"2026-04-16T18:03:07.454Z","repository":{"id":312141912,"uuid":"1046261317","full_name":"pankaj085/LotusAscend","owner":"pankaj085","description":"LotusAscend is a Loyalty Rewards Management System where Uers register, verify with OTP, earn points, and redeem coupons. Secure JWT authentication ensures only authorized members can access and manage their rewards.","archived":false,"fork":false,"pushed_at":"2025-09-09T19:53:46.000Z","size":658,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-09T23:23:30.097Z","etag":null,"topics":["dotnet","jwt","jwt-authentication","postgresql","swagger-ui"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pankaj085.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-08-28T12:31:13.000Z","updated_at":"2025-09-09T19:53:49.000Z","dependencies_parsed_at":"2025-08-29T01:25:23.847Z","dependency_job_id":"ce9cd826-531c-448b-b7ca-ed3f914e85fd","html_url":"https://github.com/pankaj085/LotusAscend","commit_stats":null,"previous_names":["pankaj085/lotusascend"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/pankaj085/LotusAscend","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pankaj085%2FLotusAscend","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pankaj085%2FLotusAscend/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pankaj085%2FLotusAscend/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pankaj085%2FLotusAscend/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pankaj085","download_url":"https://codeload.github.com/pankaj085/LotusAscend/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pankaj085%2FLotusAscend/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279018120,"owners_count":26086280,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-14T02:00:06.444Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dotnet","jwt","jwt-authentication","postgresql","swagger-ui"],"created_at":"2025-09-02T11:44:17.204Z","updated_at":"2025-10-14T06:11:24.046Z","avatar_url":"https://github.com/pankaj085.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e \n\u003cp\u003e\n  \u003ca href=\"https://github.com/pankaj085/LotusAscend\"\u003e\n    \u003cimg src=\"DocsAssets/LotusAscend_Logo.svg\" alt=\"LotusAscend\" width=\"350\"/\u003e\n  \u003c/a\u003e\n\u003c/p\u003e \n\n  ![.NET](https://img.shields.io/badge/.NET-8-512BD4?style=for-the-badge\u0026logo=dotnet)\n  ![PostgreSQL](https://img.shields.io/badge/PostgreSQL-12-4169E1?style=for-the-badge\u0026logo=postgresql)\n  ![License](https://img.shields.io/badge/License-MIT-green.svg?style=for-the-badge)\n  ![Status](https://img.shields.io/badge/status-active-brightgreen.svg?style=for-the-badge)  \n\u003c/div\u003e\n\n# **LotusAscend** - A Modern Loyalty \u0026 Rewards API\nLotusAscend is a complete backend and frontend solution for a modern customer loyalty program.  \nThe name **\"Ascend\"** captures the journey of a customer as they earn points and move up by getting redeem points, highlighting growth and progress within the program.\n\nThis project includes a **secure RESTful API** built with **.NET 8** and a **clean, responsive vanilla JavaScript frontend**.  \nIt’s designed to handle **member registration, login, points management, and coupon redemption** with unique, generated codes.\n\n---\n\n## ✨ Features\n- **Secure Authentication**: JWT-based authentication with mobile number + OTP verification (Dynamic Random 4 digit OTP).\n- **Points Management**: Earn points based on purchase amounts, check balances.  \n- **Coupon Redemption**: Redeem points for discount coupons with unique codes. \n- **Transaction History**: Displays all point-related transactions, includes both Points Redemption and Points Addition records. \n- **Clean Architecture**: Modular, layered backend promoting separation of concerns.  \n- **Responsive Frontend**: Lightweight SPA-style frontend with HTML, CSS, and Vanilla JS.  \n- **API Documentation**: Integrated Swagger UI for interactive testing.\n\n### Database Schema \u0026 API Flow Chart\n\n**Database Schema:** For a detailed breakdown of the database tables, columns, relationships, and sample data, see the **[DATABASE Documentation](DATABASE_SCHEMA.md)**.\n\n**API Flow Diagram:** For a detailed breakdown \u0026 Flow of the API Work Flow, see the **[API FLOW DIAGRAM](/DocsAssets/la_flow_chart.png)**.\n\n---\n## 🧪 API Testing with Postman\n\nTo make testing the LotusAscend API as easy as possible, **My complete Postman collection and API Endpoint Documentation are available, Click the button below** to access API Docs and to fork the collection to your own Postman workspace.\n\n[![Run in Postman](https://run.pstmn.io/button.svg)](https://www.postman.com/mrlotus/workspace/lotusascend/collection/43877835-77b66af7-f6da-4b1e-a040-f300518061ab?action=share\u0026creator=43877835)\n\n\u003eAfter forking, remember to set the `baseUrl` variable in the collection's settings to your local environment (e.g., `http://localhost:5245`).\n---\n\n## 🛠️ Technologies \u0026 Packages\n\nBuilt on **.NET 8** using key NuGet packages:  \n\n- `Microsoft.EntityFrameworkCore`: EF Core ORM for database communication  \n- `Microsoft.EntityFrameworkCore.Design`: Design-time tools for migrations  \n- `Microsoft.EntityFrameworkCore.Tools`: CLI tools for schema management  \n- `Npgsql.EntityFrameworkCore.PostgreSQL`: PostgreSQL EF Core provider  \n- `Microsoft.AspNetCore.Authentication.JwtBearer`: JWT auth middleware  \n- `System.IdentityModel.Tokens.Jwt`: Token creation \u0026 signing  \n- `Microsoft.AspNetCore.OpenApi`: Swagger/OpenAPI docs  \n- `AutoMapper.Extensions.Microsoft.DependencyInjection`: DTO ↔ entity mapping  \n\n\u003e Note: `FluentValidation.AspNetCore` was considered but not used. Instead, built-in **Data Annotations** (`[Required]`, `[StringLength]`) are used.\n\n---\n\n## 📂 Project Structure\nThe project follows a clean and logical structure to promote separation of concerns.\n\n```bash\nLotusAscend/\n│\n├── AppDataContext/           # EF Core DbContext for database interaction\n├── Contracts/                # DTOs for API request/response models\n├── Controllers/              # API endpoints that handle HTTP requests\n├── Interfaces/               # Service abstractions (contracts for business logic)\n├── MappingProfiles/          # An Automapper, that converts API Request/Response into DB Models and vice versa.\n├── Middleware/               # Custom middleware (e.g., global exception handling)\n├── Models/                   # EF Core entity models representing database tables\n├── Services/                 # Concrete implementation of business logic\n│\n├── Frontend/                 # Simple Static - HTML + CSS \u0026 Vanilla JS Frontend\n│   │  ├── assets/\n│   │  │   ├── css/\n│   │  │   ├── images/\n│   │  │   └── js/\n│   ├── dashboard.html\n│   └── index.html\n│\n├── appsettings.json          # Configuration for database, JWT, etc.\n└── Program.cs                # Application startup, DI container, and pipeline setup\n```\n## ⚙️ Getting Started\n\nFollow these instructions to get a local copy of LotusLedger up and running on your machine.\n\n### Prerequisites\n\n-   [.NET 8 SDK](https://dotnet.microsoft.com/download/dotnet/8.0)\n-   [Git](https://git-scm.com/)\n-   A running instance of [PostgreSQL](https://www.postgresql.org/download/)\n\n### 1. Clone the Repository\n\n```bash\ngit clone https://github.com/pankaj085/LotusAscend.git\ncd LotusAscend\n````\n\n### 2\\. Install NuGet Packages\n\nThis project relies on several NuGet packages. Run the following commands to install them:\n\n```bash\ndotnet add package Microsoft.EntityFrameworkCore --version 8.0.8\ndotnet add package Microsoft.EntityFrameworkCore.Design --version 8.0.8\ndotnet add package Microsoft.EntityFrameworkCore.Tools --version 8.0.8\ndotnet add package Npgsql.EntityFrameworkCore.PostgreSQL --version 8.0.8\ndotnet add package Microsoft.AspNetCore.OpenApi --version 8.0.8         \ndotnet add package Microsoft.AspNetCore.Authentication.JwtBearer --version 8.0.8\ndotnet add package AutoMapper.Extensions.Microsoft.DependencyInjection --version 12.0.1\ndotnet add package System.IdentityModel.Tokens.Jwt --version 7.1.2\n\n```\n\n### 3\\. Configure the Database \u0026 JWT\n\nOpen `appsettings.Development.json` and update the `DefaultConnection` string with your PostgreSQL credentials.\n\n```json\n{\n  \"ConnectionStrings\": {\n    \"DefaultConnection\": \"Host=localhost;Database=DATABASE_NAME;Username=USERNAME;Password=PASSWORD\"\n  },\n    \"Jwt\": {\n    \"Key\": \"ThisIsMySuperSecretKeyForLoyaltyAPIProjectAndItIsVeryLongAndSecure12345!\",\n    \"Issuer\": \"_ISSUER_\",\n    \"Audience\": \"Loyalty_Members\"\n  }\n}\n```\n\n### 4\\. Apply Database Migrations\n\nUse the `dotnet-ef` tool to create and apply the database schema.\n\n```bash\n# Create the initial migration files based on your DbContext and Models\ndotnet ef migrations add InitialCreate\n\n# Apply the migration to your database\ndotnet ef database update\n```\n\n### 5\\. Run the Application\n\nYou're all set\\! Build and run the project.\n\n```bash\ndotnet build \u0026\u0026 dotnet run\n```\n\nThe API will be available at `http://localhost:5245/` (or a similar port).\n\n  - **API Base URL:** `http://localhost:5245/`\n  - **Swagger UI:** `http://localhost:5245/swagger/index.html`\n\n### 6\\. Frontend Setup\n\nFrontend is a static site (HTML + CSS \u0026 Vanilla JS) consuming backend APIs.\n\n- **Install dotnet-serve (one-time)**\n\n```bash\ndotnet tool install --global dotnet-serve\n```\n\n- **Serve the Frontend**\n\n```bash\ncd Frontend\ndotnet serve -p 5500\n```\n\n- **Frontend runs at:** `http://localhost:5500`\n\n## 🙌 Contributing\n\nContributions are welcome\\! If you have suggestions for improvements, please open an issue or submit a pull request.\n\n-----\n\n## License\n\nThis project is licensed under the [MIT License](LICENSE) - see the [LICENSE](LICENSE) file for details.\n\n## Author\n\nPankaj Kushwaha - [GitHub](https://github.com/pankaj085 \"Follow me on GitHub\") | [LinkedIn](https://www.linkedin.com/in/py--dev/ \"Follow me on LinkedIn\")\n\n-----","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpankaj085%2Flotusascend","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpankaj085%2Flotusascend","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpankaj085%2Flotusascend/lists"}