A simple distributed key-value cache server implemented in Node.js with user authentication. This project includes a TCP server that allows clients to connect, authenticate, and execute cache commands (SET
, GET
, HAS
, Update
, DELETE
).
- User authentication (Login/Signup)
- In-memory key-value store per user
- Commands:
SET
,GET
,HAS
,Update
,DELETE
- Node.js installed
-
Clone the repository or create a new project directory:
git clone https://github.com/dushyant264/Custom_Cache
-
Initialize Dependencies :
npm i
- Start the Server:
node server.js
- You should see
Server started at 127.0.0.1:8080
To interact with the server, you can use a TCP client. You can use telnet for simplicity, or any other TCP client you prefer.
- Open a Terminal and Connect Using
telnet
:
telnet 127.0.0.1 8080
- SignUp
SIGNUP
Enter username: testuser
Enter password: testpass
User created successfully
- Login
LOGIN
Enter username: testuser
Enter password: testpass
Authenticated successfully
- Set
Set Key
Value
- Update
Update Key1
newVal
- Delete
DELETE key1
OK