A beginner-friendly REST API for practicing frontend development with a "real" backend. Built with Express and SQLite. No auth to keep things simple for this easy level API.
- Full CRUD on
/notes - Persistent local SQLite storage
- initial data already seeded
- reset endpoint to restore initial data
- CORS-enabled and JSON-ready
- Clone the repo
git clone https://github.com/Plug-org/plug-notes-api.git
cd plug-notes-api- Install dependencies
npm install- Run the API
npm run dev- Seed the database
npm run seedThe server will start at http://localhost:5000.
GET /notesresponse
[
{
"id": 1,
"title": "Welcome Note",
"content": "This is a sample note to get started. Feel free to add, edit, or delete.",
"created_at": "2025-05-21 03:38:26"
},
{
"id": 2,
"title": "Next Steps",
"content": "Try connecting this API to a frontend like React or Vue!",
"created_at": "2025-05-21 03:38:26"
}
]GET /notes/:idresponse
{
"id": 2,
"title": "Next Steps",
"content": "Try connecting this API to a frontend like React or Vue!",
"created_at": "2025-05-21 03:38:26"
}POST /notes
Content-Type: application/json
{
"title": "My Note",
"content": "Something useful."
}successful response
{
"id": 5,
"title": "My Note",
"content": "Something useful.",
"created_at": "2025-05-21 18:54:04"
}PUT /notes/:id
Content-Type: application/json
{
"title": "Updated Title",
"content": "Updated content."
}successful response
{
"id": 1,
"title": "Updated Title",
"content": "Updated content.",
"created_at": "2025-05-21 03:38:26"
}DELETE /notes/:idsuccesful response
{
"success": true
}POST /resetsuccessful response
{
"success": true
}Make a GET request to /notes again to see all notes and you should see the initial data
You'll notice the newly re-seeded data will have ids that are new (not 1 and 2) and they'll have up to date timestamps
If you ever want to start from scratch this will erase the data in the database and then loads sample notes from
seed_data.json.
plug-notes-api/
├── app.js # Main server
├── notes.db # Local SQLite DB (auto-created)
├── notes.db-shm # Local SQLite DB (auto-created)
├── notes.db-wal # Local SQLite DB (auto-created)
├── package.json # Project metadata
└── README.md # This file
├──seed/
├── seed_data.json # initial data
├── seed.js # script to seed initial data
- Frontend devs learning how to interact with APIs
- Bootcamp students and self-taught devs
This is a very basic CRUD app to get started with.
- Check out Postman to learn how to test api calls in isolation before writing any code in your client.
- Keep the server's CLI open so you can see any logging information.
- Make use of dev tools like Google Chrome network activity inspector tab.
MIT