📌 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.
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.
- 👤 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
- 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
- Backend: Node.js / Express.js
- Language: JavaScript (ES Modules)
- Other: UUID for unique ID generation
- Node.js >= 18.x
- npm
- Git
# 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
- Base URL:
http://localhost:3333
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:
email: [email protected]
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.
api-book/
├── src/
│ ├── controllers/
│ ├── data/
│ ├── middlewares/
│ ├── routes/
│ ├── app.js
│ └── server.js
├── .gitignore
├── package.json
└── README.md
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
This project is licensed under the MIT License. See the LICENSE file for details.
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!