{"id":22017879,"url":"https://github.com/lingesh15/go-rest-mongodb-server","last_synced_at":"2026-04-17T12:31:54.115Z","repository":{"id":264483239,"uuid":"893498270","full_name":"Lingesh15/Go-Rest-MongoDB-Server","owner":"Lingesh15","description":"RESTful API built with go and MongoDB to perfom crud operations","archived":false,"fork":false,"pushed_at":"2024-11-24T16:04:57.000Z","size":7,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-23T09:34:42.834Z","etag":null,"topics":["golang","mongodb-atlas","rest-api"],"latest_commit_sha":null,"homepage":"","language":"Go","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/Lingesh15.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-24T15:51:03.000Z","updated_at":"2024-11-24T16:14:09.000Z","dependencies_parsed_at":"2024-11-24T17:18:41.728Z","dependency_job_id":null,"html_url":"https://github.com/Lingesh15/Go-Rest-MongoDB-Server","commit_stats":null,"previous_names":["lingesh15/go-rest-mongodb-server"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Lingesh15/Go-Rest-MongoDB-Server","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lingesh15%2FGo-Rest-MongoDB-Server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lingesh15%2FGo-Rest-MongoDB-Server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lingesh15%2FGo-Rest-MongoDB-Server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lingesh15%2FGo-Rest-MongoDB-Server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Lingesh15","download_url":"https://codeload.github.com/Lingesh15/Go-Rest-MongoDB-Server/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lingesh15%2FGo-Rest-MongoDB-Server/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31929529,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-17T10:35:34.458Z","status":"ssl_error","status_checked_at":"2026-04-17T10:35:09.472Z","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":["golang","mongodb-atlas","rest-api"],"created_at":"2024-11-30T05:08:30.384Z","updated_at":"2026-04-17T12:31:54.100Z","avatar_url":"https://github.com/Lingesh15.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Go Rest MongoDB Server\n\nA RESTful API server built with Go (Golang) and MongoDB. This server provides CRUD (Create, Read, Update, Delete) functionality for handling data stored in MongoDB. \n\n## Features\n\n- RESTful API structure\n- MongoDB as the database for storing and retrieving data\n- Simple and fast performance with Go\n- Supports basic CRUD operations (Create, Read, Update, Delete)\n- JSON format for API requests and responses\n\n## Technologies Used\n\n- **Go**: The programming language used to build the server.\n- **MongoDB**: NoSQL database for storing the data.\n\n## Prerequisites\n\nBefore you begin, ensure you have the following installed:\n\n- [Go](https://golang.org/dl/) (v1.18+)\n- [MongoDB](https://www.mongodb.com/try/download/community) (v5.0+)\n- A code editor (like [Visual Studio Code](https://code.visualstudio.com/))\n\n## Getting Started\n\n1. **Clone the repository**:\n\n   ```bash\n   git clone https://github.com/Lingesh15/Go-Rest-MongoDB-Server.git\n   cd Go-Rest-MongoDB-Server\n   ```\n\n2. **Install dependencies**:\n\n   Make sure you have `mux` and `mongo-driver` Go packages installed:\n\n   ```bash\n   go get go.mongodb.org/mongo-driver/mongo\n   ```\n\n3. **Set up MongoDB**:\n\n   - Ensure MongoDB Atlas is configured and a cluster is created.\n   -  ensure you have the connection string.\n\n4. **Configure environment variables**:\n\n   Create a `.env` file in the root of the project and add your MongoDB URI:\n\n   ```bash\n   MONGODB_URI=mongodb+srv://\u003cusername\u003e:\u003cpassword\u003e@cluster0.bywdc.mongodb.net/?retryWrites=true\u0026w=majority\u0026appName=Cluster0\n   ```\n\n5. **Run the server**:\n\n   Use the following command to start the server:\n\n   ```bash\n   go run main.go\n   ```\n\n   The server should now be running on `http://localhost:3000`.\n\n## API Endpoints\n\n| Method | Endpoint         | Description                   |\n|--------|------------------|-------------------------------|\n| GET    | `/api/todos`   | Get all resources             |\n| GET    | `/api/todos/{id}` | Get a single resource by ID  |\n| POST   | `/api/todos`   | Create a new resource         |\n| PUT    | `/api/todos/{id}` | Update an existing resource |\n| DELETE | `/api/todos/{id}` | Delete a resource by ID      |\n\n### Example Request (Create Resource)\n\n```bash\nPOST /api/resource\nContent-Type: application/json\n\n{\n  \"name\": \"Sample Resource\",\n  \"description\": \"This is a sample resource.\"\n}\n```\n\n### Example Response (Get All Resources)\n\n```json\n[\n  {\n    \"_id\": \"60adf77e73c1e730fcd4f06b\",\n    \"name\": \"Sample Resource\",\n    \"description\": \"This is a sample resource.\"\n  }\n]\n```\n\n## Project Structure\n\n```\n├── main.go                # Entry point of the server\n├── go.mod                 # Module definitions and dependencies\n├── go.sum                 # Dependency checksums\n├── .env                   # Environment variables\n├── air.toml               # Air configuration for live reloading\n├── .gitignore             # Ignored files and directories by Git\n└── README.md              # This file\n```\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flingesh15%2Fgo-rest-mongodb-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flingesh15%2Fgo-rest-mongodb-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flingesh15%2Fgo-rest-mongodb-server/lists"}