{"id":19015951,"url":"https://github.com/shailscript/express-restapi","last_synced_at":"2026-04-18T00:02:45.836Z","repository":{"id":103974873,"uuid":"181252283","full_name":"shailscript/express-restapi","owner":"shailscript","description":"A node app to implement RESTful APIs","archived":false,"fork":false,"pushed_at":"2019-07-13T16:23:06.000Z","size":92,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-21T17:48:13.867Z","etag":null,"topics":["express","nodejs","rest-api","sqlite3"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shailscript.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-04-14T02:45:21.000Z","updated_at":"2019-07-13T16:23:08.000Z","dependencies_parsed_at":"2023-03-13T15:00:29.210Z","dependency_job_id":null,"html_url":"https://github.com/shailscript/express-restapi","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/shailscript/express-restapi","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shailscript%2Fexpress-restapi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shailscript%2Fexpress-restapi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shailscript%2Fexpress-restapi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shailscript%2Fexpress-restapi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shailscript","download_url":"https://codeload.github.com/shailscript/express-restapi/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shailscript%2Fexpress-restapi/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31950891,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-17T17:29:20.459Z","status":"ssl_error","status_checked_at":"2026-04-17T17:28:47.801Z","response_time":62,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["express","nodejs","rest-api","sqlite3"],"created_at":"2024-11-08T19:40:24.497Z","updated_at":"2026-04-18T00:02:45.775Z","avatar_url":"https://github.com/shailscript.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# REST APIs using ExpressJS\n\u003e A backend web application to implement Representational State Transfer(REST) APIs for some resources.\n\n\n## Description\nThe objective for the this project is to create RESTful APIs that allows an application to interact with a SQL database of classes, teachers, and students. There is **NO authentication implemented** for this api. The api uses NodeJS, Express, and SQLite.\n\n\n## Getting started\n\u003e Clone or download the repository and then run the following command to install all dependencies\n```bash\nnpm install\n```\n\n#### Setting up .env file\nNext make sure you create a new .env file and assign PORT for the application to your .env file:\n```\nPORT = 3000\n```\nTo create a .env file, in the project folder run the following command on Linux, Mac or Windows PowerShell\n```bash\ncp .env.example .env\n```\nNOTE: By default, this app uses HTTP PORT 3000, so if you haven't configured the .env file kndly make sure that the port 3000 is available for this app.\n\n#### Compiles and hot-reloads for development \n```bash\nnpm start\n```\n\n\n## Features\nThis app uses the migrations utility of the sqlite library.\nThe express endpoint should have the following routes.\n```\n    GET ‘/api/classes’ -- returns an array of all classes.\n    GET ‘/api/classes/:id’ -- returns details of a class as json, including name of the teacher of the class.\n    POST ‘/api/classes’ -- Creates a class upon receiving json data in form\n    PUT ‘/api/classes/:id’ -- updates an existing class record.\n    DELETE ‘/api/classes/:id’ -- deletes an existing class record.\n    GET ‘/api/students -- returns an array of all students.\n    GET ‘/api/students/:id’ -- returns details of a student as json.\n    GET ‘/api/students/:id/classes’ -- returns json array of all classes a student is enrolled in.\n    POST ‘/api/students -- Creates a student upon receiving json data in form\n    PUT ‘/api/students/:id’ -- updates an existing student record.\n    DELETE ‘/api/students/:id’ -- deletes an existing student record.\n    GET ‘/api/teachers -- returns an array of all teachers.\n    GET ‘/api/teachers/:id’ -- returns details of a teacher as json.\n    GET ‘/api/teachers/:id/classes’ -- returns an array of all classes a teacher is teaching.\n    POST ‘/api/teachers -- Creates a teacher upon receiving json data in form\n    PUT ‘/api/teachers/:id’ -- updates an existing teacher record.\n    DELETE ‘/api/teachers/:id’ -- deletes an existing teacher record.\n    \n    // Implementing pivot-relationships\n    \n    GET '/api/classes/:class_id/students' -- return all students in class.\n    POST '/api/classes/:class_id/students' -- with data {student_id} creates a new enrollment for an existing student in the class\n    DELETE '/api/classes/:class_id/students/:id' -- deletes a single enrollment record for a student given class id and student id\n```\n\n## Examples\nWhere applicable, the body in all requests should be x-www-form-urlencoded, for postman, or -H \"Content-Type: application/json\" for curl.\n\nRequest structure for a Class\n```JSON\n{\n    \"code\": \"TEST\",\n    \"className\": \"Testing\",\n    \"teacherId\": 1,\n    \"startDate\": \"XXX 00\",\n    \"endDate\": \"YYY 00\"\n}\n```\n\nRequest structure for a Student\n```JSON\n{\n    \"firstName\": \"John\",\n    \"lastName\": \"Doe\"\n}\n```\n\nRequest structure for a Teacher\n```JSON\n{\n    \"firstName\": \"John\",\n    \"lastName\": \"Doe\"\n}\n```\n\nRequest structure to enroll a Student in a Class\n```JSON\n{\n    \"student_id\": 1\n}\n```\n\n\n## See Also\n* Architectural constraints for Representational State Trasnfer at [Wikipedia](https://en.wikipedia.org/wiki/Representational_state_transfer#Architectural_constraints).\n* List of Hypertext Transfer Protocol (HTTP) response status codes at [Wikipedia](https://en.wikipedia.org/wiki/List_of_HTTP_status_codes).\n\n\n## Author\nShailendra Shukla, shailendra.shukla@georgebrown.ca\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshailscript%2Fexpress-restapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshailscript%2Fexpress-restapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshailscript%2Fexpress-restapi/lists"}