A system where users can track their books, mark read/unread status, and add ratings/notes.
- Project Overview
- Technologies Used
- Core Features
- Project Setup
- Overall Project Flow
- Data Flow
- Example Flow: Adding a New Book
ShelfSpace is a full stack web application designed to help users manage their personal book collections, track reading statuses, and maintain ratings for each book. The project follows a RESTful API architecture and includes user authentication for secure data handling.
- Backend: Node.js, Express.js
- Frontend: React.js (basic frontend setup)
- Database: PostgreSQL
- Authentication: JWT (JSON Web Tokens)
- Other Tools: bcrypt for password hashing, CORS for cross-origin requests
- Book Management: Add, edit, delete, and retrieve book records
- User Authentication: Secure login and registration using JWT
- Search and Filtering: Search books by title/author and filter by status
- Tracking: Track reading statuses and add ratings or notes for books
- Navigate to the client directory.
- Install dependencies:
npm install
- Start the development server:
npm run dev
- Navigate to the server directory.
- Install dependencies:
npm install
- Start the server:
npm run start
- User Interaction: User makes a request (e.g., "Add a new book")
- Request contains:
- HTTP method (POST)
- Endpoint (
/api/books) - Headers (Authentication token)
- Body (book data)
- Request contains:
- Express Server:
- Request hits the Express server
- Goes through global middleware (CORS handling, body parsing, request logging)
- Authentication Middleware:
- Validates JWT token and adds user info to the request
- Route Handler:
- Matches URL pattern and directs to the correct controller function
- Handles specific HTTP method (POST)
- Controller Logic:
- Validates input data
- Prepares data for the database
- Makes database query and handles business logic
- Prepares the response
- Database Interaction:
- SQL query execution
- Database operation
- Results returned to the controller
- Response Flow:
- Controller formats the database response
- Express sends the HTTP response
- User receives response data
- Request comes to the Express server
- Passes through middleware
- Hits route handler
- Controller processes request
- Database query executes
- Response sent back to the client
- User: Sends POST request to
/api/bookswith book data - Express: Receives the request
- Auth Middleware: Validates token
- Controller: Receives and validates book data
- Database: Adds the new book
- Response: Success response sent back to the user