{"id":23602643,"url":"https://github.com/floyden-monteiro/dotnet-basic-api","last_synced_at":"2026-05-03T20:36:03.244Z","repository":{"id":268823031,"uuid":"905308741","full_name":"Floyden-Monteiro/dotnet-basic-api","owner":"Floyden-Monteiro","description":"BagAPI is a RESTful API designed to manage and organize bags and their contents. It allows users to create, read, update, and delete bags and items within those bags.","archived":false,"fork":false,"pushed_at":"2024-12-19T04:57:19.000Z","size":193,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-17T19:37:16.867Z","etag":null,"topics":["csharp","dotnet","dotnet-framework","jwt","jwt-authentication","jwt-token","mvc-architecture","orm","post","postgresql"],"latest_commit_sha":null,"homepage":"","language":"C#","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/Floyden-Monteiro.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-12-18T15:08:24.000Z","updated_at":"2024-12-19T04:57:22.000Z","dependencies_parsed_at":null,"dependency_job_id":"33bb6a5d-4c59-4783-baad-45fdff048a0c","html_url":"https://github.com/Floyden-Monteiro/dotnet-basic-api","commit_stats":null,"previous_names":["floyden-monteiro/dotnet-basic-api"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Floyden-Monteiro/dotnet-basic-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Floyden-Monteiro%2Fdotnet-basic-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Floyden-Monteiro%2Fdotnet-basic-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Floyden-Monteiro%2Fdotnet-basic-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Floyden-Monteiro%2Fdotnet-basic-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Floyden-Monteiro","download_url":"https://codeload.github.com/Floyden-Monteiro/dotnet-basic-api/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Floyden-Monteiro%2Fdotnet-basic-api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274821732,"owners_count":25356357,"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","status":"online","status_checked_at":"2025-09-12T02:00:09.324Z","response_time":60,"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":["csharp","dotnet","dotnet-framework","jwt","jwt-authentication","jwt-token","mvc-architecture","orm","post","postgresql"],"created_at":"2024-12-27T12:12:10.793Z","updated_at":"2026-05-03T20:36:02.798Z","avatar_url":"https://github.com/Floyden-Monteiro.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# BagAPI\r\n\r\n## Project Description\r\nBagAPI is a RESTful API designed to manage and organize bags and their contents. It allows users to create, read, update, and delete bags and items within those bags.\r\n\r\n## Installation\r\nTo install and run the BagAPI locally, follow these steps:\r\n\r\n1. Clone the repository:\r\n    ```bash\r\n    git clone https://github.com/yourusername/BagAPI.git\r\n    ```\r\n2. Navigate to the project directory:\r\n    ```bash\r\n    cd BagAPI\r\n    ```\r\n\r\n## Configuration\r\n### Configure the Database\r\nUpdate the `appsettings.json` file with your database connection string:\r\n```json\r\n{\r\n  \"ConnectionStrings\": {\r\n    \"DefaultConnection\": \"Server=your_server;Database=BagDB;User Id=your_user;Password=your_password;\"\r\n  },\r\n  \"JwtSettings\": {\r\n    \"SecretKey\": \"your_secret_key\",\r\n    \"Issuer\": \"your_issuer\",\r\n    \"Audience\": \"your_audience\"\r\n  }\r\n}\r\n```\r\n\r\n### Apply Migrations\r\nRun the following commands to apply the database migrations:\r\n```bash\r\ndotnet ef migrations add InitialCreate\r\ndotnet ef database update\r\n```\r\n\r\n## Running the Application\r\nRun the application using the following command:\r\n```bash\r\ndotnet run\r\n```\r\nThe API will be available at `https://localhost:5001` or `http://localhost:5000`.\r\n\r\n## API Endpoints\r\n### User Endpoints\r\n- `GET /api/users` - Get all users\r\n- `GET /api/users/{id}` - Get user by ID\r\n- `POST /api/users` - Create a new user\r\n- `PUT /api/users/{id}` - Update an existing user\r\n- `DELETE /api/users/{id}` - Delete a user\r\n- `POST /api/users/login` - Authenticate a user and get a JWT token\r\n\r\n### Role Endpoints\r\n- `GET /api/roles` - Get all roles\r\n- `GET /api/roles/{id}` - Get role by ID\r\n- `POST /api/roles` - Create a new role\r\n- `PUT /api/roles/{id}` - Update an existing role\r\n- `DELETE /api/roles/{id}` - Delete a role\r\n\r\n### Product Endpoints\r\n- `GET /api/products` - Get all products\r\n- `GET /api/products/{id}` - Get product by ID\r\n- `POST /api/products` - Create a new product\r\n- `PUT /api/products/{id}` - Update an existing product\r\n- `DELETE /api/products/{id}` - Delete a product\r\n\r\n## Authentication\r\nThe API uses JWT tokens for authentication. To access protected endpoints, include the token in the Authorization header as follows:\r\n```http\r\nAuthorization: Bearer \u003cyour_token\u003e\r\n```\r\n\r\n## Migration Commands\r\n- Creating a migration file: `dotnet ef migrations add InitialCreate`\r\n- Attributing the migration to the database: `dotnet ef add AddAttributesToModels`\r\n- Updating the database: `dotnet ef database update`\r\n- Removing the last migration: `dotnet ef migrations remove`\r\n- Update to a specific migration: `dotnet ef database update \u003cId of migration\u003e`\r\n- List of migrations: `dotnet ef migrations list`\r\n- Add table to database: `dotnet ef migrations add AddProductTable`\r\n\r\n## Postman Documentation\r\nFor detailed API documentation and testing, you can use the Postman collection available [here](https://documenter.getpostman.com/view/40139824/2sAYJ1mhbX).\r\n\r\n\r\n\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffloyden-monteiro%2Fdotnet-basic-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffloyden-monteiro%2Fdotnet-basic-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffloyden-monteiro%2Fdotnet-basic-api/lists"}