{"id":21826881,"url":"https://github.com/destinecarma/contact-list-backend","last_synced_at":"2026-04-09T15:53:27.867Z","repository":{"id":264047427,"uuid":"892195900","full_name":"DestinEcarma/contact-list-backend","owner":"DestinEcarma","description":"A simple REST API built with Express.js and MySQL for managing a contact list.","archived":false,"fork":false,"pushed_at":"2024-11-21T17:19:34.000Z","size":25,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-26T08:26:30.090Z","etag":null,"topics":["expressjs","mysql","rest-api","webdevelopment"],"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/DestinEcarma.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":"2024-11-21T17:09:51.000Z","updated_at":"2024-11-21T17:19:55.000Z","dependencies_parsed_at":"2024-11-21T18:24:28.474Z","dependency_job_id":"cc274524-4392-4ea3-8b41-d030d4e72dc9","html_url":"https://github.com/DestinEcarma/contact-list-backend","commit_stats":null,"previous_names":["destinecarma/contact-list-backend"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DestinEcarma%2Fcontact-list-backend","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DestinEcarma%2Fcontact-list-backend/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DestinEcarma%2Fcontact-list-backend/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DestinEcarma%2Fcontact-list-backend/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DestinEcarma","download_url":"https://codeload.github.com/DestinEcarma/contact-list-backend/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244795519,"owners_count":20511521,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["expressjs","mysql","rest-api","webdevelopment"],"created_at":"2024-11-27T18:11:15.522Z","updated_at":"2025-12-30T20:06:42.067Z","avatar_url":"https://github.com/DestinEcarma.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Contact List Backend\n\nA simple REST API application for managing a contact list, developed as part of a Web Development assignment. The application uses the `Express.js` framework for the backend and `MySQL` as the database.\n\n## Endpoints\n\n- **POST** `http://localhost:{PORT}/add`\n\n  **Required Payload:**\n\n  ```json\n  {\n    \"first_name\": \"string\",\n    \"last_name\": \"string\",\n    \"email_address\": \"string\",\n    \"contact_number\": \"string\"\n  }\n  ```\n\n- **POST** `http://localhost:{PORT}/update?id={id}`\n\n  **Required Payload:**\n\n  ```json\n  {\n    \"first_name\": \"string\",\n    \"last_name\": \"string\",\n    \"email_address\": \"string\",\n    \"contact_number\": \"string\"\n  }\n  ```\n\n- **GET** `http://localhost:{PORT}/display`\n\n  **Returned Data:**\n\n  ```ts\n  type ContactList = {\n    id: number,\n    first_name: string,\n    last_name: string,\n    email_address: string,\n    contact_number: string,\n    is_deleted: number\n  }[]\n  ```\n\n- **POST** `http://localhost:{PORT}/delete?id={id}`\n\n## Usage\n\nTo set up and run the application, follow these steps:\n\n- **Environment Configuration:**\n\n  Create a `.env` file in the root directory with the following variables:\n\n  - `PORT` - The port the server will run on.\n  - `DB_HOST` - Your MySQL database host (e.g., localhost).\n  - `DB_USER` - Your MySQL database username.\n  - `DB_PASS` - Your MySQL database password.\n  - `DB_NAME` - The name of your database.\n\n  You can also copy the provided [`.env-dev`](.env-dev) file as a template:\n\n- **Database Setup:**\n\n  Create a MySQL database and table using the following SQL commands:\n\n  ```sql\n  CREATE DATABASE db_name;\n  USE db_name;\n\n  CREATE TABLE contact_list (\n    id int PRIMARY KEY AUTO_INCREMENT,\n    first_name varchar(50) NOT NULL,\n    last_name varchar(50) NOT NULL,\n    email_address varchar(255) NOT NULL,\n    contact_number varchar(50) DEFAULT NULL,\n    is_deleted int DEFAULT 0\n  );\n  ```\n\n- **Running the Application:**\n\n  - **Clone the repository:**\n\n    ```sh\n    git clone https://github.com/DestinEcarma/contact-list-backend\n    ```\n\n  - **Navigate to the project directory:**\n\n    ```sh\n    cd contact-list-backend\n    ```\n\n  - **Install the dependencies:**\n\n    ```sh\n    npm install\n    ```\n\n  - **Start the development server:**\n\n    ```sh\n    npm run dev\n    ```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdestinecarma%2Fcontact-list-backend","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdestinecarma%2Fcontact-list-backend","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdestinecarma%2Fcontact-list-backend/lists"}