Skip to content

sean-njela/Java_grpc

Repository files navigation

User Management System 🌟

Welcome to the User Management System 🎉, where you can manage users in a simple, efficient, and distributed way using RMI (Remote Method Invocation) technology! 🚀

This project allows you to add, delete, retrieve, update, and list users, as well as remotely shut down the server. It’s all designed to give you a seamless experience with object-oriented programming and client-server architecture. 🤖

💡 Project Overview

This project involves the creation of a distributed user database where users are represented by objects that store essential details such as:

  • First Name
  • Last Name
  • Birthdate
  • Salary
  • Gender (enum)
  • Division
  • Position

The server manages these user objects and supports remote operations through RMI, while the client can interact with the server to perform CRUD operations. 🖥️📡

🎯 Key Objectives

  • Scalability: The system is designed for easy expansion. You can add more features like user authentication, role management, or advanced querying.
  • Reliability: With the retry mechanism in place for client-server communication, the system handles temporary server downtimes and ensures smooth operation.
  • User-Friendly Interface: The command-line interface (CLI) is intuitive, with clear instructions and prompts for each action.

🚀 Features

  • Add User 🆕: Add a new user with all their details.
  • Delete User 🗑️: Remove a user from the system.
  • Retrieve User 🔍: Fetch details of a specific user.
  • List Users 📋: Display all users currently stored in the system.
  • Update User ✏️: Modify the details of an existing user.
  • Remote Shutdown 🔴: Shutdown the server remotely (like turning off the lights! 🌙).
  • Connection Retry Mechanism 🔄: If the server is down, the client will try reconnecting multiple times before giving up. 🛠️

🛠️ Technical Details

  • Programming Language: Java 🖥️
  • Technologies Used:
    • RMI (Remote Method Invocation) for client-server communication.
    • Serializable for object transmission over the network.
    • Server Shutdown via system exit commands.
  • Dependencies: Java Development Kit (JDK 8 or later)
  • Version Control: Git (you can contribute and track changes via GitHub)
  • Data Storage: Users are stored in memory and are lost when the server is restarted. (You can modify this to include a persistent database like MySQL, MongoDB, or a file-based solution)

📦 How to Run

1. Start the Server 🚀

  • Compile and run the MyRMI.java class to start the RMI registry and bind the Hello object to a name.

    javac MyRMI.java
    java MyRMI

    The server will be up and running, ready to accept requests. The system will listen on port 5001 for incoming connections.

2. Run the Client 🖥️

  • Compile and run the HelloClient.java class to interact with the server.

    javac HelloClient.java
    java HelloClient

    Once the client is running, you will be prompted to enter different actions, such as adding a new user, retrieving user details, or shutting down the server.

    Client Options:

    • Add a user
    • Delete a user
    • Modify user details
    • List all users
    • Retrieve user details
    • Shutdown the server

    Example:

    • When adding a user, you will be prompted to input information such as First Name, Last Name, Salary, and other details.

    After interacting with the system, you can shut it down remotely with the Shutdown Server option. ✨

3. Remote Shutdown ⚡

The server allows remote shutdown by the client. Once you are done using the system, the client can issue a shutdown command which will safely terminate the server and stop the RMI service.


🤝 Contributing

We love contributions! 🎉 If you have ideas for improvements or find bugs, feel free to fork this project and submit a pull request. Here’s how you can contribute:

  1. Fork the repo: Click on the "Fork" button at the top right of this page to create a copy of this project in your GitHub account.

  2. Clone the repo: Clone your fork to your local machine to make changes.

    git clone https://github.com/your-username/user-management-system.git
  3. Create a new branch: It's best to create a new branch for the feature or bug fix you're working on.

    git checkout -b feature-name
  4. Commit your changes: After making changes, commit them with a clear message.

    git commit -am 'Add feature or fix bug'
  5. Push to your branch:

    git push origin feature-name
  6. Create a Pull Request: On GitHub, create a pull request to merge your changes into the main repository.


📜 License

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


✨ Acknowledgments

  • RMI Documentation: For understanding how Java Remote Method Invocation works and integrating it into this project.
  • Open Source Community: For making collaborative coding fun and efficient.
  • Java Developers: For creating the powerful Java ecosystem that makes all of this possible.

🎯 What's Next?

The current implementation is just the beginning. Some future enhancements could include:

  • Persisting User Data: Integrate a database system for permanent data storage.
  • User Authentication: Add login functionality for users.
  • Advanced User Search: Implement filtering and searching for users based on specific criteria (e.g., salary range, position, division).
  • Multi-Server Support: Scale the server to handle multiple client connections across different nodes.

🤩 Let's make this project awesome together!

Join the fun and contribute to the growth of this project. Together, we can take this system to the next level! 🚀🎉


About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published