Skip to content

Commit 6f686d1

Browse files
committed
feat: init
0 parents  commit 6f686d1

File tree

167 files changed

+27366
-0
lines changed

Some content is hidden

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

167 files changed

+27366
-0
lines changed

.env.example

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# API Server Configuration
2+
RQM_APP_HOST=0.0.0.0
3+
RQM_APP_PORT=8000
4+
RQM_APP_NGINX_PORT=7777
5+
RQM_APP_DEBUG=false
6+
RQM_APP_RELOAD=false
7+
RQM_APP_LOG_LEVEL=INFO
8+
9+
# Redis Configuration
10+
RQM_APP_REDIS_HOST=localhost
11+
RQM_APP_REDIS_PORT=6379
12+
RQM_APP_REDIS_DB=0
13+
RQM_APP_REDIS_PASSWORD=
14+
RQM_APP_REDIS_URL=
15+
RQM_APP_REDIS_SSL=false
16+
RQM_APP_REDIS_TIMEOUT=5
17+
18+
# Analytics Configuration
19+
RQM_APP_ANALYTICS_ENABLED=true
20+
RQM_APP_ANALYTICS_DB_PATH=data/analytics.db
21+
RQM_APP_ANALYTICS_COLLECTION_INTERVAL=1
22+
RQM_APP_ANALYTICS_RETENTION_DAYS=7

.github/workflows/docker.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Build and Push Docker Image
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
tags: [ 'v*' ]
7+
pull_request:
8+
branches: [ main ]
9+
10+
env:
11+
REGISTRY: ghcr.io
12+
IMAGE_NAME: ${{ github.repository }}
13+
14+
jobs:
15+
build:
16+
runs-on: ubuntu-latest
17+
permissions:
18+
contents: read
19+
packages: write
20+
21+
steps:
22+
- name: Checkout repository
23+
uses: actions/checkout@v4
24+
25+
- name: Log in to Container Registry
26+
uses: docker/login-action@v3
27+
with:
28+
registry: ${{ env.REGISTRY }}
29+
username: ${{ github.actor }}
30+
password: ${{ secrets.GITHUB_TOKEN }}
31+
32+
- name: Extract metadata
33+
id: meta
34+
uses: docker/metadata-action@v5
35+
with:
36+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
37+
tags: |
38+
type=ref,event=branch
39+
type=ref,event=pr
40+
type=semver,pattern={{version}}
41+
type=semver,pattern={{major}}.{{minor}}
42+
type=raw,value=latest,enable={{is_default_branch}}
43+
44+
- name: Build and push Docker image
45+
uses: docker/build-push-action@v5
46+
with:
47+
context: .
48+
push: true
49+
tags: ${{ steps.meta.outputs.tags }}
50+
labels: ${{ steps.meta.outputs.labels }}

.gitignore

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
__pycache__
2+
**/__pycache__
3+
__pycache__/
4+
**/__pycache__/
5+
*.py[cod]
6+
**/.mypy_cache/
7+
.refs/
8+
.mypy_cache/
9+
.local/
10+
.vscode/
11+
api/.venv
12+
front/node_modules
13+
front/dist
14+
**/.env
15+
settings.toml
16+
**/analytics.db
17+
**/*.tsbuildinfo
18+
*.DS_Store

CONTRIBUTING.md

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
# Contributing to RQ Manager
2+
3+
Thank you for your interest in contributing to RQ Manager! This guide will help you get started with development and contributing to the project.
4+
5+
## 🔧 Development
6+
7+
### Project Structure
8+
9+
```
10+
rq-manager/
11+
├── api/ # Python backend
12+
│ ├── app/
13+
│ │ ├── routes/ # API endpoints
14+
│ │ ├── services/ # Business logic
15+
│ │ ├── schemas/ # Data models
16+
│ │ └── cli/ # CLI commands
17+
│ └── pyproject.toml # Python dependencies
18+
├── front/ # React frontend
19+
│ ├── src/
20+
│ │ ├── pages/ # UI pages
21+
│ │ ├── services/ # API clients
22+
│ │ └── utils/ # Utilities
23+
│ └── package.json # Node dependencies
24+
├── infra/ # Infrastructure
25+
│ ├── k8s/ # Kubernetes manifests
26+
│ └── nginx/ # Nginx configuration
27+
└── docs/ # Documentation
28+
```
29+
30+
### Local Development Setup
31+
32+
#### Backend Setup
33+
34+
```bash
35+
# Navigate to API directory
36+
cd api
37+
38+
# Install Poetry (if not already installed)
39+
pip install poetry
40+
41+
# Install dependencies
42+
poetry install
43+
44+
# Copy and configure environment
45+
cp ../.env.example .env
46+
# Edit .env with your configuration
47+
48+
# Run the API server
49+
poetry run rqm api --host 0.0.0.0 --port 8000
50+
```
51+
52+
#### Frontend Setup
53+
54+
```bash
55+
# Navigate to frontend directory
56+
cd front
57+
58+
# Install dependencies
59+
yarn install
60+
61+
# Copy environment configuration
62+
cp .env.example .env.local
63+
# Edit .env.local with your API endpoint
64+
65+
# Start development server
66+
yarn dev
67+
```
68+
69+
## Performance Considerations
70+
71+
- Profile code changes for performance impact
72+
- Use appropriate data structures and algorithms
73+
- Consider memory usage for large datasets
74+
- Optimize database queries and Redis operations
75+
76+
## Security Guidelines
77+
78+
- Never commit secrets or credentials
79+
- Validate all user inputs
80+
- Use parameterized queries for database operations
81+
- Follow OWASP security guidelines
82+
- Review dependencies for known vulnerabilities
83+
84+
## Documentation
85+
86+
- Update README.md for user-facing changes
87+
- Add inline code comments for complex logic
88+
- Update API documentation for endpoint changes
89+
- Include examples in documentation
90+
91+
## Getting Help
92+
93+
- **Issues**: [GitHub Issues](https://github.com/ccrvlh/rq-manager/issues)
94+
- **Discussions**: [GitHub Discussions](https://github.com/ccrvlh/rq-manager/discussions)
95+
- **Documentation**: [Wiki](https://github.com/ccrvlh/rq-manager/wiki)
96+
97+
## Release Process
98+
99+
1. Update version numbers in `pyproject.toml` and `package.json`
100+
2. Update CHANGELOG.md with new features and fixes
101+
3. Create a release branch
102+
4. Run full test suite
103+
5. Create a pull request for review
104+
6. Tag the release after merge

Dockerfile

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
ARG FRONTEND_ENV=docker
2+
3+
FROM python:3.12-slim AS api-build
4+
5+
RUN apt-get update && apt-get install -y \
6+
build-essential \
7+
curl \
8+
&& rm -rf /var/lib/apt/lists/*
9+
10+
WORKDIR /app/api
11+
COPY api/poetry.lock api/pyproject.toml ./
12+
RUN pip install poetry
13+
RUN poetry config virtualenvs.create false
14+
RUN poetry install --without dev --no-cache --no-root
15+
COPY api/ ./
16+
17+
FROM node:20-alpine AS frontend-build
18+
19+
ARG FRONTEND_ENV
20+
WORKDIR /app/front
21+
COPY front/package*.json ./
22+
COPY front/yarn.lock ./
23+
RUN yarn install --frozen-lockfile
24+
COPY front/ ./
25+
COPY front/.env.${FRONTEND_ENV} .env
26+
RUN yarn build
27+
28+
FROM python:3.12-slim AS production
29+
30+
RUN apt-get update && apt-get install -y \
31+
nginx \
32+
curl \
33+
gettext-base \
34+
&& rm -rf /var/lib/apt/lists/*
35+
36+
WORKDIR /app
37+
38+
COPY --from=api-build /usr/local /usr/local
39+
COPY --from=api-build /app/api /app/api
40+
COPY --from=frontend-build /app/front/dist /usr/share/nginx/html
41+
COPY infra/nginx/nginx.conf.template /etc/nginx/nginx.conf.template
42+
COPY startup.sh /startup.sh
43+
RUN chmod +x /startup.sh
44+
45+
EXPOSE 7777
46+
47+
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
48+
CMD curl -f http://localhost:7777/health || exit 1
49+
50+
CMD ["/startup.sh"]

0 commit comments

Comments
 (0)