https://github.com/codezilla322/receipt-processor-challenge
https://github.com/codezilla322/receipt-processor-challenge
Last synced: 11 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/codezilla322/receipt-processor-challenge
- Owner: codezilla322
- Created: 2025-02-11T18:31:22.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2025-02-11T18:52:12.000Z (about 1 year ago)
- Last Synced: 2025-02-11T19:40:22.699Z (about 1 year ago)
- Language: Go
- Size: 1.95 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Receipt Processor
The **Receipt Processor** is a web service that processes receipts, calculates points based on specific rules, and stores the data in-memory using **Redis**. The service provides two main API endpoints:
1. **`POST /receipts/process`**: Receives a JSON receipt, processes it, and returns a unique ID.
2. **`GET /receipts/{id}/points`**: Retrieves the points awarded for a given receipt ID.
## Installation
To get started, ensure that **Go** and **Redis** are installed on your machine. The instructions below will help you set up the project.
### 1. Clone the Repository
Clone this repository to your local machine:
```sh
git clone https://github.com/codezilla322/receipt-processor-challenge.git
cd receipt-processor
```
### 2. Install Dependencies
Run the following command to download required Go modules:
```sh
go mod tidy
```
### 3. Start Redis Server
Make sure Redis is running locally on port 6379
```sh
redis-server
```
### 4. Run the Application
After Redis is running, you can start the Go application by running:
```sh
go run main.go
```
This will start the web service on port 8080.