aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2024-03-21Merge branch 'prod' into stagingstagingzberwaldt
2024-03-21fix bugs, redo layout, reorg.Zach Berwaldt
2024-03-18remove unnessary logs.Zach Berwaldt
2024-03-18clean up, add better error handlingZach Berwaldt
2024-03-18remove unnessary logs.Zach Berwaldt
2024-03-18clean up, add better error handlingZach Berwaldt
2024-03-17update documentationZach Berwaldt
2024-03-16Merge remote-tracking branch 'origin/staging' into stagingZach Berwaldt
2024-03-16write init script for database.Zach Berwaldt
2024-03-16clean up database scripts, start readmes.Zach Berwaldt
2024-03-16write init script for database.Zach Berwaldt
2024-03-16clean up database scripts, start readmes.Zach Berwaldt
2024-03-16Remove default usersZach Berwaldt
2024-03-16Remove default usersZach Berwaldt
2024-03-16remove unnessary logs. remove logger and recovery, default has theseZach Berwaldt
2024-03-16remove unnessary logs. remove logger and recovery, default has theseZach Berwaldt
2024-03-15Merge pull request #1 from zberwaldt/stagingzberwaldt
Staging to Prod
2024-03-15cleanupZach Berwaldt
2024-03-15add newline, clean up testZach Berwaldt
2024-03-15add env samples, move filesZach Berwaldt
2024-03-15Add routes for preference, clean up and add typesZach Berwaldt
2024-03-07feat: Update authentication route and add comments to exported membersZach Berwaldt
- The authentication route in the API has been updated to use a new router setup function. - Comments have been added to all exported members of the `auth.go` module in the internal controllers package.
2024-03-07Refactor router and middleware packagesZach Berwaldt
- Move middleware functions from `main.go` to `middleware.go` in the `middleware` package. - Update import statements in `main.go` and use the `router` package instead of the `controllers` package. ``` Refactor router and middleware packages Move middleware functions from `main.go` to `middleware.go` in the `middleware` package. Update import statements in `main.go` and use the `router` package instead of the `controllers` package. ```
2024-03-07chore: Update paths in test and database configurationZach Berwaldt
This commit updates the paths in the test suite and database configuration to reflect the new directory structure. In the `api/cmd/main_test.go` file, the path for the config file is changed from `viper.SetConfigName(".env")` to `viper.SetConfigFile("../.env")` and `viper.AddConfigPath(".")` is added for configuration purposes. Additionally, `viper.AutomaticEnv()` is added to enable automatic environment variable configuration. In the same file, error handling is improved by adding explicit checks and error messages. The `api/internal/database/database.go` file is also modified, updating the path for database initialization from `"../db/water.sqlite3"` to `"../../db/water.sqlite3"`. These changes ensure proper configuration and functioning of the application.
2024-03-07Add CORS middleware and authentication middleware to the API server.Zach Berwaldt
The `setupRouter` function in `main.go` now includes a CORS middleware and a token authentication middleware. The CORS middleware allows cross-origin resource sharing by setting the appropriate response headers. The token authentication middleware checks for the presence of an `Authorization` header with a valid bearer token. If the token is missing or invalid, an unauthorized response is returned. In addition to these changes, a new test file `main_test.go` has been added to test the `/api/v1/auth` route. This test suite includes two test cases: one for successful authentication and one for failed authentication. Update go.mod to include new dependencies. The `go.mod` file has been modified to include two new dependencies: `github.com/spf13/viper` and `github.com/stretchr/testify`. Ignore go.sum changes. Ignore changes in the `go.sum` file, as they only include updates to existing dependencies.
2024-03-06[FEAT] Refactor API main file and modelsZach Berwaldt
This commit refactors the `main.go` file in the API directory, as well as the related models in the `models.go` file. The changes include: - Reordering imports and removing unnecessary imports - Fixing error messages to be more descriptive - Handling database connections more efficiently with deferred closures - Handling errors and returning appropriate error responses - Adding proper JSON bindings for POST requests - Adding new views in the database scripts for aggregated statistics and daily user statistics No changes were made to imports and requires.
2024-03-02feat: Add API loggingZach Berwaldt
Add logging to the API to keep track of specific requests and headers. Also added CORS middleware to handle OPTIONS requests. --- The commit adds logging functionality to the API and includes a middleware function to handle CORS OPTIONS requests. This will allow us to track specific requests and headers received by the API. [API/main.go](/api/main.go): - Added import for the 'log' package - Added logging statements to print the request headers and "_I am here_" message - Removed unnecessary newlines and comments [fe/src/app.css](/fe/src/app.css): - Added a new style for button hover effects [fe/src/lib/Card.svelte](/fe/src/lib/Card.svelte): - Added a new `height` prop to the Card component [fe/src/lib/Column.svelte](/fe/src/lib/Column.svelte): - Added a new CSS class for column layout - Set the width and gap using CSS variables [fe/src/lib/DataView.svelte](/fe/src/lib/DataView.svelte): - Updated the 'fetchData' function to also fetch 'totals' and 'userStats' data - Added canvas references and chart variables for bar and line charts - Added a new 'getLastSevenDays' function to calculate the labels for the charts - Updated the 'onMount' function to initialize the bar and line charts using the canvas references and data - Updated the 'onDestroy' function to destroy the bar and line charts - Added a new 'addFormOpen' store and imported it - Added a new 'onClick' handler for the Add button to open the AddForm modal - Updated the layout and added Card components to display the bar and line charts and the JSON data - Added a new 'fetchTotals' function to fetch data for the 'totals' section - Added a new 'fetchStatsForUser' function to fetch data for the 'userStats' section [fe/src/lib/Layout.svelte](/fe/src/lib/Layout.svelte): - Added a new 'preferenceFormOpen' variable and initialized it to 'false' - Added a new 'showPreferencesDialog' function to set 'preferenceFormOpen' to 'true' - Added a new 'closePreferenceDialog' function to set 'preferenceFormOpen' to 'false' - Added a new 'showAddDialog' function to open the AddForm modal
2024-03-01feat: Add last seven days labels to chartZach Berwaldt
In the `DataView.svelte` component, the last seven days are now included as labels in the chart. This allows users to easily visualize data for the past week. The `getLastSevenDays` function generates an array of string values representing the dates in ISO format. This array is assigned to the `lastSevenDays` variable, which is then used as the labels in the chart's dataset.
2024-03-01feat(DataView): Add functionality to add water statisticZach Berwaldt
This commit adds functionality to add water statistics to the DataView component. It includes the following changes: - Remove unused imports and variables - Move the 'handleClick' function logic to a new 'AddForm' component - Create the 'AddForm' component which displays a dialog with input fields for date and quantity and allows the user to add a new water statistic - Dispatch events on form submit and dialog close in the 'AddForm' component - Call the 'fetchData' function on successful submission of a new statistic - Update chart data to display sample data New component: - AddForm.svelte: A form component to add a new water statistic Note: This commit message exceeds the 50-character limit in the subject line, but adheres to the other specified requirements.
2024-03-01Add dependencies, refine dataviewZach Berwaldt
2024-03-01reformat feZach Berwaldt
2024-02-29modify api, build additional FE components, add typesDoog
2024-02-24add gitignoreDoog
2024-02-21first commitDoog
2024-02-21Initial commitDoog