A simple yet powerful RESTful API built with Node.js and SQLite that lets users manage a list of songs. It supports adding, retrieving, and storing songs locally, with an optional frontend for browser-based interaction.
MusicTrackerAPI/ ├── controllers/ # Contains logic to handle API requests │ └── songController.js ├── routes/ # Defines API endpoints and routing │ └── songRoutes.js ├── music.db # SQLite database file ├── db.js # Database connection and setup ├── server.js # Main server file to run the API ├── MusicAPI.html # Optional HTML frontend for testing API └── README.md # Project documentation - 🎧 Add and retrieve songs using REST APIs
- 🗃️ Local database using SQLite
- 📊 Easy integration with DB Browser for SQLite
- 🌐 Optional HTML frontend to view/add songs via a form
- 🔒 Fully local — no external APIs or cloud services
git clone https://github.com/Ananya-te/MusicTrackerAPI.git cd MusicTrackerAPI###2. Install Dependencies
Ensure you have Node.js installed, then run:
npm install###3. Start the Server
node server.js The server will start at: http://localhost:5000📥 Add a Song
POST /api/songsRequest Body:
Json { "title": "Shape of You", "artist": "Ed Sheeran", "genre": "Pop" }📤 Get All Songs
GET /api/songsjson [ { "id": 1, "title": "Shape of You", "artist": "Ed Sheeran", "genre": "Pop" } ]SQL CREATE TABLE IF NOT EXISTS songs ( id INTEGER PRIMARY KEY AUTOINCREMENT, title TEXT, artist TEXT, genre TEXT );Managed with: db.js
Uses local file: music.db
Tables are created automatically on server start
Open MusicAPI.html in your browser to:
-
View all songs in a list
-
Add songs via a simple form
Make sure your server is running before using the frontend.
Node.js
Express.js
SQLite3
HTML, CSS, JavaScript for UI
We welcome contributions! 💛
-
Fork this repo
-
Create a new branch: feature/your-feature-name
-
Make your changes and commit
-
Open a Pull Request with a meaningful description
This project is open-source and free to use, modify, or improve. Let's build something awesome! 🚀