Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
115 commits
Select commit Hold shift + click to select a range
4484083
Initial commit from Create Next App
BadPirate Aug 29, 2020
17682b7
Next JS
BadPirate Aug 29, 2020
466ff48
eslint / typescript
BadPirate Aug 29, 2020
939ccc1
bootstrap
BadPirate Aug 29, 2020
cbd8a57
nexstrap only
BadPirate Aug 29, 2020
419562c
reamde
BadPirate Aug 29, 2020
2925bb4
Merge pull request #5 from BadPirate/nextstrap
BadPirate Aug 29, 2020
35b1b98
Peer deps
BadPirate Sep 4, 2020
ee37bc7
dependencies fixed
BadPirate Sep 6, 2020
a0ec047
deps
BadPirate Sep 15, 2020
8a39f46
Update for 2021
BadPirate Nov 25, 2021
46145ea
Generic naming using env
BadPirate Nov 25, 2021
a743966
linky
BadPirate Nov 25, 2021
a1ca996
Update packages
BadPirate Jan 23, 2022
885f870
Bump minimist from 1.2.5 to 1.2.6
dependabot[bot] Mar 24, 2022
3ac9550
Upgrade all dependencies to latest
BadPirate Aug 16, 2022
ea10b5a
Merge pull request #18 from BadPirate/dependabot/npm_and_yarn/minimis…
BadPirate Nov 12, 2022
e36b572
Bump minimatch from 3.0.4 to 3.1.2
dependabot[bot] Nov 12, 2022
b3ec4aa
Merge pull request #19 from BadPirate/dependabot/npm_and_yarn/minimat…
BadPirate Nov 12, 2022
e0b9b73
Welcome to 2025! (Though you may just want to go back into a coma)
BadPirate Jan 31, 2025
4c02595
Back into a coma (but no yarn install warnings)
BadPirate Jan 31, 2025
de58945
Use date as version
BadPirate Jan 31, 2025
594e3ba
Getting out of my element
BadPirate Jan 31, 2025
dcc13f9
Fix eslint
BadPirate Mar 28, 2025
9c1e728
Card and Page abstraction
BadPirate Mar 28, 2025
930b717
GarageAuth templates
BadPirate Mar 29, 2025
66a556e
Adding Codex & Playwright
BadPirate Apr 18, 2025
70897b9
Codex / Documentation
BadPirate Apr 18, 2025
6d17847
Merge nextstrap/main into nextstrap/garage_auth: resolve conflicts
BadPirate Apr 18, 2025
27ba987
Upgrades
BadPirate Apr 18, 2025
0aab159
scripts: bind dev server to localhost to avoid EPERM
BadPirate Apr 18, 2025
e8726c2
Get tests working
BadPirate Apr 18, 2025
5f6bbbd
tests: add login/logout UI tests
BadPirate Apr 18, 2025
ec11dcb
Nits
BadPirate Apr 18, 2025
8b728a9
fix(tests): install Playwright browsers and correct session mocks in …
Apr 21, 2025
c088bb7
Auto-login
Apr 21, 2025
5901d01
Documentation
BadPirate Apr 22, 2025
cb37ae2
Re-style Homepage - part 1
BadPirate Apr 22, 2025
a4d9c12
Codex mess
Apr 23, 2025
12f334d
Checkpoint before assistant change: Configure the development environ…
Apr 23, 2025
3f09b2d
Assistant checkpoint: Update test script with explicit environment va…
Apr 23, 2025
2279d70
Checkpoint before assistant change: Enable Docker support for improve…
Apr 23, 2025
a41a167
Checkpoint before assistant change: Add testing functionality to the …
Apr 23, 2025
9e76184
Assistant checkpoint: Simplify test setup to remove Docker dependency
Apr 23, 2025
d8f1062
Checkpoint before assistant change: Enable the test suite and configu…
Apr 23, 2025
2902d03
Checkpoint before assistant change: Add browser testing tools so the …
Apr 23, 2025
2746def
Assistant checkpoint: Migrate from Playwright to Jest + RTL
Apr 23, 2025
da2fe3a
Checkpoint before assistant change: Configure app to automatically st…
Apr 23, 2025
28b4157
Checkpoint before assistant change: Migrate testing framework to Jest…
Apr 23, 2025
38d062e
Checkpoint before assistant change: Add tests to ensure key website f…
Apr 23, 2025
a7b788a
Assistant checkpoint: Fix invalid HTML nesting in WelcomeCard
Apr 23, 2025
5297516
Checkpoint before assistant change: Remove unit tests workflow, as it…
Apr 23, 2025
e75b341
Checkpoint before assistant change: Change default run button to run …
Apr 23, 2025
ad4ca98
Assistant checkpoint: Fix test setup with proper imports and providers
Apr 23, 2025
3e1839c
Assistant checkpoint: Fix auth test to match actual component behavior
Apr 23, 2025
ec8e0db
Checkpoint before assistant change: Improve code quality with automat…
Apr 23, 2025
6545d8f
Assistant checkpoint: Fix HTML nesting and lint issues in WelcomeCard
Apr 23, 2025
a3c09c7
Assistant checkpoint: Added .babelrc with modern JSX transform config
Apr 23, 2025
c68a816
Assistant checkpoint: Update Jest config for modern JSX transform
Apr 23, 2025
f5d0422
Assistant checkpoint: Update TypeScript JSX transform configuration
Apr 23, 2025
42b05a4
Assistant checkpoint: Added test:coverage script to package.json
Apr 23, 2025
85023cf
Checkpoint before assistant change: Add workflow to ensure all new co…
Apr 23, 2025
3cc7ea8
Assistant checkpoint: Add comprehensive tests for full coverage
Apr 23, 2025
a24fc6b
Assistant checkpoint: Fix nested test structure in auth.test.tsx
Apr 23, 2025
d13617d
Checkpoint before assistant change: Change the default workflow to de…
Apr 23, 2025
e1c3d0f
Merge pull request #22 from BadPirate/postgres
BadPirate Apr 23, 2025
c1fca7d
Assistant checkpoint: Remove unused files and update documentation
BadPirate Apr 23, 2025
d5e897b
Checkpoint before assistant change: Set up project to use a standard …
Apr 23, 2025
837948d
Assistant checkpoint: Update database connection and add local dev setup
BadPirate Apr 23, 2025
ce61467
Checkpoint before assistant change: Configure the development environ…
Apr 23, 2025
a1d1f4e
Assistant checkpoint: Convert PostgreSQL setup to SQLite
BadPirate Apr 23, 2025
f6e18d1
Checkpoint before assistant change: Update database configuration to …
Apr 23, 2025
645dc8a
Assistant checkpoint: Add DB error handling and gitignore entry
BadPirate Apr 23, 2025
53e8065
Assistant checkpoint: Added dotenv support for database configuration
BadPirate Apr 23, 2025
a669d05
Assistant checkpoint: Add SQLite fallback when DATABASE_URL is not set
BadPirate Apr 23, 2025
cb58b74
Assistant checkpoint: Update db:up script to clean existing database
BadPirate Apr 23, 2025
84a8cf9
Assistant checkpoint: Fix login/create redirects to properly handle a…
BadPirate Apr 23, 2025
5be3420
Assistant checkpoint: Fix database connection string
BadPirate Apr 23, 2025
244c937
Assistant checkpoint: Add SQLite support to database client
BadPirate Apr 23, 2025
047d7d2
Assistant checkpoint: Update remaining SQL queries for SQLite compati…
BadPirate Apr 23, 2025
91a45ea
Assistant checkpoint: Fix button prop and SQLite connection string
BadPirate Apr 23, 2025
dab10f6
Assistant checkpoint: Fix Bootstrap block prop and SQLite query syntax
BadPirate Apr 23, 2025
0a21f90
Checkpoint before assistant change: Fix error that occurs when updati…
Apr 23, 2025
eedf915
Assistant checkpoint: Update SQL parameter syntax for SQLite compatib…
BadPirate Apr 23, 2025
141855d
Assistant checkpoint: Update SQL queries for SQLite compatibility
BadPirate Apr 23, 2025
081e61e
Checkpoint before assistant change: Fix error that prevents users fro…
Apr 23, 2025
6f8dc9b
Assistant checkpoint: Fix SQLite query and column aliases
BadPirate Apr 23, 2025
9e006fc
Checkpoint before assistant change: Update the database to reflect ch…
Apr 23, 2025
573e98e
Assistant checkpoint: Fix multiple response issue in create endpoint
BadPirate Apr 23, 2025
ae7a488
Assistant checkpoint: Fix React key warning and hydration error
BadPirate Apr 23, 2025
48e1145
Checkpoint before assistant change: Add documentation explaining how …
Apr 23, 2025
57b8914
Assistant checkpoint: Fix HTML nesting to resolve hydration error
BadPirate Apr 23, 2025
c34eebb
Assistant checkpoint: Fix Card.Text hydration issues by removing inva…
BadPirate Apr 23, 2025
93fc93b
Assistant checkpoint: Add error boundary for better client-side error…
BadPirate Apr 23, 2025
dc13bc4
Assistant checkpoint: Fix HTML nesting issues in manage page
BadPirate Apr 23, 2025
40807ac
Checkpoint before assistant change: Correct date and time display iss…
Apr 23, 2025
8aecc06
Assistant checkpoint: Fix date formatting to prevent timezone mismatches
BadPirate Apr 23, 2025
a5bfca5
Assistant checkpoint: Fix date rendering to match server and client
BadPirate Apr 23, 2025
c3bcb26
Checkpoint before assistant change: Prevent loading errors when user …
Apr 23, 2025
e759f9f
Assistant checkpoint: Fix account serialization when not found
BadPirate Apr 23, 2025
c230283
Checkpoint before assistant change: Fix website error when account in…
Apr 23, 2025
6a023bc
Assistant checkpoint: Add null check for account in View component
BadPirate Apr 23, 2025
26d6e6d
Assistant checkpoint: Fix SQL parameter style in account lookup
BadPirate Apr 23, 2025
db1a408
Assistant checkpoint: Update SQL queries for PostgreSQL compatibility
BadPirate Apr 23, 2025
987fa11
Assistant checkpoint: Fix error handling in getTransactions
BadPirate Apr 23, 2025
3a6f75f
Assistant checkpoint: Fix database queries and error handling
BadPirate Apr 23, 2025
0c201b7
Assistant checkpoint: Fix transaction query syntax
BadPirate Apr 23, 2025
0b9147e
Assistant checkpoint: Fix transaction queries for SQLite and PostgreSQL
BadPirate Apr 23, 2025
64c3e18
Merge remote-tracking branch 'nextstrap/garage_auth' into replit2
oai-codex Apr 23, 2025
53069a7
Typescript and Eslint and Prettier
oai-codex Apr 23, 2025
6cdfb7e
feat: Migrate database layer to Prisma ORM
oai-codex Apr 23, 2025
84d7ba8
Surely I jest
oai-codex Apr 23, 2025
ab1aa54
Use database, and test database flows
oai-codex Apr 23, 2025
c3e9886
CI
oai-codex Apr 24, 2025
0dced68
Copilot fixes
oai-codex Apr 24, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .env.local.EXAMPLE
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@

# Local development database URL
DATABASE_URL=file:./dev.db
12 changes: 12 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
node_modules/
.next/
funey.db
schema.dump
schema.sqlite.sql
scripts/
public/
attached_assets/
__tests__/
**/.eslintrc.js
jest.config.js
jest.setup.js
93 changes: 93 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
module.exports = {
parser: '@typescript-eslint/parser',
parserOptions: {
project: './tsconfig.json',
tsconfigRootDir: __dirname,
ecmaVersion: 2020,
sourceType: 'module',
ecmaFeatures: {
jsx: true,
},
},
plugins: ['@typescript-eslint', 'react', 'import'],
extends: [
'next/core-web-vitals',
'plugin:react/recommended',
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended',
],
env: {
browser: true,
es6: true,
node: true,
},
settings: {
'import/resolver': {
node: {
extensions: ['.js', '.jsx', '.ts', '.tsx'],
moduleDirectory: ['node_modules', 'src/'],
},
},
},
rules: {
semi: ['error', 'never'],
indent: ['error', 2],
'no-undef': 'off',
'react/jsx-filename-extension': [2, { extensions: ['.js', '.jsx', '.ts', '.tsx'] }],
'react/function-component-definition': [
2,
{ namedComponents: 'arrow-function', unnamedComponents: 'arrow-function' },
],
'react/react-in-jsx-scope': 'off',
'import/extensions': [
'error',
'always',
{ js: 'never', jsx: 'never', ts: 'never', tsx: 'never' },
],
'react/jsx-props-no-spreading': 'off',
'react/jsx-one-expression-per-line': 'off',
'import/no-cycle': 'off',
'import/named': 'off',
'import/no-unresolved': 'off',
'import/no-named-as-default': 'off',
'import/no-named-as-default-member': 'off',
},
overrides: [
{
files: ['**/*.ts', '**/*.tsx'],
rules: {
'react/prop-types': 'off',
'import/order': 'off',
// TypeScript files: relax stylistic rules; Prettier handles formatting
semi: 'off',
'@typescript-eslint/semi': 'off',
quotes: 'off',
'@typescript-eslint/quotes': 'off',
indent: 'off',
'@typescript-eslint/indent': 'off',
'comma-dangle': 'off',
'@typescript-eslint/comma-dangle': 'off',
'object-curly-newline': 'off',
'@typescript-eslint/object-curly-spacing': 'off',
'object-curly-spacing': 'off',
'function-paren-newline': 'off',
'@typescript-eslint/return-await': 'off',
'no-return-await': 'off',
'eol-last': 'off',
camelcase: 'off',
'no-param-reassign': 'off',
'no-console': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': 'off',
'no-multiple-empty-lines': 'off',
'max-len': 'off',
'react/jsx-wrap-multilines': 'off',
'react/jsx-indent': 'off',
'react/jsx-closing-tag-location': 'off',
'react/jsx-indent-props': 'off',
'no-useless-escape': 'off',
},
},
],
}
47 changes: 47 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Node.js CI

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
build_and_test:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [18.x, 20.x] # Test against relevant Node.js versions

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn' # Cache yarn dependencies

- name: Install dependencies
run: yarn install --frozen-lockfile

- name: Run linters
run: yarn lint # Ensure code style and quality

# Prisma schemas should be generated during the build or test setup if needed
# The setup-test-db.js script checks for generated schemas
# Ensure build:prisma-schemas is run if schemas aren't checked in
# - name: Build Prisma Schemas if necessary
# run: yarn build:prisma-schemas

- name: Build project
run: yarn build

- name: Run tests
run: yarn test
env:
# DATABASE_URL is set by the jest globalSetup script (setup-test-db.js)
# Add any other necessary env vars here if required by tests
CI: true # Often useful to indicate running in a CI environment
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@

.db/
logfile
.env.local
funey.db

# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
Expand Down Expand Up @@ -32,3 +38,4 @@ yarn-error.log*

# vercel
.vercel
dev.db
28 changes: 28 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/usr/bin/env sh

# Load NVM to ensure correct Node version and PATH
export NVM_DIR="$HOME/.nvm"
if [ -s "$NVM_DIR/nvm.sh" ]; then
. "$NVM_DIR/nvm.sh" # Source NVM script if it exists
# Optionally, add nvm use command here if you need a specific version
# nvm use
elif [ -x "$(command -v brew)" ] && [ -s "$(brew --prefix nvm)/nvm.sh" ]; then
. "$(brew --prefix nvm)/nvm.sh" # Source NVM script if installed via Homebrew
fi

# Check if nvm command is available after sourcing
if command -v nvm &> /dev/null; then
# Attempt to set the correct node version path if NVM is active
CURRENT_NODE_VERSION=$(nvm current)
NVM_NODE_PATH=$(nvm_find_nvmrc | xargs nvm_version_path 2>/dev/null || nvm_version_path "$CURRENT_NODE_VERSION" 2>/dev/null)

if [ -n "$NVM_NODE_PATH" ]; then
export PATH="$NVM_NODE_PATH/bin:$PATH"
fi
else
echo "Warning: NVM script not found or NVM command not available. Falling back to system PATH."
# Fallback: Add local node_modules/.bin just in case NVM isn't used or fails
export PATH="$(cd "$(dirname "$0")/.." && pwd)/node_modules/.bin:$PATH"
fi

npx lint-staged
12 changes: 12 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
node_modules/
.next/
funey.db
schema.dump
schema.sqlite.sql
scripts/
public/
attached_assets/
__tests__/
**/*.min.js
*.lock
yarn.lock
7 changes: 7 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"semi": false,
"singleQuote": true,
"trailingComma": "all",
"printWidth": 100,
"endOfLine": "lf"
}
20 changes: 20 additions & 0 deletions .replit
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
modules = ["nodejs-20"]
[workflows]
runButton = "Development"

[[workflows.workflow]]
name = "Development"
author = 41832294
mode = "sequential"

[[workflows.workflow.tasks]]
task = "shell.exec"
args = "yarn dev"

[[ports]]
localPort = 3000
externalPort = 80

[nix]
packages = ["postgresql", "sqlite"]
channel = "stable-24_05"
96 changes: 52 additions & 44 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,72 +4,80 @@ Thank you for your interest in contributing to Funey!

## Getting Started

1. Fork the repository and clone your fork:
1. Fork and clone the repository:
```bash
git clone git@github.com:<your-username>/funey.git
git clone https://github.com/<your-username>/funey.git
cd funey
```
2. Install dependencies:
```bash
yarn install
```
3. Set up the database:
- Create a new Postgres database.
- Load the schema:
```bash
psql <dbname> < schema.dump
```
4. Create a `.env.local` file in the project root and define your database connection:
3. Configure environment:
1. Copy the example env file and edit:
```bash
cp .env.local.EXAMPLE .env.local
```
2. In `.env.local`, set `DATABASE_URL`:
- For local SQLite development:
```ini
DATABASE_URL=file:./dev.db
```
- For PostgreSQL development:
```ini
DATABASE_URL=postgresql://user:pass@localhost:5432/funey
```
4. Initialize the database:
```bash
PGHOST=localhost
PGPORT=5432
PGPASS=<your_password>
DB=<your_database_name>
yarn build:prisma-schemas
yarn db:clean
```
5. Start the development server:
5. Start development server:
```bash
yarn dev
```

Open http://localhost:3000 in your browser to verify everything is working.
## Code Style and Quality

## Code Style
- Indentation: 4 spaces
- Strings: double quotes
- Semicolons: follow existing style
- Use functional React components
- Organize pages under `/pages`
- Keep shared components/utilities in `/src`
- Update `schema.dump` after DB changes

- Indentation: 2 spaces
- Strings: single quotes in JS; double quotes in JSX attributes
- No semicolons at the end of statements
- Functional React components and Next.js conventions
- Organize pages under `/pages`; shared components or utilities under `/src`
- After any DB schema change, regenerate `schema.dump`
**Automated Checks:**

This project uses `eslint` and `prettier` for code linting and formatting. These checks are automatically run on staged files before each commit using `husky` and `lint-staged`.

- Ensure your code passes `yarn lint` before pushing.
- Commits may be blocked if linting or formatting errors are found.

## Commit Messages

Follow [Conventional Commits](https://www.conventionalcommits.org/):
- `feat(scope): description` – a new feature
- `fix(scope): description` – a bug fix
- `docs(scope): description` – documentation only changes
- `style(scope): description` – formatting, missing semicolons, etc
- `refactor(scope): description` – code change that neither fixes a bug nor adds a feature
- `test(scope): description` – adding or updating tests
- `chore(scope): description` – changes to build process or auxiliary tools

## Pull Requests

- Base your PR against the `main` branch
- Include a clear description of your changes
- Link to any relevant issues
- Add screenshots or GIFs for UI changes
- `feat:` new feature
- `fix:` bug fix
- `docs:` documentation changes
- `style:` formatting changes
- `refactor:` code restructuring
- `test:` adding/updating tests
- `chore:` build process changes

## Issues
## Pull Requests

Please use GitHub Issues to report bugs or suggest features.
- Base against `main` branch
- Include clear description
- Link relevant issues
- Add screenshots for UI changes

## Testing

- There are currently no automated tests.
- Manually verify your changes by running `yarn dev` and checking the app.

## Linting

- You can run `npx next lint` to check for lint errors.
(Add an ESLint config if needed.)
- Manually verify changes with `yarn dev`
- Run unit tests locally:
```bash
yarn test
```
- **Automated CI:** All pull requests and pushes to `main` automatically trigger a GitHub Actions workflow. This workflow runs linters (`yarn lint`), builds the project (`yarn build`), and executes the test suite (`yarn test`) across multiple Node.js versions. Ensure these checks pass before merging.
Loading