{"id":22983352,"url":"https://github.com/muthukumar89uk/go-online-purchase","last_synced_at":"2025-04-02T10:23:56.041Z","repository":{"id":250338634,"uuid":"834180001","full_name":"muthukumar89uk/go-online-purchase","owner":"muthukumar89uk","description":"This is a online-purchasing application implemented by using the golang with echo web framework.","archived":false,"fork":false,"pushed_at":"2024-07-31T15:26:24.000Z","size":24,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-08T01:33:22.326Z","etag":null,"topics":["echo-framework","ecommerce-application","golang","jwt-authentication","labstack-echo","postgresql-database","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/muthukumar89uk.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-07-26T15:38:04.000Z","updated_at":"2024-08-01T10:20:51.000Z","dependencies_parsed_at":"2025-02-08T01:31:34.837Z","dependency_job_id":"98d2ede0-3134-4eff-a6fb-d0c1bcdd7031","html_url":"https://github.com/muthukumar89uk/go-online-purchase","commit_stats":null,"previous_names":["muthukumar89uk/go-online-purchase"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muthukumar89uk%2Fgo-online-purchase","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muthukumar89uk%2Fgo-online-purchase/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muthukumar89uk%2Fgo-online-purchase/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muthukumar89uk%2Fgo-online-purchase/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/muthukumar89uk","download_url":"https://codeload.github.com/muthukumar89uk/go-online-purchase/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246794982,"owners_count":20835105,"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":["echo-framework","ecommerce-application","golang","jwt-authentication","labstack-echo","postgresql-database","rest-api"],"created_at":"2024-12-15T02:38:26.649Z","updated_at":"2025-04-02T10:23:56.012Z","avatar_url":"https://github.com/muthukumar89uk.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OnlinePurchase Project\r\nThis repository contains a Go language web application for managing online orders and products. The application provides APIs for user signup, login, managing products, placing orders, and checking order status. It is built using the Echo framework and GORM for database interactions.\r\n\r\n## Technologies used\r\nThe project is built using the following technologies:\r\n- **Golang**  : The backend is written in Go (Golang), a statically typed, compiled language.\r\n- **Echo**   : The Echo web framework is used to create RESTful APIs and handle HTTP requests.\r\n- **JWT**     : JSON Web Tokens are used for secure user authentication and authorization.\r\n- **bcrypt**  : Passwords are stored securely in hashed form using the bcrypt hashing algorithm.\r\n- **Postgres**: Here, users data and Post articles data are handled in Postgres SQL.\r\n\r\n## Project Structure\r\nThe project is organized into several packages, each responsible for specific functionalities:\r\n- `handlers`  : Contains the HTTP request handlers for different API endpoints.\r\n- `logs`      : Custom package for logging.\r\n- `middleware`: Custom middleware for handling authentication and authorization.\r\n- `models`    : Defines the data models used in the application.\r\n- `repository`: Contains functions for interacting with the database.\r\n- `drivers`   : Contains functions for establish a connection to database.\r\n- `helper`    : Custom package that contains all the constants.\r\n- `Lookup`    : Contains functions for checking the database updations.\r\n\r\n## Endpoints\r\nThe following endpoints are available in the application:\r\n\r\n### User Signup\r\n- `POST /signup`: Sign up a new user with the required details such as username , email, password, and role (admin or user).\r\n\r\n### User Login\r\n- `POST /login`: Authenticate a user with email and password and return a JWT token for further authentication.\r\n\r\n### Product Management\r\n- `POST /product`: Add a new product with details such as brand name, product price, RAM capacity, etc. (Admin access required)\r\n- `GET /products`: Get a list of all products.\r\n- `PUT /product/:product_id`: Update product details by product ID. (Admin access required)\r\n- `DELETE /product/:product_id`: Delete a product by product ID. (Admin access required)\r\n\r\n### Order Management\r\n- `POST /order`: Place a new order with details such as brand name, product price, RAM capacity, etc. (User access required)\r\n- `DELETE /order/:order_id`: Cancel an order by order ID. (User access required)\r\n- `GET /orders`: Get a list of all orders for the current user. (User access required)\r\n- `POST /payment/:order_id`: Make a payment for an order with the specified order ID. (User access required)\r\n- `PUT /orderstatus/:order_id`: Update the status of an order by order ID. (Admin access required)\r\n- `GET /orderstatus/:order_id`: Get the status of an order by order ID.\r\n- `GET /orderstatuses`: Get a list of all order statuses. (Admin access required)\r\n\r\n## Authentication\r\nThe application uses JWT (JSON Web Token) for authentication. To access the protected endpoints, users need to include the JWT token in the `Authorization` header of the request.\r\n\r\n### User Authentication\r\n- For user authentication, a valid JWT token obtained during the login process should be included in the header as follows:\r\n\r\n### Admin Authentication\r\n- For admin authentication, the same process applies with a valid JWT token obtained during the login process for an admin user.\r\n\r\n### Error Handling\r\nThe application handles various error scenarios and provides appropriate error responses with corresponding status codes and messages.\r\n\r\n## Installation\r\n\r\n 1. Clone the repository Or Download:\r\n\r\n ```\r\n   git clone https://github.com/muthukumar89uk/go-online-purchase.git\r\n ```\r\n\r\nClick here to directly [download it](https://github.com/muthukumar89uk/go-online-purchase/zipball/master).\r\n\r\n## Install dependencies:\r\n\r\n          go mod tidy\r\n\r\n## Run the Application\r\n  1. Run the Server\r\n   \r\n       ```\r\n          go run .\r\n       ```  \r\n\r\n  2. The server will start on `http://localhost:8000`.\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmuthukumar89uk%2Fgo-online-purchase","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmuthukumar89uk%2Fgo-online-purchase","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmuthukumar89uk%2Fgo-online-purchase/lists"}