Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
56ba0b3
added theme service
NicolasConstant Apr 27, 2024
6c9f284
compiling colors
NicolasConstant Apr 27, 2024
ce6ed17
working theme
NicolasConstant Apr 27, 2024
11a3753
fix various colors
NicolasConstant Apr 27, 2024
10f8ee4
migrating global variables
NicolasConstant Apr 27, 2024
03b4370
save selected theme
NicolasConstant Apr 27, 2024
90187d8
refactoring
NicolasConstant Apr 27, 2024
b18e63e
init default theme
NicolasConstant Apr 27, 2024
b3c41ca
init light theme
NicolasConstant Apr 27, 2024
e6d77a9
migrating variables
NicolasConstant Apr 28, 2024
6536960
added colors, start lighting colors
NicolasConstant Apr 30, 2024
22f5abd
better borders
NicolasConstant Apr 30, 2024
14858cc
waiting icon + profile variables
NicolasConstant May 1, 2024
6026892
minor profile fixes
NicolasConstant May 1, 2024
9c654e1
refactoring colors
NicolasConstant May 7, 2024
14fd719
migrating polls + minor fixes
NicolasConstant Dec 2, 2024
30e81dc
minor color fixes
NicolasConstant Dec 3, 2024
7994569
set light theme labels
NicolasConstant Jan 7, 2025
1c0a980
set light column representation
NicolasConstant Jan 7, 2025
847bbec
set light cog icon
NicolasConstant Jan 7, 2025
2bcbeb6
fix light theme status creation
NicolasConstant Jan 7, 2025
462bd7e
fix light close button
NicolasConstant Jan 7, 2025
2f87e2e
added init agents
NicolasConstant Feb 12, 2026
e3abe03
extraction remaining variables
NicolasConstant Feb 12, 2026
71b2eeb
candid light theme update
NicolasConstant Feb 13, 2026
badfb9e
variables renaming
NicolasConstant Feb 13, 2026
ce3a1fe
fix background expander
NicolasConstant Feb 13, 2026
bc41971
variables renaming
NicolasConstant Feb 13, 2026
41b0ba6
light theme fine tunning
NicolasConstant Feb 13, 2026
d119352
variable renaming
NicolasConstant Feb 13, 2026
9e383ae
light theme fine tunning
NicolasConstant Feb 13, 2026
69715e5
variables renaming
NicolasConstant Feb 14, 2026
ffb9d41
Merge pull request #668 from NicolasConstant/topic_themes-agents
NicolasConstant Feb 14, 2026
523496d
Create node.js.yml
NicolasConstant Feb 15, 2026
dee10ad
Update node.js.yml
NicolasConstant Feb 15, 2026
7f35a71
Update node.js.yml
NicolasConstant Feb 15, 2026
65e2129
Update node.js.yml
NicolasConstant Feb 15, 2026
1c593b8
Update node.js.yml
NicolasConstant Feb 15, 2026
7f1704a
Update node.js.yml
NicolasConstant Feb 15, 2026
c7da222
Update node.js.yml
NicolasConstant Feb 15, 2026
cdd25a4
Create build-and-test.yaml
NicolasConstant Feb 15, 2026
5494712
Update and rename node.js.yml to deploy.yml
NicolasConstant Feb 15, 2026
212d3e1
Delete appveyor.yml
NicolasConstant Feb 15, 2026
e4f86ed
Merge pull request #670 from NicolasConstant/github-cicd-testing
NicolasConstant Feb 15, 2026
b8f88ab
Merge pull request #669 from NicolasConstant/topic_themes
NicolasConstant Feb 15, 2026
40de3b1
Create docker-image.yml
NicolasConstant Feb 16, 2026
c40bd3a
Update docker-image.yml
NicolasConstant Feb 16, 2026
13abcb4
Update docker-image.yml
NicolasConstant Feb 16, 2026
6277425
fix docker image
NicolasConstant Feb 16, 2026
e09b4f9
Merge pull request #671 from NicolasConstant/develop
NicolasConstant Feb 16, 2026
b42a21f
Update docker-image.yml
NicolasConstant Feb 16, 2026
172a8ea
Update and rename docker-image.yml to docker-image-develop.yml
NicolasConstant Feb 16, 2026
a863ebe
Create docker-image-stable.yaml
NicolasConstant Feb 16, 2026
cef18f0
Update docker-image-develop.yml
NicolasConstant Feb 16, 2026
388e945
clean up
NicolasConstant Feb 16, 2026
537fd5a
Merge pull request #672 from NicolasConstant/docker-cicd
NicolasConstant Feb 16, 2026
0e6f6b7
Update README.md
NicolasConstant Feb 16, 2026
52d40bf
fix arrows colors in themes
NicolasConstant Feb 17, 2026
5b5257e
avatar placeholder on failure, fix #653
NicolasConstant Feb 17, 2026
b25ec7a
fix scheduled icon color in light theme
NicolasConstant Feb 17, 2026
529b888
fix variable naming
NicolasConstant Feb 17, 2026
0f8e1bc
road to 1.8.0
NicolasConstant Feb 18, 2026
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: 1 addition & 2 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@
.travis.yml
appveyor.yml
.vscode
node_modules
dist
node_modules
29 changes: 29 additions & 0 deletions .github/workflows/build-and-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Build and Test

on:
push:
branches:
- '*'
pull_request:
branches:
- '*'
jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [10.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm ci
- run: npm run build
- run: npm test -- --watch=false --browsers=ChromeHeadless
40 changes: 40 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Deploy

on:
push:
branches: [master]

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [10.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm ci
- run: npm run build
- run: npm test -- --watch=false --browsers=ChromeHeadless

- name: Pre-publication clean-up
run: rm -rf ./dist/assets/emoji

- name: Web Deploy
uses: wlixcc/SFTP-Deploy-Action@v1.2.6
with:
server: ${{ secrets.ftpserver }}
username: ${{ secrets.ftpusername }}
password: ${{ secrets.ftppassword }}
local_path: './dist/*'
remote_path: './'
port: 22
sftp_only: true
46 changes: 46 additions & 0 deletions .github/workflows/docker-image-develop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Docker Image CI Develop

on:
workflow_dispatch:
push:
branches: [ "develop" ]

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [10.x]

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm ci
- run: npm run build

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to Docker Registry
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push Landing Page Docker image
uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile
push: true
tags: |
nicolasconstant/sengi:edge
52 changes: 52 additions & 0 deletions .github/workflows/docker-image-stable.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Docker Image CI Stable

on:
workflow_dispatch:
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+' # Push events to matching numeric semver tags, i.e., 1.0.0, 20.15.10

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [10.x]

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm ci
- run: npm run build

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to Docker Registry
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Get the tag name
id: get_version
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT

- name: Build and push Landing Page Docker image
uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile
push: true
tags: |
nicolasconstant/sengi:release-${{ steps.get_version.outputs.VERSION }}
nicolasconstant/sengi:latest
190 changes: 190 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,190 @@
# AGENTS.md - Sengi Development Guide

Sengi is a multi-account Mastodon/Pleroma desktop client built with Angular 7, TypeScript 3.2, and NGXS state management.

## Colors and Themes

When editing colors, use css variables following the current themes implementation.
The themes colors are stored in the *.ts files in the `/src/app/themes/implementations` folder, they MUST be updated accordingly.
And don't forget to update the `/src/sass/_variables.scss` file when doing so.

## Commands

```bash
# Development
npm start # Start dev server (ng serve)
npm run start-mem # Start with increased memory (4GB)

# Build
npm run build # Production build (ng build --prod)
npm run dist # Alias for build

# Testing
npm test # Run tests in watch mode (Karma + Jasmine)
npm run test-nowatch # Run tests once without watch
npm run e2e # Run end-to-end tests (Protractor)

# Linting
npm run lint # Run TSLint on all TypeScript files
```

### Running Single Tests

```bash
# Filter tests by pattern
npm test -- --include='**/mastodon.service.spec.ts'

# Run specific test file
npm test -- --include='**/services/tools.service.spec.ts'
```

## Code Style

### TypeScript/Angular Standards

- **Indentation**: 2 spaces (no tabs)
- **Quotes**: Single quotes for strings
- **Line length**: Maximum 140 characters
- **Semicolons**: Required at end of statements
- **Equality**: Use `===` and `!==` (triple equals), allow `== null` checks
- **Variable declarations**: Prefer `const`, never use `var`

### Naming Conventions

- **Components**: PascalCase with `Component` suffix (e.g., `UserProfileComponent`)
- **Services**: PascalCase with `Service` suffix (e.g., `MastodonService`)
- **Files**: kebab-case (e.g., `mastodon.service.ts`, `user-profile.component.ts`)
- **Interfaces**: PascalCase (e.g., `AccountInfo`, `StreamElement`)
- **Enums**: PascalCase with `Enum` suffix (e.g., `StreamTypeEnum`, `VisibilityEnum`)
- **Private members**: Use `readonly` for dependencies, may use underscore prefix sparingly
- **CSS selectors**: Components use `app-` prefix, kebab-case (e.g., `<app-user-profile>`)

### Imports

Order imports in this sequence:
1. Angular core modules
2. Third-party libraries (rxjs, @ngxs, @fortawesome)
3. Internal modules (absolute paths from `src/app`)

```typescript
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import { Store } from '@ngxs/store';

import { AccountInfo } from '../states/accounts.state';
import { MastodonService } from './mastodon.service';
```

### Component Structure

- Must implement lifecycle interfaces (`OnInit`, `OnDestroy`)
- Use `@Select()` decorator for NGXS state selections
- Mark injected services as `private readonly`
- Component selectors: element type, `app` prefix, kebab-case

```typescript
@Component({
selector: 'app-component-name',
templateUrl: './component-name.component.html',
styleUrls: ['./component-name.component.scss']
})
export class ComponentNameComponent implements OnInit, OnDestroy {
@Select(state => state.statemodel.property) property$: Observable<Type>;

constructor(private readonly service: SomeService) { }

ngOnInit(): void { }
ngOnDestroy(): void { }
}
```

### Service Structure

- Mark as `@Injectable()` or `@Injectable({ providedIn: 'root' })`
- Use constructor injection with `private readonly`
- Return Promises for async operations
- Handle errors with `.catch()` and propagate to notification service

```typescript
@Injectable({ providedIn: 'root' })
export class MyService {
constructor(private readonly httpClient: HttpClient) { }

fetchData(): Promise<Data> {
return this.httpClient.get<Data>(url).toPromise()
.catch(err => { /* handle */ });
}
}
```

### State Management (NGXS)

- Define actions as classes with `static readonly type`
- Use `State<Model>` decorator for state classes
- Implement actions with `@Action` decorator
- Use `patchState()` for immutable updates

```typescript
export class MyAction {
static readonly type = '[State] Action description';
constructor(public payload: Type) { }
}

@State<StateModel>({
name: 'statename',
defaults: { /* defaults */ }
})
export class MyState {
@Action(MyAction)
myAction(ctx: StateContext<StateModel>, action: MyAction) {
ctx.patchState({ /* updates */ });
}
}
```

### Error Handling

- Use `HttpErrorResponse` for HTTP errors
- Use `NotificationService.notifyHttpError()` for user-facing errors
- Use `NotificationService.notify()` for custom messages
- Prefer Promise-based error handling over try/catch in most cases

### Testing

- Test files: `*.spec.ts` alongside source files
- Use `TestBed.configureTestingModule()` for unit tests
- Skip incomplete tests with `xdescribe()` instead of deleting
- Structure: describe -> beforeEach -> it blocks

## Project Structure

```
src/app/
components/ # UI components
stream/ # Stream-related components
floating-column/ # Floating panel components
create-status/ # Status creation components
common/ # Shared components
services/ # Business logic and API calls
models/ # Service interfaces
states/ # NGXS state management
models/ # Application models
pipes/ # Custom pipes
tools/ # Utility functions
themes/ # Theme implementations
sass/ # Global SCSS styles
```

## Key Technologies

- **Angular 7** - Framework
- **TypeScript 3.2** - Language
- **NGXS** - State management
- **RxJS 6** - Reactive programming
- **Bootstrap 4** - CSS framework
- **FontAwesome 5** - Icons
- **Karma + Jasmine** - Testing

## License

AGPL-3.0-or-later
13 changes: 2 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,10 @@
FROM node:10-buster-slim AS build

WORKDIR /build
ADD . /build

RUN apt update && apt install --yes git binutils
RUN npm install
RUN npm run build

FROM alpine:latest

RUN apk add --update --no-cache lighttpd

ADD lighttpd.conf /etc/lighttpd/lighttpd.conf
COPY --from=build /build/dist /app
COPY --from=build /build/assets/docker_init /app/start
COPY /dist /app
COPY /assets/docker_init /app/start

EXPOSE 80

Expand Down
Loading