{"id":23116317,"url":"https://github.com/nabilshadman/go-rest-api-jobs-data","last_synced_at":"2026-05-01T09:31:31.654Z","repository":{"id":176914062,"uuid":"398527332","full_name":"nabilshadman/go-rest-api-jobs-data","owner":"nabilshadman","description":"REST API for managing job listings built with Go and PostgreSQL, featuring CRUD operations and Postman integration examples","archived":false,"fork":false,"pushed_at":"2024-12-05T12:05:56.000Z","size":2206,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-04T01:28:25.452Z","etag":null,"topics":["backend","data-engineering","go","postgresql","rest-api","software-engineering"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nabilshadman.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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":"2021-08-21T10:19:15.000Z","updated_at":"2024-12-05T12:06:00.000Z","dependencies_parsed_at":null,"dependency_job_id":"4a0c646b-074d-41e2-9785-7f079bb966ee","html_url":"https://github.com/nabilshadman/go-rest-api-jobs-data","commit_stats":null,"previous_names":["nabilshadman/go-rest-api-jobs-list-postgres","nabilshadman/go-rest-api-jobs-data"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/nabilshadman/go-rest-api-jobs-data","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nabilshadman%2Fgo-rest-api-jobs-data","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nabilshadman%2Fgo-rest-api-jobs-data/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nabilshadman%2Fgo-rest-api-jobs-data/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nabilshadman%2Fgo-rest-api-jobs-data/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nabilshadman","download_url":"https://codeload.github.com/nabilshadman/go-rest-api-jobs-data/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nabilshadman%2Fgo-rest-api-jobs-data/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32492104,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-30T13:12:12.517Z","status":"online","status_checked_at":"2026-05-01T02:00:05.856Z","response_time":64,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["backend","data-engineering","go","postgresql","rest-api","software-engineering"],"created_at":"2024-12-17T04:15:59.025Z","updated_at":"2026-05-01T09:31:31.422Z","avatar_url":"https://github.com/nabilshadman.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# JobAPI: Go-Powered REST Service\n\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n![Go](https://img.shields.io/badge/go-%2300ADD8.svg?style=flat\u0026logo=go\u0026logoColor=white)\n![Postgres](https://img.shields.io/badge/postgres-%23316192.svg?style=flat\u0026logo=postgresql\u0026logoColor=white)\n![Version](https://img.shields.io/badge/version-1.0.0-blue.svg)\n\n## Overview\n\nJobAPI is a high-performance REST service built with Go (Golang) that provides comprehensive job management capabilities. The service offers streamlined CRUD operations (Create, Read, Update, Delete) for job listings, leveraging PostgreSQL for robust data persistence and Go's powerful concurrency features for efficient request handling.\n\n### Key Features\n- Data modeling using Go structs and slices for efficient data manipulation\n- API endpoint routing and handler function implementation\n- Modular and maintainable code architecture\n- Integration with PostgreSQL for persistent data storage\n\n### Technical Implementation\nThe API leverages several key technologies and packages:\n- gorilla/mux for robust routing capabilities\n- Environment variable management\n- HTTP request handling\n- JSON encoding/decoding\n- Type checking and string conversion utilities\n\n### Tech Stack\n- Go (Golang)\n- PostgreSQL\n- Postman (API testing)\n\nThis REST API serves as a practical demonstration of building scalable web services with Go while following best practices in API design and database integration.\n\n## Environment Setup\n\n### Prerequisites\n1. **Go (Golang)**\n   - Download and install from [Go's official website](https://go.dev/doc/install)\n\n2. **Required Go Packages**\n   ```bash\n   go get github.com/gorilla/mux      # HTTP router and URL matcher\n   go get github.com/subosito/gotenv  # Environment variable loader\n   go get github.com/lib/pq           # PostgreSQL driver\n   ```\n\n3. **Postman**\n   - Install [Postman](https://www.postman.com/) for API testing and development\n\n4. **Database Setup**\n   - Create a free database instance on [ElephantSQL](https://www.elephantsql.com/)\n   - Execute the following SQL to create the jobs table:\n     ```sql\n     CREATE TABLE jobs (\n         # Table schema here\n     );\n     ```\n\n### Configuration\nCreate a `.env` file in your project root with the following:\n```env\nELEPHANTSQL_URL=\"your_database_url_here\"\n```\n\nWith these components in place, you'll have a complete development environment for running and testing the API.\n\n## Run Application\n\nTo start and test the application:\n\n### 1. Build and Run\n\nLaunch the application by running the following command in your terminal:\n\n```bash\ngo build \u0026\u0026 ./jobs-list\n```\n\n### 2. Access the API\n\nYou can access the API in two ways:\n\n#### Browser\nOpen your web browser and navigate to:\n```\nhttp://localhost:8000/jobs\n```\n\n#### Postman\nAlternatively, use Postman to send requests:\n```http\nGET http://localhost:8000/jobs\n```\n\nNote: The application runs on port 8000 by default. Make sure this port is available on your system.\n\n\n## Examples\n\nWe recommend using Postman to make requests to the REST API. You can use either the desktop agent or browser version to send GET, POST, PUT, or DELETE requests.\n\n### Create a Job\n\nTo create a new job posting:\n\n```http\nPOST http://localhost:8000/jobs\n```\n\nRequest body:\n```json\n{\n    \"title\": \"Software Engineer\",\n    \"company\": \"LLM AI\",\n    \"location\": \"San Francisco, CA\",\n    \"type\": \"Full-time\"\n}\n```\n\nThe server will return a response containing the newly created job's ID (assumed to be 8 in subsequent examples).\n\n### Read Jobs\n\nTo retrieve all jobs:\n\n```http\nGET http://localhost:8000/jobs\n```\n\nTo retrieve a specific job by ID:\n\n```http\nGET http://localhost:8000/jobs/1\n```\n\n### Update a Job\n\nTo update an existing job:\n\n```http\nPUT http://localhost:8000/jobs\n```\n\nRequest body:\n```json\n{\n    \"id\": 8,\n    \"title\": \"Machine Learning Engineer\",\n    \"company\": \"LLM AI\",\n    \"location\": \"New York, NY\",\n    \"type\": \"Full-time\"\n}\n```\n\n### Delete a Job\n\nTo delete a job by ID:\n\n```http\nDELETE http://localhost:8000/jobs/8\n```\n\nFor more detailed examples of using our API with Postman, check out our [demo](https://github.com/nabilshadman/go-rest-api-jobs-list-postgres/tree/main/demo).\n\n\n## Screenshots\n\nVisual walkthrough of the API's core functionality:\n\n\u003ctable width=\"100%\"\u003e\n\u003ctr\u003e\n\u003ctd width=\"50%\"\u003e\u003cstrong\u003e1. Server running on localhost:8000\u003c/strong\u003e\u003c/td\u003e\n\u003ctd width=\"50%\"\u003e\u003cstrong\u003e2. GET /jobs - Retrieving all jobs\u003c/strong\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e\u003cimg src=\"./demo/0_jobs-list_server_running.jpg\" width=\"100%\"\u003e\u003c/td\u003e\n\u003ctd\u003e\u003cimg src=\"./demo/1_jobs-list_getjobs.jpg\" width=\"100%\"\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e\u003cstrong\u003e3. GET /jobs/{id} - Retrieving specific job\u003c/strong\u003e\u003c/td\u003e\n\u003ctd\u003e\u003cstrong\u003e4. POST /jobs - Creating new job\u003c/strong\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e\u003cimg src=\"./demo/2_jobs-list_getjob.jpg\" width=\"100%\"\u003e\u003c/td\u003e\n\u003ctd\u003e\u003cimg src=\"./demo/3_jobs-list_addjob_0.jpg\" width=\"100%\"\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e\u003cstrong\u003e5. Server response for job creation\u003c/strong\u003e\u003c/td\u003e\n\u003ctd\u003e\u003cstrong\u003e6. PUT /jobs - Updating existing job\u003c/strong\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e\u003cimg src=\"./demo/4_jobs-list_addjob_1.jpg\" width=\"100%\"\u003e\u003c/td\u003e\n\u003ctd\u003e\u003cimg src=\"./demo/5_jobs-list_updatejob_0.jpg\" width=\"100%\"\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e\u003cstrong\u003e7. Server response for job update\u003c/strong\u003e\u003c/td\u003e\n\u003ctd\u003e\u003cstrong\u003e8. DELETE /jobs/{id} - Removing job\u003c/strong\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e\u003cimg src=\"./demo/6_jobs-list_updatejob_1.jpg\" width=\"100%\"\u003e\u003c/td\u003e\n\u003ctd\u003e\u003cimg src=\"./demo/7_jobs-list_removejob_0.jpg\" width=\"100%\"\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e\u003cstrong\u003e9. Server response for job deletion\u003c/strong\u003e\u003c/td\u003e\n\u003ctd\u003e\u003cstrong\u003e10. Final PostgreSQL database state\u003c/strong\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e\u003cimg src=\"./demo/8_jobs-list_removejob_1.jpg\" width=\"100%\"\u003e\u003c/td\u003e\n\u003ctd\u003e\u003cimg src=\"./demo/9_jobs-list_postgres_latest_state.jpg\" width=\"100%\"\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/table\u003e\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.\n\n## License\n\nThis project is licensed under the MIT License. See the [LICENSE](./LICENSE.txt) file for details.\n\n## Citation  \nIf you use this work in your research, please cite:  \n\n```bibtex  \n@misc{job-api-go,\n  author = {Shadman, Nabil},\n  title = {JobAPI: Go-Powered REST Service},\n  year = {2021},\n  publisher = {GitHub},\n  url = {https://github.com/nabilshadman/go-rest-api-jobs-data}\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnabilshadman%2Fgo-rest-api-jobs-data","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnabilshadman%2Fgo-rest-api-jobs-data","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnabilshadman%2Fgo-rest-api-jobs-data/lists"}