Coder Social home page Coder Social logo

akhilrex / hammond Goto Github PK

View Code? Open in Web Editor NEW
541.0 541.0 48.0 845 KB

Self hosted vehicle and expense management system. Like Clarkson, but better

License: GNU Affero General Public License v3.0

Dockerfile 0.64% Shell 0.03% Go 37.14% JavaScript 26.72% HTML 0.17% Vue 30.70% SCSS 3.46% EJS 1.15%

hammond's People

Contributors

akhilrex avatar alfhou avatar heikok88 avatar meichthys avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hammond's Issues

Options for different fuel-consumption units

Currently, fuel-consumption are only available at km/L (I don't see a way to change that at least). It would be great if another units like L/100km, mpg, etc are available.

Thanks ;)

Password Cannot be only numeric

Before creating a bug report please make sure you are using the latest docker image / code base.

Please complete the following information

  • Installation Type: Docker
  • Have you tried using the latest docker image / code base: Yes

Describe the bug
User cannot set an only numeric password such as "123456". It simply fails with error code 422 and no description of the reason for user creation.

Expected behavior
The user should be told that only numeric passwords are not permitted.

Import data (Fuelly)

Fuelly currently supports exporting data as a CSV, would it be possible to have an import functionality? I would love to transition to using this instead of Fuelly.

More than 3 vehicles don't fit inside page

Please complete the following information

  • Installation Type: [Docker]
  • Have you tried using the latest docker image / code base [yes]

Describe the bug

If you have more than 3 vehicles, in the main page (Desktop) vehicles are only shown in one row, not creating aditional rows.

To Reproduce
Steps to reproduce the behavior:

  1. Add more than 3 vehicles
  2. Aditional vehicles are in same row

Screenshots

Screenshot_Hammond

422 error when logging in

Before creating a bug report please make sure you are using the latest docker image / code base.

Please complete the following information

  • Installation Type: [Docker]
  • Have you tried using the latest docker image / code base [yes]

Describe the bug
When logging in, it results in a 422 error and I cant log in.

To Reproduce
Steps to reproduce the behavior:

  1. Go to login page
  2. Enter credentials
  3. Click on log in

Expected behavior
That I can log in

Screenshots
image

Error from the console:
hammond | [GIN] 2021/06/05 - 08:00:00 | 422 | 375.955µs | -myIp- | POST "/api/login"

Additional context
Is there a way to reset the password from the commandline?

Make username/email case insensitive

Before creating a bug report please make sure you are using the latest docker image / code base.

Please complete the following information

  • Installation Type: Docker
  • Have you tried using the latest docker image / code base: yes

Describe the bug
Unable to login when using capital letter in username/email [email protected] != [email protected]

To Reproduce
Steps to reproduce the behavior:

  1. Go to login
  2. type email with capital start letter ( if not created with that)
  3. hit login button
  4. Message There was an error logging in to your account. Not Registered email or invalid password

Expected behavior
login, username/email should be case insensitive

Support for fuel "sub-types"

Request for supporting a "sub-type" field for fuel

Each car has a fuel type, but when adding a new fillup it would be nice to have an additional field to define if the fillup used standard or premium fuel.

e.g.
If car is Petrol, possible sub-types are

  • Standard
  • Premium
  • Super Premium

If car is Diesel, possible sub-types are

  • Standard
  • Premium

For the American market I imagine the octane rating will be used for this

[Feature Request] Add icons for mobile home screen

As a user on mobile, I'd like to add the site to my home screen for quick access. Currently no icon for the site exists, so an "icon" is generated from the currently-displaying page when performing the save which doesn't look great. I would like to see a proper icon showing for the home screen bookmark.

Options for date format

Date format when adding a fillup/expense is mm/dd/yyyy

Request for option to change site wide default to dd/mm/yyyy

Little Typo

Shreenshots.md should be Screenshots.md, little typo :-)

Feature Request: keep photo displayed when creating a fill-up from quick entry

Hello,
Nice app there, congrats and thanks.
I really like the idea of quick item to be processed later, only I think that keeping the picture viewable when creating the fill-up or expense entry would make sense as there can be a few too many fields in the form to remember all of them at once...
But I get that it's probably not as easy as it sounds, I really know nothing of vue.js ...
So that feels more like a nice to have, probably not on top of the priority list and rightly so ;)

Transfer vehicle ownership to other users

Feature request! I'd like to be able to transfer a vehicle to another user - I know it's effectively the same as sharing, but in case one user decides to stop using Hammond, their account could be removed (another feature request) but the data they entered will persist.

"runtime error: invalid memory address or nil pointer dereference" after moving files

Please complete the following information

  • Installation Type: native
  • Have you tried using the latest docker image / code base: yes

Describe the bug
Hi, I am trying to package hammond for the AUR, but I am unable to make it work after splitting files in various paths:

  • /etc/hammond.conf as environmental file
  • /usr/bin/hammond as main executable
  • /usr/share/hammond/ as static assets location
  • /var/lib/hammond/ as the only writable location (e.g. database file)

I start hammond as a service with the following environmental variables:

CONFIG=/var/lib/hammond
DATA=/usr/share/hammond
PORT=3000
JWT_SECRET="XXXXXX"

When I visit http://127.0.0.1:3000 I get the following service error:

hammond[163941]: [GIN-debug] Listening and serving HTTP on :3000
hammond[163941]: 2021/06/05 19:26:40 Config Dir:  /usr/share/hammond
hammond[163941]: 2021/06/05 19:26:40 Assets Dir:  /var/lib/hammond
hammond[163941]: 2021/06/05 19:26:50 [Recovery] 2021/06/05 - 19:26:50 panic recovered:
hammond[163941]: GET / HTTP/1.1                                                                            
hammond[163941]: Host: 127.0.0.1:3000                                                                      
hammond[163941]: Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8        
hammond[163941]: Accept-Encoding: gzip, deflate                                                            
hammond[163941]: Accept-Language: en-US,en;q=0.5                                                           
hammond[163941]: Connection: keep-alive                                                                    
hammond[163941]: Cookie: session_id=a7de39dc9fbf6dd819b4382adc29dec7bc2af2c8                               
hammond[163941]: Dnt: 1                                                                                    
hammond[163941]: Upgrade-Insecure-Requests: 1                                                              
hammond[163941]: User-Agent: Mozilla/5.0 (Windows NT 10.0; rv:78.0) Gecko/20100101 Firefox/78.0            
hammond[163941]:                                                                                           
hammond[163941]: runtime error: invalid memory address or nil pointer dereference                          
hammond[163941]: /usr/lib/go/src/runtime/panic.go:212 (0x43ca7a)                                           
hammond[163941]:        panicmem: panic(memoryError)                                                       
hammond[163941]: /usr/lib/go/src/runtime/signal_unix.go:734 (0x455432)
hammond[163941]:        sigpanic: panicmem()
hammond[163941]: /home/jack/go/pkg/mod/gorm.io/[email protected]/gorm.go:340 (0x766886)
hammond[163941]: /home/jack/go/pkg/mod/gorm.io/[email protected]/chainable_api.go:224 (0x75dd6e)
hammond[163941]: /home/jack/go/pkg/mod/gorm.io/[email protected]/finisher_api.go:117 (0x75f2c8)
hammond[163941]: /tmp/makepkg/hammond-git/src/hammond/server/db/dbfunctions.go:257 (0x7f98cc)
hammond[163941]:        GetOrCreateSetting: result := DB.First(&setting)
hammond[163941]: /tmp/makepkg/hammond-git/src/hammond/server/main.go:62 (0x9d9dc5)
hammond[163941]:        setupSettings.func1: setting := db.GetOrCreateSetting()
hammond[163941]: /home/jack/go/pkg/mod/github.com/gin-gonic/[email protected]/context.go:165 (0x9b2839)
hammond[163941]: /home/jack/go/pkg/mod/github.com/gin-gonic/[email protected]/recovery.go:99 (0x9b2820)
hammond[163941]: /home/jack/go/pkg/mod/github.com/gin-gonic/[email protected]/context.go:165 (0x9b1913)
hammond[163941]: /home/jack/go/pkg/mod/github.com/gin-gonic/[email protected]/logger.go:241 (0x9b18d2)
hammond[163941]: /home/jack/go/pkg/mod/github.com/gin-gonic/[email protected]/context.go:165 (0x9a85c8)
hammond[163941]: /home/jack/go/pkg/mod/github.com/gin-gonic/[email protected]/gin.go:525 (0x9a85af)
hammond[163941]: /home/jack/go/pkg/mod/github.com/gin-gonic/[email protected]/gin.go:518 (0x9a82e6)
hammond[163941]: /home/jack/go/pkg/mod/github.com/gin-gonic/[email protected]/gin.go:445 (0x9a7b9b)
hammond[163941]: /usr/lib/go/src/net/http/server.go:2887 (0x6b6be2)
hammond[163941]:        serverHandler.ServeHTTP: handler.ServeHTTP(rw, req)
hammond[163941]: /usr/lib/go/src/net/http/server.go:1952 (0x6b200c)
hammond[163941]:        (*conn).serve: serverHandler{c.server}.ServeHTTP(w, w.req)
hammond[163941]: /usr/lib/go/src/runtime/asm_amd64.s:1371 (0x474d60)
hammond[163941]:        goexit: BYTE    $0x90   // NOP
hammond[163941]:
hammond[163941]: [GIN] 2021/06/05 - 19:26:50 | 500 |    3.923481ms |       127.0.0.1 | GET      "/"

The browser of course gets an empty page and a 500 error.

To Reproduce
I have built the program in the /tmp/makepkg/hammond-git/src/ folder following the source installation steps. If I launch the hammond executable as soon as it is built, without moving it (/tmp/makepkg/hammond-git/src/hammond/server/dist/hammond instead of /usr/bin/hammond), I only get a 404 error when I access http://127.0.0.1:3000, which makes me think it can now find some program file/library that /usr/bin/hammond is missing.

Questions

  1. Why are you saying to run mv -v dist/* /usr/local/bin/hammond if there is only a single file under dist (at least, for me)?
  2. Any plan to make hammond statically linked? Otherwise, what else should I copy from the build directory apart from the files under server/dist/ and ui/dist/?
  3. Am I setting my CONFIG and DATA variables correctly? If not, what do you mean by these terms?
  4. Are there other variables to configure, like HOST?

Additional information
This would be the full file list of the package:

 /
├── etc
│   └── hammond.conf
├── usr
│   ├── bin
│   │   └── hammond
│   ├── lib
│   │   ├── systemd
│   │   │   └── system
│   │   │       └── hammond.service
│   │   ├── sysusers.d
│   │   │   └── hammond.conf
│   │   └── tmpfiles.d
│   │       └── hammond.conf
│   └── share
│       └── hammond
│           ├── css
│           │   ├── app.f7de76d5.css
│           │   ├── app.f7de76d5.css.map
│            |   [...]  
│           │   ├── chunk-vendors.4bd0e6af.css
│           │   └── chunk-vendors.4bd0e6af.css.map
│           ├── hammond.png
│           ├── index.html
│           └── js
│               ├── app-legacy.f1603146.js
│               ├── app-legacy.f1603146.js.map
│              [...]  
│               ├── chunk-vendors.06a1605f.js
│               └── chunk-vendors.06a1605f.js.map
└── var
    └── lib
        └── hammond

15 directories, 79 files

Additional field

Im looking to use this for my tractors and mowers on the farm. Can you add hours for a vehicle and sn/vin? Most maintenance schedules are based on hours for farm stuff

Docker Image not showing Web UI

Before creating a bug report please make sure you are using the latest docker image / code base.

Please complete the following information

  • Installation Type: Docker
  • Have you tried using the latest docker image / code base: Yes

Bug Faced:
Deployed using docker-compose, but I am unable to reach the front end UI. Nothing in the logs either, except the following:

2021/05/31 06:41:13 /config/hammond.db
2021/05/31 06:41:13 Config Dir: /config
2021/05/31 06:41:13 Assets Dir: /assets

Expected behavior
Web UI should come up

Docker Compose Text:

    image: akhilrex/hammond
    container_name: hammond
    environment:
      - TZ=Asia/Kolkata
    volumes:
      - "/opt/Hammond/config:/config"
      - "/opt/Hammond/assets:/assets"
    ports:
      - 8991:8080
    restart: unless-stopped

feature request: maintenance tracking / reminders

sorry if this is the wrong place, just a suggested feature:

  • Maintenance reminders based on mileage / time passed
  • they update based on recorded maintenance

these two features are the only thing holding me and I suspect a lot of folks back from switching from acar/fuelly to self hosted setup like hammond

After importing form Clarkson, you cannot change imported accounts' passwords

Before creating a bug report please make sure you are using the latest docker image / code base.

Please complete the following information

  • Installation Type: [Docker/Native] Docker
  • Have you tried using the latest docker image / code base [yes/no] Yes

Describe the bug
After importing from Clarkson, attempting to change an imported account's password from the default ("hammond"), to anything else will result in Request failed with status code: 422

To Reproduce
Steps to reproduce the behavior:

  1. Import an account from Clarkson
  2. Log into the account with the default password: "hammond"
  3. Attempt to change the password

Expected behavior
The password is changed

Additional context
The web request error:
{"errors":{"OldPassword":"{min: 8}"}}

Fillups should be sorted on odometer reading

When entering multiple fillups on a single day, they appear to be sorted by on quantity and not odometer reading. As a result, the graph shows some negative MPG numbers for me.

Screen Shot 2021-11-15 at 1 53 29 AM

Screen Shot 2021-11-15 at 1 53 52 AM

Delete attachments

Would it be possible to have an option to delete an attachment after it's been uploaded? I've added the wrong file into Hammond and now I can't remove. Thanks.

Delete Quick Entry

It would be nice to have the option to delete quick entries after processing them

Add Support to set Container's Timezone

It would be nice to be able to use an environment variable (such as TZ) to set the container's timezone. This would allow the logs to be displayed in the user's local timezone, instead of in UTC.

Translations

Do you have any plans to support other languages?

I'd be able to translate to Czech.

Allow commas as decimal separator

My country (Germany) uses commas instead of periods to separate decimal places. Especially for less tech savvy users in my household not being able to use their local number format creates a very demotivating barrier to use hammond ;)

Might be related to #19 ...?

Dark mode

I would like to request to add dark mode.

Calculated fuel consumption with graph

I would like to request ability to (you probably have this in "More reports" in roadmap, but maybe not):

  • calculate fuel consumption between fill ups
  • calculate average of fuel consumption from all fill ups (or some custom interval)
  • show a graph of the fuel consumption (also with ability to select custom interval)

Process 'quick entries' on behalf of other users

Hi!
I would like to be able to mark who had the expense when processing them from the quick entires menu.

My gf is interested in using the app as long as she can just upload the image. I'm willing to process all our entries, but I would rather not sign into her user when processing her expenses, but instead just mark the expense as belonging to her.

Design Request: Vehicle Buttons More Prominent

Currently you have to "click" twice to get to Details, Add Fillup, and Add Expense. Add Vehicle is one "click". Most people do the former more often than the latter.

Happy to work on moving things around if PRs welcome.

Cant Remove a Vehicle/Easy to Create Duplicates

Before creating a bug report please make sure you are using the latest docker image / code base.

Please complete the following information

  • Installation Type: [Docker]
  • Have you tried using the latest docker image / code base [yes]

Describe the bug
When one creates a new vehicle, it's possible to press the submit button twice, creating duplicate entries - there's no obvious way to delete it.
To Reproduce
Steps to reproduce the behavior:
Create vehicle
Click submit twice
Cant delete duplicate entry

Expected behavior
Clicking submit should immediately redirect/grey out button
Vehicles should be deleteable

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Add any other context about the problem here.

Feature Request: Mileage

Is there a way to add in the ability to not only just update the mileage of a specific vehicle, but could it also be part of the setup page for a new vehicle so different stats can be produced (mileage since added, mileage per month/averages, etc)

Thanks

[Feature Request] Additional Entry Types

I have planning on acquiring a new vehicle, however due to financial constraints, I would be availing a Bank Loan for this purpose.

I think it would be super neat if we could also save the following information in Hammond, so that all the car related information stays in a singular location:

  1. Finance Cost: Broken up into:
    (a) Principal Repayment
    (b) Interest Component

  2. Insurance Renewal: The ability to save the cost of insurance on the vehicle and upload the Policy Document for the same

Both of these can be manual entries by the user.

Feature Request: Export Service Logs

I would like to be able to export the history of service for my vehicle into a PDF with relevant photos of attached expenses.

Super helpful when selling a vehicle second hand and you want to provide an accurate history of service.

Love the app!

Doesn't work with reverse proxy and basic auth?

Docker install, works perfectly with direct IP-based access. But via caddy reverse proxy, with basic auth applied, attempting login doesn't work -- get a basic auth prompt (again?) after attempting to submit the password, and login fails (basic auth can't be satisfied -- not sure if it's Hammond or the proxy that is asking at this point). Seems like something is confused...

Free maintenance intervention

I have entered an intervention in the garage under warranty (therefore free of charge) only for the purpose of having a trace.

The application does not allow you to enter an expense with an amount equal to 0 (error 422).

How to solve?

Deleting Fillups

I managed to process a quick entry twice and now have a duplicate entry in my table. It would be awesome if there was a way to delete entries that may have been made by mistake.

Default Currency at initialization doesn't save

Before creating a bug report please make sure you are using the latest docker image / code base.

Please complete the following information

  • Installation Type: Docker
  • Have you tried using the latest docker image / code base - yes

Describe the bug
During the initial account creation steps, the website asks for a default currency and distance measurement. I select USD and Miles. After logging in, the currency is set to "INR" and the distance is set to "Km". Even after going to Admin -> Site Settings, and updating the default currency/distance there, INR/Km is still the site default.

If the User Currency/Distance settings are changed, then the website displays information correctly.

Expected behavior
Setting site wide defaults should be saved.

Additional context
Add any other context about the problem here.

MPG calculation.

I thought I saw this somewhere in the future plans but I am no longer seeing it, Clarkson had a mpg calculator that would tell you your MPG per fill-up. Is this something you could work into this?

Average Fuel Usage Not Calculated on Partial Fillups

I’ve recently noticed that my Stats section is not populating MPG statistics. In referencing my refueling, I noticed I’m only seeing stats for full tank fill-ups. The rest of my stats are flatlined at 0.

Would it be possible to change the MPG calculation to base off of total distance travelled between refuels (using the odometer difference as a distance value) so I can still see my mpg over time, even when not filling my car up fully every time?

Support disabling user authentication

I run all of my self-hosted containers behind a reverse proxy with my own authentication. It becomes extra steps if I have to log in through my OAUTH as well as the Hammond authentication.

Cool project, can't wait to see where it goes!

Weekdays incorrect on calendar

Please complete the following information

  • Installation Type: [Docker]
  • Have you tried using the latest docker image / code base [yes]

Describe the bug
On the calendar, the weekdays are offset by a day. 31 May is a Monday, not a Sunday as per screenshot:

Screenshots
image

Feature Request: reset user password

I'm rather stumped right now. I have no idea what password I used to create my account.

How would I currently go about and reset the password?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.