Skip to content

Commit 266ed63

Browse files
authored
Update README.md
1 parent 0c79f27 commit 266ed63

1 file changed

Lines changed: 74 additions & 1 deletion

File tree

README.md

Lines changed: 74 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,74 @@
1-
# LibrisAPI
1+
# LibrisAPI
2+
3+
LibrisAPI is a RESTful API for managing your personal book collection.
4+
5+
## Purpose
6+
7+
This API allows you to:
8+
9+
* Create, retrieve, update, and delete books.
10+
* Authenticate users with JWT (JSON Web Tokens).
11+
12+
## Documentation
13+
14+
For detailed information on how to use the API, please refer to the [LibrisAPI Documentation](https://docs.librisapi.necoti.dev).
15+
16+
## Getting Started
17+
18+
1. Clone the repository:
19+
20+
```bash
21+
git clone https://github.com/Nec0ti/LibrisAPI/
22+
cd LibrisAPI
23+
```
24+
25+
2. Install dependencies:
26+
27+
```bash
28+
npm install
29+
```
30+
31+
3. Set up environment variables:
32+
33+
Create a `.env` file with the following variables:
34+
35+
```
36+
MONGODB_URI=mongodb+srv://<username>:<password>@<cluster>.mongodb.net/<database>?retryWrites=true&w=majority
37+
JWT_SECRET=your_jwt_secret_key
38+
```
39+
40+
4. Start the server:
41+
42+
```bash
43+
npm run dev
44+
```
45+
46+
## Endpoints
47+
48+
Here are a few basic examples:
49+
50+
* **Register:** `POST /api/auth/register`
51+
```json
52+
{
53+
"username": "testuser",
54+
"password": "testpassword"
55+
}
56+
```
57+
58+
* **Login:** `POST /api/auth/login`
59+
```json
60+
{
61+
"username": "testuser",
62+
"password": "testpassword"
63+
}
64+
```
65+
66+
* **Get All Books:** `GET /api/books` (requires JWT token in `x-auth-token` header)
67+
68+
## Contributing
69+
70+
We welcome contributions! Please feel free to open issues or submit pull requests.
71+
72+
## License
73+
74+
This project is licensed under the MIT License.

0 commit comments

Comments
 (0)