Skip to content
Open
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
3 changes: 3 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
DATABASE_URL=sqlite+aiosqlite:///./timeseries.db
DATABASE_URL_SYNC=sqlite:///./timeseries.db
DEBUG=false
35 changes: 35 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Virtual environment
.venv/
venv/
env/

# Python
__pycache__/
*.py[cod]
*.pyo
*.pyd
.Python

# Database
*.db
*.sqlite3

# Environment variables
.env
.env.*
!.env.example

# Coverage
.coverage
htmlcov/
.pytest_cache/

# Build
dist/
build/
*.egg-info/

# IDE
.vscode/
.idea/
*.swp
15 changes: 15 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM python:3.12-slim

WORKDIR /app

ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1

COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

COPY . .

EXPOSE 8000

CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000", "--workers", "4"]
55 changes: 55 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
.PHONY: install dev test test-unit test-integration load-test load-test-headless clean

VENV=.venv
PYTHON=$(VENV)/bin/python
PIP=$(VENV)/bin/pip

## Create virtual env and install all dependencies
install:
python3 -m venv $(VENV)
$(PIP) install --upgrade pip
$(PIP) install -r requirements.txt
@echo "\n✅ Pronto. Ative com: source .venv/bin/activate"

## Run dev server (single instance)
dev:
$(PYTHON) run.py

## Run all tests with coverage
test:
$(VENV)/bin/pytest

## Unit tests only
test-unit:
$(VENV)/bin/pytest tests/unit/ -v

## Integration tests only
test-integration:
$(VENV)/bin/pytest tests/integration/ -v

## Load test (interactive browser UI at http://localhost:8089)
load-test:
$(VENV)/bin/locust -f load_tests/locustfile.py --host=http://localhost:80

## Load test headless (CI mode, 100 users, 60s)
load-test-headless:
$(VENV)/bin/locust -f load_tests/locustfile.py \
--host=http://localhost:80 \
--headless -u 100 -r 10 \
--run-time 60s \
--html load_tests/report.html \
--csv load_tests/results

## Start full stack (nginx + 3 API workers)
up:
docker-compose up --build -d

## Stop stack
down:
docker-compose down

## Clean up
clean:
find . -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null; true
find . -name "*.pyc" -delete
rm -rf .pytest_cache .coverage htmlcov timeseries.db load_tests/report.html load_tests/results*
92 changes: 57 additions & 35 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,55 +1,77 @@
# Dynamox Developer Challenges
# timeseries-api

## About Dynamox
REST API for storing and analysing time series data. Built with FastAPI + SQLAlchemy (async).

[Dynamox](https://dynamox.net/) is a high-tech firm specializing in vibration analysis and industrial asset condition monitoring. Our expert team develops comprehensive hardware and software solutions, encompassing firmware, mobile applications (Android and iOS), and full-stack cloud native applications.
## Stack

With our proficiency in signal processing for vibration and acoustics, we deliver advanced and precise monitoring systems. We are committed to optimizing operational efficiency and facilitating proactive maintenance through our innovative technology and integrated solutions.
- **FastAPI** — HTTP layer
- **SQLAlchemy 2 (async)** + **aiosqlite** — persistence (swap to postgres by changing `DATABASE_URL`)
- **NumPy / statsmodels** — metrics and forecasting
- **pytest + pytest-asyncio** — tests
- **Locust** — load tests
- **Nginx** — load balancer (docker setup)

## Positions
## Getting started

We are looking for developers who are passionate about learning, growing, and contributing to our team. You will play a key role in our development efforts, working on a variety of projects and collaborating with different teams to build and improve our solutions.
```bash
python3 -m venv .venv
source .venv/bin/activate # windows: .venv\Scripts\activate
pip install -r requirements.txt
cp .env.example .env
python run.py
```

We value flexibility and collaboration, hence we provide opportunities for you to lend your skills to other teams when required. Join us on this exciting journey as we revolutionize our digital platforms. Currently we are particularly interested in individuals who can identify with one of the following role descriptions:
Swagger at http://localhost:8000/docs

### Junior Software Developer
## Running with docker (nginx + 3 workers)

With limited experience, assists in coding, testing, and stabilizing systems under supervision. Communicates with immediate team members and solves straightforward problems with guidance. Should display a willingness to learn and grow professionally. This is an individual contributor role.
```bash
docker-compose up --build -d
# api available at http://localhost:80
```

### Mid-level Software Developer
## Tests

With a certain level of proven experience, contributes to software development, solves moderate problems, and starts handling ambiguous situations with minimal guidance. Communicates with the broader team and engages in code reviews and documentation. This role also includes supporting junior engineers and commitment to continuous learning. This is an individual contributor role.
```bash
pytest # all
pytest tests/unit/ # unit only
pytest tests/integration/ # integration only
```

### Senior-level Software Developer
## Load tests

With vast experience, enhances software development, leading complex system development and ambiguous situation handling. Tackles intricate problems and mentors junior and mid-level engineers. Champions coding standards, project strategy, and technology adoption. Communicates across teams, influencing technical and non-technical stakeholders. This individual contributor role blends technical expertise with leadership, focusing on innovation, mentorship, and strategic contributions to the development process.
```bash
# interactive (opens browser UI at :8089)
locust -f load_tests/locustfile.py --host=http://localhost:80

## Challenges Full-Stack
# headless
locust -f load_tests/locustfile.py --host=http://localhost:80 \
--headless -u 100 -r 10 --run-time 60s --html load_tests/report.html
```

- [ ] [01 - Dynamox Full-Stack Node.js React Developer Challenge](./full-stack-challenge.md)
- [ ] [02 - Dynamox Full-Stack C# React Developer Challenge](./full-stack-csharp-react-challenge.md)

## Challenges Front-End
## Endpoints

- [ ] [01 - Dynamox Front-end React Developer Challenge Marketing Teams](./front-end-challenge-v1.md)
- [ ] [02 - Dynamox Front-end React Developer Challenge Product Teams](./front-end-challenge-v2.md)
| Method | Path | Description |
|--------|------|-------------|
| POST | `/api/v1/timeseries/` | store a new series |
| GET | `/api/v1/timeseries/` | list (paginated) |
| GET | `/api/v1/timeseries/count` | how many series you have |
| GET | `/api/v1/timeseries/{id}` | full series + data points |
| GET | `/api/v1/timeseries/{id}/metrics` | stats (min/max/mean/rms/p95/p99...) |
| POST | `/api/v1/timeseries/{id}/predict` | forecast future values |
| DELETE | `/api/v1/timeseries/{id}` | delete a series |
| GET | `/health` | health check |

## Challenges DevOps
### Prediction methods

- [ ] [01 - Dynamox DevOps Developer Challenge Foundation Teams](./dev-sec-fin-ops-challenge-v1/README.md)
`POST /api/v1/timeseries/{id}/predict`

## Challenges Mobile
```json
{ "steps": 10, "method": "auto" }
```

- [ ] [01 - Dynamox Kotlin Multiplatform Developer Challenge](./kotlin-multiplatform-challenge.md)
- [ ] [02 - Dynamox Android Developer Challenge](./android-challenge.md)
- [ ] [03 - Dynamox iOS Developer Challenge](./ios-challenge.md)
- `linear` — OLS regression, good for steady trends
- `holt_winters` — double exponential smoothing, handles trend changes better
- `auto` — trains both on 80% of data, picks lower RMSE on the remaining 20%

## Challenge Back-End
- [ ] [01 - Dynamox Back-End Time Series ](./back-end-challenge-v1.md)

## Challenge QA
- [ ] [01- Dynamox QA Challenge](./qa-challenge.md)

</br>

**Good luck! We look forward to reviewing your submission.** 🚀
Returns predictions + 95% confidence interval bounds.
130 changes: 0 additions & 130 deletions android-challenge.md

This file was deleted.

1 change: 1 addition & 0 deletions app/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# app
1 change: 1 addition & 0 deletions app/api/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

1 change: 1 addition & 0 deletions app/api/v1/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

1 change: 1 addition & 0 deletions app/api/v1/endpoints/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Loading