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