Skip to content

Commit 4e86e79

Browse files
authored
Merge pull request #17 from AlphaSphereDotAI/reflex
Migration to Reflex
2 parents ddd72e4 + 11fab75 commit 4e86e79

43 files changed

Lines changed: 1682 additions & 987 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.envrc

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/usr/bin/env bash
2+
3+
export DIRENV_WARN_TIMEOUT=20s
4+
5+
eval "$(devenv direnvrc)"
6+
7+
# `use devenv` supports the same options as the `devenv shell` command.
8+
#
9+
# To silence all output, use `--quiet`.
10+
#
11+
# Example usage: use devenv --quiet --impure --option services.postgres.enable:bool true
12+
use devenv

.github/CODEOWNERS

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
11
# Generated by CODEOWNERS.com
2-

.github/mergify.yml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
pull_request_rules:
2+
- name: Merge pull request when the configuration of Mergify is valid
3+
conditions:
4+
- author = MH0386
5+
- "title = ci(Mergify): configuration update"
6+
- head = mergify/MH0386/config-update
7+
actions:
8+
merge:
9+
- name: Comment when a pull request is merged
10+
conditions:
11+
- merged
12+
actions:
13+
comment:
14+
message: >
15+
Thank you for your contribution @{{author}}! Your pull request has been merged.
16+
- name: Comment if there is a conflict
17+
conditions:
18+
- conflict
19+
actions:
20+
comment:
21+
message: Hi @{{author}}, Your PR is in conflict and cannot be merged.
22+
- name: Automatic update of the pull requests
23+
conditions:
24+
- -merged
25+
actions:
26+
update:
27+
- name: Automatically queue valid Bot PRs
28+
conditions:
29+
- author != MH0386
30+
- check-success = Check Dependency Compatibility
31+
actions:
32+
queue:
33+
- name: Add a queue label when PR is queued
34+
description: Toggle the queue label when a pull request is (un)queued.
35+
conditions:
36+
- queue-position > 0
37+
actions:
38+
label:
39+
toggle:
40+
- merge-queued
41+
- name: Notify when a PR is removed from the queue
42+
description: >
43+
Notify the PR author when its pull request is removed from the merge queue.
44+
conditions:
45+
- queue-dequeue-reason != none
46+
- queue-dequeue-reason != pr-merged
47+
actions:
48+
comment:
49+
message: >
50+
Hey @{{author}}, your pull request has been dequeued due to the following reason:
51+
{{queue_dequeue_reason}}.
52+
53+
Sorry about that, but you can requeue the PR by using `@mergifyio requeue` if you think
54+
this was a mistake.
55+
queue_rules:
56+
- name: default
57+
update_method: merge
58+
allow_queue_branch_edit: true
59+
queue_branch_merge_method: fast-forward
60+
queue_conditions:
61+
- and:
62+
- "check-success = DeepSource: Secrets"
63+
- "check-success = DeepSource: Python"
64+
- check-success = CodeQL
65+
- check-success = CodeFactor
66+
- check-success = GitGuardian Security Checks
67+
- check-success = SonarCloud
68+
- check-success = Check Dependency Compatibility
69+
- check-success = CodeRabbit
70+
- check-success = Run Tests

.github/renovate.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
3+
"dependencyDashboardOSVVulnerabilitySummary": "all",
4+
"extends": ["config:best-practices"],
5+
"lockFileMaintenance": {
6+
"enabled": true,
7+
"labels": ["Lockfile", "dependencies"]
8+
},
9+
"osvVulnerabilityAlerts": true,
10+
"packageRules": [
11+
{
12+
"labels": ["PyProject", "dependencies"],
13+
"matchManagers": ["pep621"],
14+
"matchPackageNames": ["*"],
15+
"rangeStrategy": "bump"
16+
}
17+
]
18+
}

.github/workflows/ci.yml

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
name: CI
2+
on:
3+
workflow_dispatch:
4+
pull_request:
5+
push:
6+
branches:
7+
- main
8+
permissions:
9+
checks: write
10+
contents: write
11+
id-token: write
12+
# concurrency:
13+
# group: ${{ github.workflow }}-${{ github.ref_name }}
14+
# cancel-in-progress: true
15+
jobs:
16+
compatibility:
17+
name: Check Dependency Compatibility
18+
runs-on: ubuntu-latest
19+
environment:
20+
name: code_quality
21+
steps:
22+
- name: Checkout repository
23+
uses: actions/checkout@v5.0.0
24+
- name: Install Nix
25+
uses: DeterminateSystems/determinate-nix-action@1d699fc25db3f9e079cd2f168ca007a4183389be # v3.15.1
26+
with:
27+
logger: pretty
28+
- name: Cache
29+
uses: DeterminateSystems/magic-nix-cache-action@565684385bcd71bad329742eefe8d12f2e765b39 # v13
30+
- name: Install devenv.sh
31+
run: nix profile install nixpkgs#devenv
32+
- name: Check Compatibility
33+
run: devenv shell compatibility-check
34+
test:
35+
name: Run Tests
36+
runs-on: ubuntu-latest
37+
environment:
38+
name: code_quality
39+
steps:
40+
- name: Checkout repository
41+
uses: actions/checkout@v5.0.0
42+
with:
43+
token: ${{ secrets.GH_TOKEN }}
44+
- name: Install Nix
45+
uses: DeterminateSystems/determinate-nix-action@1d699fc25db3f9e079cd2f168ca007a4183389be # v3.15.1
46+
with:
47+
logger: pretty
48+
- name: Cache
49+
uses: DeterminateSystems/magic-nix-cache-action@565684385bcd71bad329742eefe8d12f2e765b39 # v13
50+
- name: Install devenv.sh
51+
run: nix profile install nixpkgs#devenv
52+
- name: Test
53+
run: devenv test
54+
- name: Commit pre-commit fixes
55+
uses: stefanzweifel/git-auto-commit-action@04702edda442b2e678b25b537cec683a1493fcb9 # v7.1.0
56+
if: success() || failure()
57+
with:
58+
commit_message: "devenv: Apply Fixes"
59+
commit_options: --no-verify
60+
build_web:
61+
name: Build Web
62+
runs-on: ubuntu-latest
63+
needs: [compatibility, test]
64+
environment:
65+
name: build
66+
steps:
67+
- name: Checkout repository
68+
uses: actions/checkout@v5.0.0
69+
- name: Install Nix
70+
uses: DeterminateSystems/determinate-nix-action@1d699fc25db3f9e079cd2f168ca007a4183389be # v3.15.1
71+
with:
72+
logger: pretty
73+
- name: Cache
74+
uses: DeterminateSystems/magic-nix-cache-action@565684385bcd71bad329742eefe8d12f2e765b39 # v13
75+
- name: Install devenv.sh
76+
run: nix profile install nixpkgs#devenv
77+
- name: Cache .web
78+
uses: actions/cache@v5.0.1
79+
with:
80+
path: .web
81+
key: ${{ runner.os }}-reflex-${{ hashFiles('**/uv.lock') }}
82+
restore-keys: ${{ runner.os }}-reflex-
83+
- name: Build Web
84+
run: devenv shell build-web
85+
- name: Upload artifact
86+
uses: actions/upload-pages-artifact@v4.0.0
87+
with:
88+
path: .web/build/client/
89+
deploy_web:
90+
name: Deploy Web
91+
runs-on: ubuntu-latest
92+
needs: build_web
93+
permissions:
94+
pages: write
95+
environment:
96+
name: github-pages
97+
url: ${{ steps.deployment.outputs.page_url }}
98+
if: github.event_name != 'pull_request'
99+
steps:
100+
- name: Deploy to GitHub Pages
101+
id: deployment
102+
uses: actions/deploy-pages@v4.0.5

.github/workflows/main.yml

Lines changed: 0 additions & 26 deletions
This file was deleted.

.gitignore

Lines changed: 13 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,13 @@
1-
# Miscellaneous
2-
*.class
3-
*.log
4-
*.pyc
5-
*.swp
6-
.DS_Store
7-
.atom/
8-
.buildlog/
9-
.history
10-
.svn/
11-
migrate_working_dir/
12-
13-
# IntelliJ related
14-
*.iml
15-
*.ipr
16-
*.iws
17-
.idea/
18-
19-
# The .vscode folder contains launch configuration and tasks you configure in
20-
# VS Code which you may wish to be included in version control, so this line
21-
# is commented out by default.
22-
#.vscode/
23-
24-
# Flutter/Dart/Pub related
25-
**/doc/api/
26-
**/ios/Flutter/.last_build_id
27-
.dart_tool/
28-
.flutter-plugins
29-
.flutter-plugins-dependencies
30-
.pub-cache/
31-
.pub/
32-
/build/
33-
34-
# Symbolication related
35-
app.*.symbols
36-
37-
# Obfuscation related
38-
app.*.map.json
39-
40-
# Android Studio will place build artifacts here
41-
/android/app/debug
42-
/android/app/profile
43-
/android/app/release
1+
.devenv*
2+
devenv.local.nix
3+
devenv.local.yaml
4+
.direnv
5+
.pre-commit-config.yaml
6+
*.py[cod]
7+
assets/external/
8+
__pycache__/
9+
.web
10+
.states
11+
*.db
12+
.ruff.toml
13+
.yamllint.yaml

.metadata

Lines changed: 0 additions & 39 deletions
This file was deleted.

alphaspheredotai_github_io/__init__.py

Whitespace-only changes.
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
"""Welcome to Reflex! This file outlines the steps to create a basic app."""
2+
3+
import reflex as rx
4+
5+
from alphaspheredotai_github_io.pages import (
6+
contact_page,
7+
home_page,
8+
projects_page,
9+
team_page,
10+
)
11+
12+
app = rx.App(theme=rx.theme(radius="large", accent_color="gray"))
13+
14+
15+
@rx.page(route="/", title="Home Page")
16+
def index() -> rx.Component:
17+
"""Home page."""
18+
return home_page
19+
20+
21+
@rx.page(route="/projects", title="Projects")
22+
def projects() -> rx.Component:
23+
"""Projects page."""
24+
return projects_page
25+
26+
27+
@rx.page(route="/contact", title="Contact")
28+
def contact() -> rx.Component:
29+
"""Contact page."""
30+
return contact_page
31+
32+
33+
@rx.page(route="/team", title="Team")
34+
def team() -> rx.Component:
35+
"""Team page."""
36+
return team_page

0 commit comments

Comments
 (0)