Skip to content

Commit

Permalink
chore: 📖 docs updated and latest screenshot added
Browse files Browse the repository at this point in the history
  • Loading branch information
codeperfectplus committed Aug 19, 2024
1 parent 31c01c7 commit 5044cf4
Show file tree
Hide file tree
Showing 11 changed files with 81 additions and 33 deletions.
74 changes: 63 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,28 @@
# Gold Silver Billing

![Homepage](/images/homepage.png)
![Homepage](/images/app.png)

## Our Mission

Our mission is to simplify the process of calculating gold prices for jewellers and customers alike. We aim to provide a user-friendly tool that allows for accurate and efficient calculations, ensuring transparency and trust in every transaction.

## Features

- Real-time Price Calculation
- Transaction History
- Multi Level Authentication
- User-friendly Interface
- Customizable Charges
- Responsive Design
- Secure Data Handling
- Business Customization

## Demo

Demo is live on the the belows servers.

- [Render(Server 1)](https://goldsilverbilling.onrender.com/)
- [Railway(Server 2)](https://goldsilverbilling-production.up.railway.app/)
- [Render(Server 1)](https://goldsilverbilling.onrender.com/)

## Building and Running the Docker Container

Expand All @@ -30,18 +41,59 @@ docker run -p 5000:5000 goldsilverbilling

## Product Screenshots

### Homepage

![Homepage](/images/homepage.png)

### Admin Dashboard

![Admin Dashboard](/images/admin_dashboard.png)

### Gold Calculator

![Gold Calculator](/images/gold_calculator.png)

![Gold Home Page](/images/bill_page.png)
### System Settings

![System Settings](/images/system_setting.png)

### Transaction History

![Transaction History](/images/transaction_history.png)

## Improvements

- User Authentication: Add a login system to secure sensitive data.
- Data Persistence: Store historical data for future reference.
- API Integration: Fetch real-time gold/silver prices.
- Multi-Currency Support: Allow conversions for different currencies.
- Responsive Design: Enhance mobile usability.
- Advanced Analytics: Provide reports or graphs based on past transactions.
- Multi-Language Support: Cater to a broader audience by including multiple languages.
- Error Handling: Implement robust validation and error messages for user inputs.
| Improvement | Type | Details | Implemented |
|------------------------|-----------------------|-------------------------------------------------------------------------------------------|--------------|
| User Authentication | Security | Add a login system to secure sensitive data. | ☑ |
| Data Persistence | Functionality | Store historical data for future reference. | ☑ |
| Multi-Currency Support | Functionality | Allow conversions for different currencies. | ☑ |
| Responsive Design | User Experience | Enhance mobile usability by optimizing the layout and design for smaller screens. | ☑ |
| Error Handling | Functionality | Implement robust validation and error messages for user inputs to improve user experience. |☑ |
| API Integration | Integration | Fetch real-time gold/silver prices from external APIs. | :x: |
| Advanced Analytics | Functionality | Provide reports or graphs based on past transactions for better insights. | :x: |
| Multi-Language Support | User Experience | Cater to a broader audience by including multiple languages for the user interface. | :x: |


## Author

- [@codeperfectplus](https://github.com/codeperfectplus)

## License

This project is open source and available under the [MIT License](LICENSE).

## Acknowledgments

- [Font Awesome](https://fontawesome.com/)
- [Bootstrap](https://getbootstrap.com/)
- [Python](https://www.python.org/)
- [Flask](https://flask.palletsprojects.com/)
- [Render](https://render.com/)
- [Railway](https://railway.app/)

## Contact

For any queries or feedback, please feel free to reach out to us at [[email protected]](mailto:[email protected]).

---
29 changes: 16 additions & 13 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,14 @@ def load_config() -> dict:

app.config.update(load_config())

# Define the database models
currency_to_symbol_dict = {
"INR" : "₹",
"USD" : "$ ",
"EUR" : "€ ",
"GBP" : "£ ",
"JPY" : "¥ ",
"AUD" : "A$ ",
}


class GoldTransaction(db.Model):
Expand Down Expand Up @@ -147,16 +154,6 @@ def inject_theme():
# Gold calculator route
@app.route('/gold-calculator', methods=['GET', 'POST'])
def gold_calculator():

currency_to_symbol_dict = {
"INR" : "₹ ",
"USD" : "$ ",
"EUR" : "€ ",
"GBP" : "£ ",
"JPY" : "¥ ",
"AUD" : "A$ ",
}

current_currency = Settings.query.first().currency
currency_symbol = currency_to_symbol_dict.get(current_currency, '$')
if request.method == 'POST':
Expand Down Expand Up @@ -224,6 +221,8 @@ def gold_calculator():
# Silver calculator route
@app.route('/silver-calculator', methods=['GET', 'POST'])
def silver_calculator():
current_currency = Settings.query.first().currency
currency_symbol = currency_to_symbol_dict.get(current_currency, '$')
if request.method == 'POST':
try:
weight = float(request.form['weight'])
Expand Down Expand Up @@ -264,7 +263,9 @@ def silver_calculator():
weight=weight,
price_per_gram=silver_price_per_gram,
purity=silver_purity,
config=app.config)
config=app.config,
current_currency=current_currency,
currency_symbol=currency_symbol)
except ValueError as e:
logging.error(f"ValueError in silver calculator: {str(e)}")
flash(f"Input error: {str(e)}", 'error')
Expand All @@ -279,7 +280,9 @@ def silver_calculator():
price_per_gram=silver_price_per_gram,
service_charge=silver_service_charge,
tax=silver_tax,
config=app.config)
config=app.config,
current_currency=current_currency,
currency_symbol=currency_symbol)

@app.route('/history', methods=['GET'])
@login_required
Expand Down
Binary file added images/admin_dashboard.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/app.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed images/bill_page.png
Binary file not shown.
Binary file modified images/gold_calculator.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/homepage.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/system_setting.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/transaction_history.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 0 additions & 7 deletions templates/homepage.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,6 @@ <h1>Welcome to the Pricing Calculator</h1>
<a href="{{ url_for('pricing') }}" class="btn btn-hero">
<i class="fa-solid fa-money-check-dollar fa-lg"></i> Pricing
</a>
{% if current_user.is_authenticated %}
{% if current_user.user_level == 'admin' %}
<a href="{{ url_for('history') }}" class="btn btn-hero">
<i class="fa-solid fa-history fa-lg"></i> History
</a>
{% endif %}
{% endif %}
</div>
</div>
{% endblock %}
4 changes: 2 additions & 2 deletions templates/silver_calculator.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ <h1>Silver Price Calculator</h1>
<input type="number" id="purity" name="purity" step="0.1" max="100" min="0" class="form-control" required>
</div>
<div class="form-group">
<label for="price_per_gram">Price (per gm) (₹): <i class="fa-solid fa-weight-hanging"></i></label>
<label for="price_per_gram">Price (per gm) {{ currency_symbol }}: <i class="fa-solid fa-weight-hanging"></i></label>
<input type="number" id="price_per_gram" name="price_per_gram" step="0.01" class="form-control" value="{{ price_per_gram }}" required>
</div>
<div class="form-row">
Expand Down Expand Up @@ -51,7 +51,7 @@ <h2>Jeweler Details</h2>
<p><strong>Email:</strong> {{ config['JEWELLER_EMAIL'] }}</p>
<p><strong>Website:</strong> {{ config['JEWELLER_WEBSITE'] }}</p>
<p><strong>GSTIN:</strong> {{ config['JEWELLER_GSTIN'] }}</p>
<p><strong>Silver Rate (Per gm):</strong> {{ price_per_gram }}</p>
<p><strong>Silver Rate (Per gm):</strong> {{ currency_symbol }} {{ price_per_gram }}</p>
</div>
</div>
{% endblock %}

0 comments on commit 5044cf4

Please sign in to comment.