Skip to content
Draft
Show file tree
Hide file tree
Changes from all 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
11 changes: 11 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Required in production — generate with: openssl rand -hex 32
SESSION_SECRET=change_me_to_a_random_64_char_string_before_deploying

# Set to "true" if you terminate TLS in front of this app
SESSION_COOKIE_SECURE=false

# Path to the SQLite database file (created automatically)
DATABASE_PATH=/config/astrofit.db

# Port the server listens on
PORT=7090
23 changes: 23 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: CI

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

jobs:
verify:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- run: npm ci
- run: npm run lint
- run: npm run typecheck
- run: npm run build
env:
SESSION_SECRET: ci_build_placeholder_secret_at_least_32_chars_long
NEXT_TELEMETRY_DISABLED: "1"
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,7 @@ RUN chmod +x /usr/local/bin/docker-entrypoint.sh \

EXPOSE 7090

HEALTHCHECK --interval=30s --timeout=5s --start-period=20s --retries=3 \
CMD node -e "fetch('http://127.0.0.1:'+(process.env.PORT||'7090')+'/').then(r=>process.exit(r.status<500?0:1)).catch(()=>process.exit(1))"

ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]
17 changes: 17 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
services:
astrofit:
image: rayderc/astrofit:latest
container_name: astrofit
restart: always
ports:
- 7090:7090
environment:
- SESSION_COOKIE_SECURE=false
# Generate a strong secret: openssl rand -hex 32
- SESSION_SECRET=${SESSION_SECRET:-change_me_to_a_random_64_char_string}
- DATABASE_PATH=/config/astrofit.db
volumes:
- astrofit_data:/config

volumes:
astrofit_data:
28 changes: 28 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { defineConfig, globalIgnores } from "eslint/config";
import nextVitals from "eslint-config-next/core-web-vitals";
import nextTs from "eslint-config-next/typescript";

const eslintConfig = defineConfig([
...nextVitals,
...nextTs,
globalIgnores([
".next/**",
"out/**",
"build/**",
"next-env.d.ts",
]),
{
rules: {
// Pre-existing patterns — do not block CI
"react-hooks/set-state-in-effect": "off",
"react-hooks/purity": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-require-imports": "off",
"@typescript-eslint/no-unused-vars": "warn",
"@next/next/no-img-element": "warn",
"react-hooks/exhaustive-deps": "warn",
},
},
]);

export default eslintConfig;
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"dev": "next dev -p 7090",
"build": "next build",
"start": "next start -p 7090",
"lint": "next lint",
"lint": "eslint .",
"typecheck": "tsc --noEmit"
},
"dependencies": {
Expand Down
Loading