{"id":22127930,"url":"https://github.com/dmunasingha/pharmacy-project","last_synced_at":"2026-05-05T04:02:28.474Z","repository":{"id":225387523,"uuid":"765860346","full_name":"dmunasingha/pharmacy-project","owner":"dmunasingha","description":"This project is a back-end system designed for a pharmacy to streamline its business processes, including authentication, medication inventory management, and customer record management. The system enforces user roles and permissions for different actions to ensure security and efficiency.","archived":false,"fork":false,"pushed_at":"2024-03-01T19:30:37.000Z","size":155,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-29T14:09:52.791Z","etag":null,"topics":["api","laravel","pharmacy","php","restful-api","sanctum","sqlite3"],"latest_commit_sha":null,"homepage":"","language":"PHP","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/dmunasingha.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}},"created_at":"2024-03-01T19:05:25.000Z","updated_at":"2024-03-03T07:47:59.000Z","dependencies_parsed_at":"2024-03-01T20:29:25.865Z","dependency_job_id":"f93c523a-2889-451f-b1ca-ab9e9f1f693d","html_url":"https://github.com/dmunasingha/pharmacy-project","commit_stats":null,"previous_names":["dmunasingha/pharmacy-project"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmunasingha%2Fpharmacy-project","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmunasingha%2Fpharmacy-project/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmunasingha%2Fpharmacy-project/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmunasingha%2Fpharmacy-project/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dmunasingha","download_url":"https://codeload.github.com/dmunasingha/pharmacy-project/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245235681,"owners_count":20582287,"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":["api","laravel","pharmacy","php","restful-api","sanctum","sqlite3"],"created_at":"2024-12-01T17:22:33.136Z","updated_at":"2026-05-05T04:02:23.411Z","avatar_url":"https://github.com/dmunasingha.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Pharmacy Project\n\nThis project is a back-end system designed for a pharmacy to streamline its business processes, including authentication, medication inventory management, and customer record management. The system enforces user roles and permissions for different actions to ensure security and efficiency.\n\n### Libraries Used\n\n#### Laravel Sanctum\n\n-   Official Laravel package for API token authentication.\n-   [Documentation](https://laravel.com/docs/10.x/sanctum)\n\n#### Spatie Laravel Permission\n\n-   Package for managing user permissions and roles in Laravel applications.\n-   [Documentation](https://spatie.be/docs/laravel-permission/v6/introduction)\n\n## Run Locally\n\n### Prerequisites\n\n-   PHP ^8.1\n-   Laravel 10\n-   SQLite (3.39.2)\n-   Postman (for testing)\n\nClone the project\n\n```bash\n  git clone https://github.com/dmunasingha/pharmacy-project\n```\n\nGo to the project directory\n\n```bash\n  cd pharmacy-project\n```\n\nInstall PHP dependencies\n\n```bash\n  composer install\n```\n\nCopy the Enviroment File\n\n```bash\n  copy .env.example .env\n```\n\nGenerate Application Key\n\n```bash\n  php artisan key:generate\n```\n\nRun Database Migrations (without dummy data)\n\n```bash\n  php artisan migrate\n```\n\nor\n\nRun Database Migrations (with dummy data)\n\n```bash\n  php artisan migrate --seed\n```\n\nStart the development server\n\n```bash\n  php artisan serve\n```\n\n## Includes\n\n-   Project\n-   ER Diagram (er.svg \u0026 er.mwb)\n-   Postman Collection (Pharmacy Application. postman_collection.json)\n-   Database Export (database/export.sql)\n\n## API Reference\n\n### Authentication\n\nTo access the API endpoints, you need to authenticate your requests using a bearer token. Follow these steps to obtain a bearer token:\n\n#### Using Postman\n\nWhen login a token will be received copy it and go to the authorization tab select the type as Bearer Token and paste the copied token in it (Individualy on each HTTP Requests or for the Collection)\n\n#### Login\n\n```http\n  POST /api/login\n```\n\n| Parameter  | Type     | Description   |\n| :--------- | :------- | :------------ |\n| `email`    | `string` | **Required**. |\n| `password` | `string` | **Required**. |\n\n#### Register User\n\n```http\n  POST /api/register\n```\n\n| Parameter               | Type     | Description   |\n| :---------------------- | :------- | :------------ |\n| `name`                  | `string` | **Required**. |\n| `email`                 | `string` | **Required**. |\n| `password`              | `string` | **Required**. |\n| `password_confirmation` | `string` | **Required**. |\n| `role`                  | `string` | **Required**. |\n\n#### Logout\n\n```http\n  POST /api/logout\n```\n\n#### Get all roles\n\n```http\n  GET /api/roles\n```\n\n#### Create Role\n\n```http\n  POST /api/roles\n```\n\n| Parameter | Type     | Description   |\n| :-------- | :------- | :------------ |\n| `name`    | `string` | **Required**. |\n\n#### Get Role Details\n\n```http\n  GET /api/roles/{id}\n```\n\n#### Update Role\n\n```http\n  POST /api/roles/{id}\n```\n\n| Parameter | Type     | Description   |\n| :-------- | :------- | :------------ |\n| `name`    | `string` | **Required**. |\n\n#### Delete Role\n\n```http\n  DELETE /api/roles/{id}\n```\n\n#### Assign Permission to Role\n\n```http\n  POST /api/roles/permissions\n```\n\n| Parameter    | Type     | Description                   |\n| :----------- | :------- | :---------------------------- |\n| `role`       | `string` | **Required**. Role Name       |\n| `permission` | `string` | **Required**. Permission Name |\n\n#### Get all medications\n\n```http\n  GET /api/medications\n```\n\n#### Create medication\n\n```http\n  POST /api/medications\n```\n\n| Parameter     | Type     | Description   |\n| :------------ | :------- | :------------ |\n| `name`        | `string` | **Required**. |\n| `description` | `string` | **Required**. |\n| `quantity`    | `string` | **Required**. |\n\n#### Get medication details\n\n```http\n  GET /api/medications/{id}\n```\n\n#### Update medication\n\n```http\n  POST /api/medications/{id}\n```\n\n| Parameter     | Type     | Description   |\n| :------------ | :------- | :------------ |\n| `name`        | `string` | **Required**. |\n| `description` | `string` | **Required**. |\n| `quantity`    | `string` | **Required**. |\n\n#### Soft Delete medication\n\n```http\n  DELETE /api/medications/delete/{id}\n```\n\n#### Force Delete medication\n\n```http\n  DELETE /api/medications/{id}\n```\n\n#### Get all customers\n\n```http\n  GET /api/customers\n```\n\n#### Create customer\n\n```http\n  POST /api/customers\n```\n\n| Parameter | Type     | Description   |\n| :-------- | :------- | :------------ |\n| `name`    | `string` | **Required**. |\n| `contact` | `string` | **Required**. |\n| `email`   | `string` | Optional.     |\n| `address` | `string` | **Required**. |\n\n#### Get customer details\n\n```http\n  GET /api/customers/{id}\n```\n\n#### Update customer\n\n```http\n  POST /api/customers/{id}\n```\n\n| Parameter | Type     | Description   |\n| :-------- | :------- | :------------ |\n| `name`    | `string` | **Required**. |\n| `contact` | `string` | **Required**. |\n| `email`   | `string` | Optional.     |\n| `address` | `string` | **Required**. |\n\n#### Soft Delete customer\n\n```http\n  DELETE /api/customers/delete/{id}\n```\n\n#### Force Delete customer\n\n```http\n  DELETE /api/customers/{id}\n```\n\n#### Get all users\n\n```http\n  GET /api/users\n```\n\n#### Get user details\n\n```http\n  GET /api/users/{id}\n```\n\n#### Delete user\n\n```http\n  DELETE /api/users/delete/{id}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdmunasingha%2Fpharmacy-project","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdmunasingha%2Fpharmacy-project","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdmunasingha%2Fpharmacy-project/lists"}