[S0-T01] Initialize monorepo with packages/engine, packages/api, packages/web directories

This commit is contained in:
Manohar Gupta 2026-05-07 02:04:47 +05:30
parent 0d7cf4a454
commit 1d23b579fe
8 changed files with 127 additions and 0 deletions

50
.gitignore vendored Normal file
View file

@ -0,0 +1,50 @@
# Python
__pycache__/
*.py[cod]
*.pyo
.mypy_cache/
.ruff_cache/
.pytest_cache/
*.egg-info/
dist/
build/
.venv/
venv/
*.env
# Poetry
poetry.lock
# Node
node_modules/
.next/
out/
.pnpm-store/
# IDE
.vscode/
.idea/
*.swp
*.swo
# OS
.DS_Store
Thumbs.db
# Parquet / data
*.parquet
*.db
*.sqlite
# Secrets
.env
.env.local
.env.*.local
# Coverage
.coverage
htmlcov/
coverage.xml
# Alembic
packages/api/alembic/versions/__pycache__/

36
Makefile Normal file
View file

@ -0,0 +1,36 @@
.PHONY: setup dev test lint build clean
setup:
@echo "==> Installing engine deps"
cd packages/engine && poetry install
@echo "==> Installing api deps"
cd packages/api && poetry install
@echo "==> Installing web deps"
cd packages/web && pnpm install
dev:
@echo "==> Starting services (Redis, API, worker, web)"
docker compose up -d redis
cd packages/api && poetry run uvicorn remodel_api.main:app --reload --port 8000 &
cd packages/api && poetry run arq remodel_api.workers.main.WorkerSettings &
cd packages/web && pnpm dev
test:
cd packages/engine && poetry run pytest --cov=remodel_engine --cov-report=term-missing
cd packages/api && poetry run pytest --cov=remodel_api --cov-report=term-missing
lint:
cd packages/engine && poetry run ruff check . && poetry run mypy src/
cd packages/api && poetry run ruff check . && poetry run mypy src/
cd packages/web && pnpm tsc --noEmit && pnpm eslint .
build:
cd packages/web && pnpm build
clean:
find . -type d -name __pycache__ -exec rm -rf {} +
find . -type d -name .mypy_cache -exec rm -rf {} +
find . -type d -name .ruff_cache -exec rm -rf {} +
find . -type d -name .pytest_cache -exec rm -rf {} +
find . -type d -name .next -exec rm -rf {} +
find . -type d -name node_modules -exec rm -rf {} +

41
README.md Normal file
View file

@ -0,0 +1,41 @@
# REmodel
Python calculation engine + FastAPI backend + Next.js frontend for Indian renewable energy (Solar + Wind + BESS) project finance modeling.
## Quick start
```bash
# Prerequisites: Python 3.12, Poetry, Node 20, pnpm, Docker
make setup # install all deps
make dev # start Redis, API worker, API server, web server
```
## Services (after `make dev`)
| Service | URL |
|-------------|-------------------------|
| Web UI | http://localhost:3000 |
| API | http://localhost:8000 |
| API docs | http://localhost:8000/docs |
| Redis | localhost:6379 |
## Package layout
```
packages/
├── engine/ pip-installable Python calculation library
├── api/ FastAPI + Arq async worker
└── web/ Next.js 14 App Router frontend
```
## Common commands
```bash
make setup # one-time install
make dev # start all services (requires Docker for Redis)
make test # pytest + jest
make lint # ruff + mypy + tsc
make build # production build
```
See each package's own `README.md` for package-specific commands.

View file

View file

View file

View file