Skip to content
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
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
82 changes: 82 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: CI

on:
push:
branches:
# This is to make sure that there is no broken CI on
# the main branch, and also for Sonarqube integration
- main
# We need it for better Sonarqube integration
pull_request:
types: [opened, synchronize, reopened]

jobs:
test:
name: Run tests
runs-on: ubuntu-latest

# The maximum number of minutes to let a workflow run
# before GitHub automatically cancels it. Default: 360
timeout-minutes: 30

strategy:
# When set to true, GitHub cancels
# all in-progress jobs if any matrix job fails.
fail-fast: false

concurrency:
# Cancel any currently running job or workflow in the same concurrency group.
# The group is a unique identifier for the workflow run.
#
# Explanation:
# - github.workflow: The name of the workflow (e.g. Workflow 1).
# - github.event.pull_request.number: The number of the pull request (when the trigger event is a PR).
# - github.ref: The branch name (when the trigger is not a PR but a push).
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

steps:
- name: Checkout code
uses: actions/checkout@v5
Comment thread
sergeyklay marked this conversation as resolved.
Outdated
with:
fetch-depth: 0

- name: Set up Node.js
uses: actions/setup-node@v6
with:
node-version-file: '.nvmrc'
cache: npm

- name: Get npm cache directory
id: npm-cache-dir
shell: bash
run: echo "dir=$(npm config get cache)" >> ${GITHUB_OUTPUT}

- name: Setup npm cache
id: npm-cache
uses: actions/cache@v4
with:
path: ${{ steps.npm-cache-dir.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-

- name: Install Dependencies
# Disable cache for now to test the workflow.
# if: steps.npm-cache.outputs.cache-hit != 'true'
run: npm ci --include=dev
Comment thread
coderabbitai[bot] marked this conversation as resolved.

- name: Run unit tests
run: npm run test:coverage

- uses: codecov/codecov-action@v5
with:
fail_ci_if_error: true
flags: unittests
name: codecov-umbrella
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true

- name: Success Reporting
if: success()
run: git log --format=fuller -5
30 changes: 25 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,27 @@
.next
node_modules
# Please do not use this ignore file to define platform specific files.
#
# For these purposes create a global .gitignore file, which is a list of rules
# for ignoring files in every Git repository on your workstation.
#
# https://help.github.com/articles/ignoring-files/#create-a-global-gitignore

# Do not ignore .cursor commands and rules.
!/.cursor/rules/*.mdc
!/.cursor/commands/*.md

# Application and docker compose environment variables.
/.env

# Next.js output
/.next

# Node modules
/node_modules

# SQLite database files
data/*.db
data/*.db-wal
data/*.db-shm
/data/*.db
/data/*.db-wal
/data/*.db-shm

# Code coverage stuff.
/coverage
20 changes: 20 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
The MIT License (MIT)

Copyright (c) 2025 Serghei Iakovlev.

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

A sovereign, local-first bill management system built with Next.js 16, SQLite, and Drizzle ORM.

[![CI](https://github.com/sergeyklay/oar/actions/workflows/ci.yml/badge.svg)](https://github.com/sergeyklay/oar/actions/workflows/ci.yml)
![CodeRabbit Pull Request Reviews](https://img.shields.io/coderabbit/prs/github/sergeyklay/oar?labelColor=171717&color=FF570A&link=https%3A%2F%2Fcoderabbit.ai&label=CodeRabbit+Reviews)

## Getting Started

### Prerequisites
Expand Down
6 changes: 3 additions & 3 deletions jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ const createJestConfig = nextJest({

const config: Config = {
coverageProvider: 'v8',
testEnvironment: 'jsdom', // ВАЖНО: jsdom нужен для компонентов
testEnvironment: 'jsdom',
setupFilesAfterEnv: ['<rootDir>/jest.setup.ts'],
moduleNameMapper: {
'^@/(.*)$': '<rootDir>/$1', // Алиасы
'^@/(.*)$': '<rootDir>/$1',
},
// Очистка моков между тестами

clearMocks: true,
}

Expand Down
14 changes: 14 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,20 @@
"name": "oar",
"version": "0.1.0",
"private": true,
"description": "A sovereign, local-first bill management system built with Next.js 16, SQLite, and Drizzle ORM.",
"author": "Serghei Iakovlev",
"license": "MIT",
"homepage": "https://github.com/sergeyklay/oar",
"bugs": {
"url": "https://github.com/sergeyklay/oar/issues"
},
"repository": {
"type": "git",
"url": "git+https://github.com/sergeyklay/oar.git"
},
"keywords": [
"bill-management"
],
"scripts": {
"dev": "next dev",
"build": "next build",
Expand Down