Compare commits
1 Commits
case-insen
...
contributi
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
acba47fede |
26
README.md
26
README.md
@@ -35,6 +35,7 @@
|
|||||||
- [Built With](#built-with)
|
- [Built With](#built-with)
|
||||||
- [Features](#features)
|
- [Features](#features)
|
||||||
- [Installation](#installation)
|
- [Installation](#installation)
|
||||||
|
- [Contributing](#contributing)
|
||||||
- [License](#license)
|
- [License](#license)
|
||||||
- [Roadmap](#roadmap)
|
- [Roadmap](#roadmap)
|
||||||
- [Contact](#contact)
|
- [Contact](#contact)
|
||||||
@@ -157,6 +158,31 @@ Once done you will be taken to the login page.
|
|||||||
|
|
||||||
Go through the settings page once and change relevant settings before you start adding vehicles and expenses.
|
Go through the settings page once and change relevant settings before you start adding vehicles and expenses.
|
||||||
|
|
||||||
|
## Contributing
|
||||||
|
|
||||||
|
### Dev Setup
|
||||||
|
|
||||||
|
If you want to contribute to the project you need to set it up
|
||||||
|
for development first.
|
||||||
|
|
||||||
|
Fork and clone the project. Once you have it on your own machine,
|
||||||
|
open up a terminal and navigate to the `server/` directory.
|
||||||
|
|
||||||
|
In the `server/` directory run the command `go run main.go`.
|
||||||
|
After some initial
|
||||||
|
setup, the server should be listening on at port `3000`.
|
||||||
|
|
||||||
|
Next, open a new terminal. Navigate to the `ui/` directory and run `npm install`.
|
||||||
|
This will install all the dependencies for the frontend.
|
||||||
|
After the command is done running, run `npm run dev`. After some output, the
|
||||||
|
frontend should be accessible at `http://localhost:8080`.
|
||||||
|
|
||||||
|
If you are sent straight to the login screen, try closing the page and opening
|
||||||
|
it again. You should be greeted with a setup wizard the first time you run the
|
||||||
|
project.
|
||||||
|
|
||||||
|
Now, simply follow the instructions in order to set up your fresh install.
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
Distributed under the GPL-3.0 License. See `LICENSE` for more information.
|
Distributed under the GPL-3.0 License. See `LICENSE` for more information.
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
"strings"
|
|
||||||
|
|
||||||
"github.com/akhilrex/hammond/common"
|
"github.com/akhilrex/hammond/common"
|
||||||
"github.com/akhilrex/hammond/db"
|
"github.com/akhilrex/hammond/db"
|
||||||
@@ -92,7 +91,7 @@ func userLogin(c *gin.Context) {
|
|||||||
c.JSON(http.StatusUnprocessableEntity, common.NewValidatorError(err))
|
c.JSON(http.StatusUnprocessableEntity, common.NewValidatorError(err))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
user, err := db.FindOneUser(&db.User{Email: strings.ToLower(loginRequest.Email)})
|
user, err := db.FindOneUser(&db.User{Email: loginRequest.Email})
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
c.JSON(http.StatusForbidden, common.NewError("login", errors.New("Not Registered email or invalid password")))
|
c.JSON(http.StatusForbidden, common.NewError("login", errors.New("Not Registered email or invalid password")))
|
||||||
|
|||||||
@@ -18,10 +18,6 @@ var migrations = []localMigration{
|
|||||||
Name: "2021_06_24_04_42_SetUserDisabledFalse",
|
Name: "2021_06_24_04_42_SetUserDisabledFalse",
|
||||||
Query: "update users set is_disabled=0",
|
Query: "update users set is_disabled=0",
|
||||||
},
|
},
|
||||||
{
|
|
||||||
Name: "2021_02_07_00_09_LowerCaseEmails",
|
|
||||||
Query: "update users set email=lower(email)",
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func RunMigrations() {
|
func RunMigrations() {
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
package service
|
package service
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"strings"
|
|
||||||
|
|
||||||
"github.com/akhilrex/hammond/db"
|
"github.com/akhilrex/hammond/db"
|
||||||
"github.com/akhilrex/hammond/models"
|
"github.com/akhilrex/hammond/models"
|
||||||
)
|
)
|
||||||
@@ -10,7 +8,7 @@ import (
|
|||||||
func CreateUser(userModel *models.RegisterRequest, role db.Role) error {
|
func CreateUser(userModel *models.RegisterRequest, role db.Role) error {
|
||||||
setting := db.GetOrCreateSetting()
|
setting := db.GetOrCreateSetting()
|
||||||
toCreate := db.User{
|
toCreate := db.User{
|
||||||
Email: strings.ToLower(userModel.Email),
|
Email: userModel.Email,
|
||||||
Name: userModel.Name,
|
Name: userModel.Name,
|
||||||
Role: role,
|
Role: role,
|
||||||
Currency: setting.Currency,
|
Currency: setting.Currency,
|
||||||
|
|||||||
Reference in New Issue
Block a user