Skip to content

Commit 363aee1

Browse files
Merge pull request #10 from careagain-org/dev-code
Dev code
2 parents 8de9825 + 89522b0 commit 363aee1

Some content is hidden

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

47 files changed

+730
-630
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: deploy-docs
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
deploy-docs:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Check out
11+
uses: actions/checkout@v4
12+
13+
- name: Set up Python
14+
uses: actions/setup-python@v5
15+
with:
16+
python-version: "3.11"
17+
18+
- name: Install dependencies
19+
run: |
20+
python -m pip install --upgrade pip
21+
pip install mkdocs mkdocs-material # add other plugins or requirements here
22+
23+
- name: Deploy documentation
24+
run: mkdocs gh-deploy --force

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
.states
12
.states/*
23
*.pkl
34
*.db
@@ -18,3 +19,5 @@ inventory.ini
1819
frontend.zip
1920
/.states
2021
*.pkl
22+
/site
23+
alembic/ac4f8682bd44_.py

Dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ RUN apt-get update && apt-get install -y \
1515
&& apt-get clean \
1616
&& rm -rf /var/lib/apt/lists/*
1717

18+
RUN DEBIAN_FRONTEND=noninteractive apt-get update && \
19+
apt-get install -y xclip && \
20+
rm -rf /var/lib/apt/lists/*
21+
1822
# Install CA certs and dependencies
1923
RUN apt-get update && apt-get install -y --no-install-recommends \
2024
ca-certificates curl gnupg && \

README.md

Lines changed: 136 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,69 +1,158 @@
1-
# Welcome to Reflex!
1+
# CareAgain WebApp
22

3-
This is the base Reflex template - installed when you run `reflex init`.
3+
**CareAgain WebApp** is a web application built using the [Reflex](https://reflex.dev/) framework.
4+
It serves as the frontend for CareAgain's platform, connecting institutions and organizations involved in medical devices—such as R&D, manufacturing, logistics, and hospitals—into a unified network to foster collaboration and innovation.
45

5-
If you want to use a different template, pass the `--template` flag to `reflex init`.
6-
For example, if you want a more basic starting point, you can run:
6+
## Table of Contents
77

8-
```bash
9-
reflex init --template blank
10-
```
8+
- [Features](#features)
9+
- [Project Structure](#project-structure)
10+
- [Getting Started](#getting-started)
11+
- [Development](#development)
12+
- [Testing](#testing)
13+
- [Deployment](#deployment)
14+
- [Contributing](#contributing)
15+
- [License](#license)
1116

12-
## About this Template
17+
## Features
1318

14-
This template has the following directory structure:
19+
- Modular and extensible architecture using Reflex.
20+
- Predefined components and templates for rapid development.
21+
- Dockerized setup for consistent development and deployment environments.
22+
- Integration-ready with backend services and databases.
23+
- Focused on fostering collaboration in the medical device ecosystem.
1524

16-
```bash
25+
## Project Structure
26+
27+
The project follows the standard Reflex template structure:
28+
29+
```
1730
├── README.md
18-
├── assets
31+
├── assets/
1932
├── rxconfig.py
20-
└── {your_app}
21-
├── __init__.py
22-
├── components
23-
│   ├── __init__.py
24-
│   └── sidebar.py
25-
├── pages
26-
│   ├── __init__.py
27-
│   ├── dashboard.py
28-
│   ├── index.py
29-
│   └── settings.py
30-
├── styles.py
31-
├── templates
32-
│   ├── __init__.py
33-
│   └── template.py
34-
└── {your_app}.py
33+
├── webapp/
34+
│ ├── __init__.py
35+
│ ├── components/
36+
│ │ ├── __init__.py
37+
│ │ └── sidebar.py
38+
│ ├── pages/
39+
│ │ ├── __init__.py
40+
│ │ ├── dashboard.py
41+
│ │ ├── index.py
42+
│ │ └── settings.py
43+
│ ├── styles.py
44+
│ ├── templates/
45+
│ │ ├── __init__.py
46+
│ │ └── template.py
47+
│ └── webapp.py
48+
├── tests/
49+
│ ├── __init__.py
50+
│ └── test_pages.py
51+
├── Dockerfile
52+
├── docker-compose.yaml
53+
├── requirements.txt
54+
├── requirements_manual.txt
55+
├── pyproject.toml
56+
├── alembic/
57+
├── alembic.ini
58+
├── devops/
59+
└── .github/workflows/
60+
```
61+
62+
## Getting Started
63+
64+
### Prerequisites
65+
66+
- Python 3.8 or higher
67+
- Docker and Docker Compose (optional, for containerized setup)
68+
69+
### Installation
70+
71+
1. Clone the repository:
72+
73+
```bash
74+
git clone https://github.com/careagain-org/careagain-webapp.git
75+
cd careagain-webapp
76+
```
77+
78+
2. Install dependencies:
79+
80+
```bash
81+
pip install -r requirements.txt
82+
```
83+
84+
3. Run the application:
85+
86+
```bash
87+
reflex run
88+
```
89+
90+
The application will be accessible at `http://localhost:3000`.
91+
92+
## Development
93+
94+
- To add new pages, create a Python file in `webapp/pages/` and define a function with the `@template` decorator.
95+
- For reusable components, add them to `webapp/components/`.
96+
- Use `webapp/styles.py` for styling and theming.
97+
- Add tests in the `tests/` directory to ensure code quality.
98+
99+
## Testing
100+
101+
Run tests using `pytest`:
102+
103+
```bash
104+
pytest tests/
35105
```
36106

37-
See the [Project Structure docs](https://reflex.dev/docs/getting-started/project-structure/) for more information on general Reflex project structure.
107+
Ensure all tests pass before submitting changes.
108+
109+
## Deployment
110+
111+
### Using Docker
112+
113+
1. Build the Docker image:
114+
115+
```bash
116+
docker build -t careagain-webapp .
117+
```
118+
119+
2. Run the Docker container:
120+
121+
```bash
122+
docker run -p 3000:3000 careagain-webapp
123+
```
124+
125+
The application will be accessible at `http://localhost:3000`.
126+
127+
## Contributing
38128

39-
### Adding Pages
129+
We welcome contributions from the community. To contribute:
40130

41-
In this template, the pages in your app are defined in `{your_app}/pages/`.
42-
Each page is a function that returns a Reflex component.
43-
For example, to edit this page you can modify `{your_app}/pages/index.py`.
44-
See the [pages docs](https://reflex.dev/docs/pages/routes/) for more information on pages.
131+
1. Fork the repository.
132+
2. Create a new branch:
45133

46-
In this template, instead of using `rx.add_page` or the `@rx.page` decorator,
47-
we use the `@template` decorator from `{your_app}/templates/template.py`.
134+
```bash
135+
git checkout -b feature/your-feature-name
136+
```
48137

49-
To add a new page:
138+
3. Make your changes and commit them:
50139

51-
1. Add a new file in `{your_app}/pages/`. We recommend using one file per page, but you can also group pages in a single file.
52-
2. Add a new function with the `@template` decorator, which takes the same arguments as `@rx.page`.
53-
3. Import the page in your `{your_app}/pages/__init__.py` file and it will automatically be added to the app.
140+
```bash
141+
git commit -m "Add your message here"
142+
```
54143

144+
4. Push to your forked repository:
55145

56-
### Adding Components
146+
```bash
147+
git push origin feature/your-feature-name
148+
```
57149

58-
In order to keep your code organized, we recommend putting components that are
59-
used across multiple pages in the `{your_app}/components/` directory.
150+
5. Open a pull request detailing your changes.
60151

61-
In this template, we have a sidebar component in `{your_app}/components/sidebar.py`.
152+
## License
62153

63-
### Adding State
154+
This project is licensed under the [APACHE 2.0](LICENSE).
64155

65-
As your app grows, we recommend using [substates](https://reflex.dev/docs/substates/overview/)
66-
to organize your state.
156+
---
67157

68-
You can either define substates in their own files, or if the state is
69-
specific to a page, you can define it in the page file itself.
158+
For more information on the Reflex framework, visit the [official documentation](https://reflex.dev/docs).

alembic.ini

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ prepend_sys_path = .
4949
# version_path_separator = :
5050
# version_path_separator = ;
5151
# version_path_separator = space
52+
# version_path_separator = newline
5253
version_path_separator = os # Use os.pathsep. Default configuration used for new projects.
5354

5455
# set to 'true' to search source files recursively
@@ -91,12 +92,12 @@ keys = console
9192
keys = generic
9293

9394
[logger_root]
94-
level = WARN
95+
level = WARNING
9596
handlers = console
9697
qualname =
9798

9899
[logger_sqlalchemy]
99-
level = WARN
100+
level = WARNING
100101
handlers =
101102
qualname = sqlalchemy.engine
102103

0 commit comments

Comments
 (0)