Skip to content

Repository files navigation

Auth & Expense Management System

Project Logo

🚀 Overview

This project is a robust microservices-based system that handles JWT token authentication, authorization, and expense management. It leverages Kafka for inter-service communication and Redis for caching while integrating OpenAI LangChain for processing bank transaction messages.


🖥️ Frontend Overview

The frontend of this project is built using ReactJS to provide a seamless user experience for authentication, expense management, and transaction insights. It features an interactive and responsive UI powered by Context API for state management.

🔹 Key Features

  • Authentication & Authorization – Secure login with JWT tokens.
  • Expense Management – Users can add, edit, and delete expenses.
  • Data Visualization – Expense trends displayed via charts.
  • State Management – Utilizes Context API for efficient global state handling.
  • Responsive UI – Optimized design for different devices.

Architecture Diagram

🛠️ Services

1. 🔐 AuthService

  • Handles JWT authentication and user authorization.
  • Generates Access & Refresh Tokens.
  • Utilizes Redis for token caching.

2. 👤 UserService

  • Processes user-related requests (e.g., getUserDetails).
  • Integrated with Kafka for communication.
  • Uses Redis for caching user data.

3. 🔄 IntegrationService

  • Integrates OpenAI LangChain.
  • Converts bank transaction details to JSON format.
  • Uses refresh tokens to communicate with ExpenseService via Kafka.

4. 💰 ExpenseService

  • Manages operations like getExpense, addExpense, etc.
  • Secures API endpoints using Kong API Gateway.
  • Handles real-time data via Kafka.

DataBases

Database

OpenAi Integration Postman

Postman


🛠️ Technologies Used

Category Technologies
Frontend ReactJS, JavaScript, HTML, CSS, Context API
Backend Java, Spring Boot, Groovy, RESTful API, Hibernate
Database MySQL
Caching & Messaging Redis, Kafka
Other Tools Docker, OpenAI LangChain, Kong API Gateway

📌 Architecture Overview

Architecture Diagram

The architecture follows a microservices pattern where:

  • 🔑 AuthService manages authentication & authorization.
  • 🧑 UserService handles user data and integrates with Kafka.
  • 🤖 IntegrationService processes transactions with OpenAI LangChain.
  • 💰 ExpenseService handles all expense-related operations.

Docker Images

Docker Images

Docker Containers at Running State

Container Orchestration


⚙️ Setup Instructions

1. Clone the repository:
$ git clone <repo-url>
$ cd <project-directory>

2. Setup environment variables:
- Configure database connections.
- Set JWT secret keys.
- Define Kafka topics.
- Configure Redis settings.

3. Run services:
$ docker-compose up -d

4. Start Frontend:
$ cd frontend
$ npm install
$ npm start

🔗 API Endpoints

Service Method Endpoint Description
AuthService POST /auth/v1/login Authenticate user and issue access token
AuthService POST /auth/v1/refreshToken Generate a new access token using a refresh token
AuthService POST /auth/v1/signup Register a new user
UserService GET /user/v1/details Fetch user details
ExpenseService GET /expense/v1/getExpense Retrieve a list of expenses
ExpenseService POST /expense/v1/addExpense Add a new expense
ExpenseService DELETE /expense/v1/removeExpense Remove an expense
IntegrationService POST /v1/ds/message Process and convert bank transaction messages
Health Check GET /health Check service health status

🚀 Future Enhancements

  • Implement rate limiting and security hardening.
  • Introduce a notification service for real-time updates.
  • Optimize caching strategies for better performance.

🤝 Contributing

  • Fork the repository.
  • Create a new branch.
  • Commit and push changes.
  • Submit a pull request.

📜 License

This project is licensed under the MIT License.

📧 Contact

For queries, please reach out to eedarasaiharshith6699@gmail.com

About

No description, website, or topics provided.

Resources

Stars

3 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages