Skip to content

nadolualex/Web-Client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Faculty Project for Local Networks Class

This client-server application was developed as a project for a Local Networks class. It demonstrates practical implementation of communication protocols, focusing on HTTP, REST API principles, session management using cookies, and authentication with JWT tokens.

Command Handling

The client supports various commands, each triggering specific actions on the server:

Register

The register command creates a JSON object with user credentials and sends a registration request to the server.

Login

The login command logs in a user, sets the received cookie for subsequent requests, and validates the login.

Enter Library

The enter_library command utilizes a JWT received from the server, parsing it manually, and grants access to the library.

Logout

The logout command logs out a user, displaying a confirmation message and clearing allocated memory for the cookie and JWT.

Get Books

The get_books command retrieves all books from the library, displaying them in JSON format.

Add Book

The add_book command adds a book to the library, ensuring the user is logged in and has the necessary access.

Delete Book

The delete_book command deletes a book from the library, verifying user credentials and handling errors appropriately.

Get Book

The get_book command retrieves information about a specific book from the library.

Exit

The exit command gracefully terminates the program, closing the TCP connection and freeing allocated memory.

Note: Server Offline

Please note that the server for this application is currently offline. As a result, you won't be able to run the program or interact with the server. However, you can still review the codebase and understand its implementation details, including communication flow, command handling, and usage of HTTP, cookies, and JWT tokens.

This project offers valuable insights into network programming concepts and serves as a practical exercise in building client-server applications within a local network environment.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published