Thanks to visit codestin.com
Credit goes to Github.com

Skip to content

Simple API for managing users and books. Allows user registration, registration of books linked to users and book searches. Ideal as a basis for book listing, search and control applications.

License

Notifications You must be signed in to change notification settings

Fransuelton/api-book

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

40 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš€ BookManager API

GitHub last commit GitHub repo size GitHub issues GitHub pull requests GitHub License Project Status Project Type

πŸ“Œ A simple REST API for managing users and books. Allows user registration, book registration linked to users, and book listing by user. Designed as a foundation for future features like book search, login, or wishlist functionality.


πŸ“š Table of Contents


πŸ“ About

This project is a backend API developed as a practical exercise with Node.js and Express. Its current focus is basic user and book management, serving as the foundation for future catalog, search, or book management applications.


✨ Features

  • πŸ‘€ User registration and listing
  • πŸ“š Book registration linked to users
  • πŸ” Book listing by user
  • 🧱 Modular structure with Controllers, Middlewares, and Routers
  • πŸš€ Code ready for future authentication and feature expansion

πŸ’Ό Business Rules

  • It is not possible to register a user with an existing email
  • It is not possible to register the same book
  • It is not possible to delete a non-existent account
  • It is not possible to delete a non-existent book

🧰 Tech Stack

My Skills

  • Backend: Node.js / Express.js
  • Language: JavaScript (ES Modules)
  • Other: UUID for unique ID generation

πŸš€ Getting Started

πŸ“‹ Prerequisites

  • Node.js >= 18.x
  • npm
  • Git

πŸ”§ Installation

# Clone the repository
git clone [email protected]:Fransuelton/api-book.git

# Navigate to the project folder
cd api-book

# Install dependencies
npm install

# Start the server
npm run dev

πŸ”Œ API Documentation

  • Base URL: http://localhost:3333

Example Endpoints:

POST /users

Registers a new user.
Request Body:

{
  "name": "John Doe",
  "email": "[email protected]"
}

GET /users

Returns a list of all registered users.


POST /books

Registers a book for an authenticated user (simulated with email header).
Headers:

Request Body:

{
  "name": "Book Title",
  "author": "Author Name",
  "company": "Publisher",
  "description": "Book description",
  "user_id": "user-uuid"
}

GET /books/:user_id

Returns all books linked to a specific user.


πŸ“ Folder Structure

api-book/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ controllers/
β”‚   β”œβ”€β”€ data/
β”‚   β”œβ”€β”€ middlewares/
β”‚   β”œβ”€β”€ routes/
β”‚   β”œβ”€β”€ app.js
β”‚   └── server.js
β”œβ”€β”€ .gitignore
β”œβ”€β”€ package.json
└── README.md

🎯 What I Learned

During the development of this project, I practiced key backend development concepts:

  • API organization using Controllers, Middlewares, and Routers
  • Best practices with Express.js
  • Separation of data simulating future database integration
  • First steps for building fullstack projects with Node.js

πŸ“„ License

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


πŸ“¬ Contact

Fransuelton Francisco
πŸ“« [email protected]
🌐 fransuelton.dev
πŸ™ github.com/Fransuelton
πŸ’Ό linkedin.com/in/fransuelton


⭐️ If you found this project useful or are learning from it, please consider leaving a star!

About

Simple API for managing users and books. Allows user registration, registration of books linked to users and book searches. Ideal as a basis for book listing, search and control applications.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published