Node.js REST API with Express & SQLite
Guides you through creating a complete Node.js REST API with Express.js and SQLite3, from project scaffolding to running the server.
What This Skill Does
This skill helps you build production-ready Node.js REST APIs by:
Clarifying project requirements and technology stackScaffolding a well-structured Express.js projectSetting up SQLite3 database configurationImplementing complete CRUD operationsInstalling dependencies and resolving compilation issuesCreating run tasks and launching the development serverEnsuring comprehensive documentationInstructions
Follow these steps sequentially, marking each as completed before proceeding:
1. Verify Copilot Instructions
Confirm that `.github/copilot-instructions.md` exists in the workspaceIf missing, create it to provide context-specific guidance2. Clarify Project Requirements
Ask user for project type, programming language, and frameworksFor this skill, confirm: Node.js, Express.js, SQLite3Define the domain (e.g., student management, inventory system)**Skip if requirements are already provided**3. Scaffold the Project
Create the base Node.js project structure: - `/routes` - API endpoint definitions
- `/models` - Database models and schemas
- `/config` - Database configuration
- `/controllers` - Business logic
- Root files: `server.js`, `package.json`, `.gitignore`
Set up Express.js application entry pointConfigure SQLite3 database connectionUse `.` as the working directoryIf no scaffolding tool is available, create structure manually using file creation tools4. Customize the Project
Verify all previous steps are completedImplement CRUD operations (Create, Read, Update, Delete) for the domain entitiesCreate REST endpoints matching standard conventions: - `GET /api/[resource]` - List all
- `GET /api/[resource]/:id` - Get one
- `POST /api/[resource]` - Create
- `PUT /api/[resource]/:id` - Update
- `DELETE /api/[resource]/:id` - Delete
Apply user requirements and reference materials**Skip for basic "Hello World" projects**5. Install Required Extensions
Only install extensions explicitly mentioned in project setup requirements**Skip and mark complete if no extensions are required**6. Compile the Project
Verify all previous steps are completedRun `npm install` to install dependencies from `package.json`Run diagnostics to detect any compilation errorsResolve any missing dependencies or version conflictsCheck `README.md` or other markdown files for compilation instructions7. Create and Run Task
Verify all previous steps are completedCheck if project needs a VS Code task (see https://code.visualstudio.com/docs/debugtest/tasks)If needed, use `create_and_run_task` based on: - Scripts defined in `package.json`
- Instructions in `README.md`
- Project structure conventions
Common tasks: `npm start`, `npm run dev`, `node server.js`**Skip if no task configuration is needed**8. Launch the Project
Verify all previous steps are completedPrompt user: "Would you like to launch the server in debug mode?"Only launch if user confirmsStart the development server (typically on `http://localhost:8000` or `http://localhost:3000`)Verify server is responding to requests9. Ensure Documentation is Complete
Verify `README.md` exists with: - Project description
- Installation instructions
- API endpoint documentation
- Database schema
- Usage examples
Verify `.github/copilot-instructions.md` is completeAdd any missing sections or clarificationsExample Usage
**User:** "Create a REST API for student management with Node.js, Express, and SQLite"
**Agent Actions:**
1. Confirms requirements: student CRUD operations
2. Scaffolds project with routes, models, config directories
3. Implements student endpoints (GET, POST, PUT, DELETE)
4. Installs express, sqlite3, body-parser, cors
5. Runs `npm install` and resolves any issues
6. Creates start task: `node server.js`
7. Launches server on port 8000
8. Verifies README has API documentation
Constraints
Each step must be marked completed before proceeding to the nextAlways verify previous steps are done before starting a new stepUse only explicitly mentioned extensions - don't install unnecessary toolsFor debug/launch operations, always get user confirmation firstFollow RESTful conventions for endpoint naming and HTTP methodsUse error handling middleware in Express for production-readinessNotes
This workflow is optimized for Express.js REST APIs with SQLite3Adapt database setup steps if using different database systemsTask configuration may vary based on project structureAlways check project-specific markdown files for custom instructions