Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
f5c4da6
🎉 First Commit
Oct 23, 2025
516c9ea
✨ feat(logger): agregar módulo de logger y servicio de registro
Oct 23, 2025
2773af9
🗑️ chore(api): eliminar controlador y servicio de ManagerApiGateway
Oct 23, 2025
c50282c
🔧 fix(module): corregir importación del LoggerModule
Oct 23, 2025
28f6c12
✨ feat(custom-class-validator): add module and service with validatio…
Oct 23, 2025
74fbe64
✨ feat(dto): add basic DTOs for patient, provider, status, and status…
Oct 23, 2025
c16ce65
✨ feat(providers): implement Providers module, controller, and service
Oct 23, 2025
94107a1
✨ feat(providers): refactor Providers module and add new DTOs
Oct 23, 2025
daa3350
feat: add new start scripts and update dependencies
Oct 23, 2025
19a8154
✨ feat(main): add global validation pipe with whitelist option
Oct 23, 2025
b232f24
🗑️ chore(contracts): remove unused Contracts module and service
Oct 23, 2025
a53cba3
✨ feat(providers): implement Providers module, service, and tests
Oct 23, 2025
0eba244
✨ feat(standard-response): add standard response library and configur…
Oct 23, 2025
e853e87
✨ feat(statuses): implement CRUD operations and messaging patterns fo…
Oct 23, 2025
c0c20b9
✨ feat(statuses): update findOne method to use IdDto
Oct 23, 2025
eb22a7e
✨ feat(providers): enhance CRUD operations with standard responses
Oct 23, 2025
cc63d3a
✨ feat(statuses): add logging for error handling in CRUD operations
Oct 23, 2025
86cb306
✨ feat(patients): implement CRUD operations and messaging patterns
Oct 24, 2025
9b50a20
✨ feat(status-histories): implement CRUD operations and tests
Oct 24, 2025
4e7317d
✨ refactor(providers): clean up imports and logger usage
Oct 24, 2025
9c2e828
✨ feat(status-histories): add application configuration
Oct 24, 2025
4718b05
✨ feat(manager-api-gateway): add StatusHistoriesModule to imports
Oct 24, 2025
1dab48f
✨ feat(envs): add environment configuration for statuses
Oct 24, 2025
81153e0
✨ feat(statuses): add database migrations and seeding
Oct 24, 2025
4e4fad2
🎉 Begin Front End
Oct 24, 2025
a8101fa
✨ feat(ui): add GenericButton, GenericDropdown, and GenericTextInput …
Oct 24, 2025
b1ed7f4
✨ feat(validation): add injection validation method
Oct 24, 2025
eeea514
✨ feat(provider): add initial values, validation schema, and provider…
Oct 24, 2025
f96bc76
✨ feat(storage): add encryptLocalStorage helper functions
Oct 24, 2025
34dfa93
✨ feat(utils): add setInitialValues function
Oct 24, 2025
6a7d8a1
✨ feat(dependencies): add react-query, react-secure-storage, and zustand
Oct 24, 2025
d3aafe3
✨ feat(dto): add MaxLength validation to patient, provider, and statu…
Oct 24, 2025
2c81f6a
✨ feat(main): enable CORS for API gateway
Oct 24, 2025
919d300
✨ feat(provider): standardize naming for full_name in forms and store
Oct 24, 2025
b1b3fd0
✨ feat(query-client): add QueryClient setup with error handling
Oct 24, 2025
354f436
✨ feat(alert): implement alert service with toast and modal alerts
Oct 24, 2025
896f905
✨ feat(ui): add GenericProgressBar component with nprogress integration
Oct 24, 2025
8f5c33d
✨ feat(env): add BASE_URL configuration from environment
Oct 24, 2025
c387c4c
✨ feat(ui): add GenericCard and GenericCardList components
Oct 24, 2025
08b7324
✨ feat(provider): implement useProviderList hook and update ProviderL…
Oct 24, 2025
c322f7d
✨ feat(utils): add createCardListItems and createDropdownItems functions
Oct 24, 2025
c6d75f2
✨ feat(provider): update createProvider to use values parameter
Oct 24, 2025
4bb568c
✨ feat(ui): update layout styles for responsiveness
Oct 24, 2025
b95ebe0
✨ feat(ui): enhance GenericButton and GenericDropdown styles
Oct 24, 2025
ae7e5c4
✨ feat(patient): implement patient creation and list functionality
Oct 24, 2025
098d163
✨ feat(provider): refactor useProvider hook for clarity
Oct 24, 2025
64fb049
✨ feat(status): add status service and store implementation
Oct 24, 2025
8e498a9
✨ feat(constants): add query keys for providers, patients, and statuses
Oct 24, 2025
a95e06c
✨ feat(dashboard): enhance navigation with responsive design
Oct 24, 2025
77cd866
✨ feat(package): add create-envs script for environment setup
Oct 24, 2025
f76eb5d
✨ docs: actualizar README para reflejar cambios en la estructura del …
Oct 24, 2025
ce5d96a
✨ docs: agregar secciones de capturas de pantalla al README
Oct 24, 2025
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
56 changes: 56 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# compiled output
**/dist
**/node_modules
/build

# Logs
logs
*.log
npm-debug.log*
pnpm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*

# OS
.DS_Store

# Tests
/coverage
/.nyc_output

# IDEs and editors
/.idea
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace

# IDE - VSCode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json

# dotenv environment variable files
.env
.env.development.local
.env.test.local
.env.production.local
.env.local

# temp directory
.temp
.tmp

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
213 changes: 121 additions & 92 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,138 +1,167 @@
## Technical Challenge

### Background
# Manager

At VIP Medical Group, we are building a new internal module for our Medwork platform—a system that allows our staff to register patients, assign them to doctors (providers), and track their clinical status throughout their care journey.
This repository contains a microservices system with a frontend in React/Vite and a backend in NestJS, using PostgreSQL and RabbitMQ as supporting services.

In this challenge, you’ll simulate part of this module by creating a full-stack application that allows managing patients, providers, and clinical statuses with a parent-child hierarchy.
## Architecture and Design Decisions

We are **not evaluating specific tools or patterns**. We simply want to understand how you think, how you code, and how you approach real-world problems. Be yourself.
- Microservices: Each backend module runs as an independent microservice.

- RabbitMQ: Used for asynchronous communication and background task processing.

- PostgreSQL: Centralized relational database for all services.

### What You Need to Build
- Frontend: Vite application for fast reloads and agile development.

A functional **full stack application** with the ability to:
## Prerequisites

1. Create patients and providers
2. Assign a provider to a patient
3. Change the patient’s clinical status (with hierarchy)
4. Display the status change history of a patient
- Docker and Docker Compose installed
- Node.js version 18 or higher
- npm

## Steps to Run the Project Locally

1. Generate the environment files

### Database Schema
- Copy the create-envs.sh file to the root of the repository

You must implement these 4 tables exactly as described below:
- Run the following command in the terminal. This will create all necessary .env files (content of create-envs.sh file is at the end of this readme):

#### 1. `patients`
`` ./create-envs.sh ``

| Field | Type |
| ------------ | --------- |
| id | UUID |
| full\_name | string |
| email | string |
| phone | string |
| provider\_id | UUID (FK) |
| status\_id | UUID (FK) |
| created\_at | datetime |

#### 2. `providers`
2. Start backend services

| Field | Type |
| ----------- | -------- |
| id | UUID |
| full\_name | string |
| specialty | string |
| created\_at | datetime |
- Go to the backend folder:

#### 3. `statuses`
`` cd backend/manager ``

| Field | Type |
| ---------- | ------------------------------- |
| id | UUID |
| name | string |
| parent\_id | UUID (nullable, FK to statuses) |
| order | integer |
- Start the RabbitMQ and PostgreSQL images:

> This table allows parent-child status relationships.
`` docker compose -f docker-compose.dev.yml up -d ``

#### 4. `status_history`
- Install backend dependencies:
`` npm install ``

| Field | Type |
| ----------- | --------- |
| id | UUID |
| patient\_id | UUID (FK) |
| status\_id | UUID (FK) |
| changed\_at | datetime |
- Run the database migrations:
`` npm run typeorm:statuses ``

- Start all microservices:
`` npm run start:all ``

3. Start the frontend

### Preloaded Statuses
- Open another terminal and go to the frontend folder:
`` cd frontend/manager-app ``

These statuses must be preloaded in the database:
- Install frontend dependencies:
`` npm install ``

* `Scheduled`
- Start the frontend with Vite:
`` npm run dev ``

* `Checked-In`

* `In Consultation`
* `Cancelled`
* `No-Show`
### Recommended content of ./create-envs.sh

You can use a seed script or migrations to insert them.
```
#!/bin/bash

# Backend manager root .env
cat > backend/manager/.env <<EOL
DATABASE_URL="file:./dev.db"

RABBITMQ_USER=marioch
RABBITMQ_PASS=marioch123
POSTGRES_USER=marioch
POSTGRES_PASSWORD=marioch123
POSTGRES_PORT=5437
EOL

### Tech Stack
# Backend manager-api-gateway .env
cat > backend/manager/apps/manager-api-gateway/.env <<EOL
NODE_ENV=dev
HOST=0.0.0.0
PORT=3000
RMQ_USER=marioch
RMQ_PASSWORD=marioch123
RABBITMQ_URL=localhost:5672
EOL

#### Backend
# Backend patients .env
cat > backend/manager/apps/patients/.env <<EOL
RMQ_USER=marioch
RMQ_PASSWORD=marioch123
RABBITMQ_URL=localhost:5672

* Language: TypeScript
* Framework: **NestJS** or **Express**
* Database: **PostgreSQL**, **MySQL**, or **MongoDB**
* If you prefer, you may separate logic into small services (e.g., `patients-service`, `statuses-service`)
DB_HOST=localhost
DB_PORT=5437
DB_USERNAME=marioch
DB_PASSWORD=marioch123
DB_DATABASE=patient_db
EOL

* Use **HTTP**, **events**, or **gRPC** for inter-service communication
* If using multiple services, you must include an **API Gateway**
# Backend providers .env
cat > backend/manager/apps/providers/.env <<EOL
RMQ_USER=marioch
RMQ_PASSWORD=marioch123
RABBITMQ_URL=localhost:5672

#### Frontend
DB_HOST=localhost
DB_PORT=5437
DB_USERNAME=marioch
DB_PASSWORD=marioch123
DB_DATABASE=provider_db
EOL

* Framework: **React** (Vite)
* Styling: **TailwindCSS**
* State management: **Redux Toolkit** or **Zustand**
* Data fetching: **Tanstack Query**
# Backend status-histories .env
cat > backend/manager/apps/status-histories/.env <<EOL
RMQ_USER=marioch
RMQ_PASSWORD=marioch123
RABBITMQ_URL=localhost:5672

DB_HOST=localhost
DB_PORT=5437
DB_USERNAME=marioch
DB_PASSWORD=marioch123
DB_DATABASE=status_history_db
EOL

# Backend statuses .env
cat > backend/manager/apps/statuses/.env <<EOL
RMQ_USER=marioch
RMQ_PASSWORD=marioch123
RABBITMQ_URL=localhost:5672

### Required Screens
DB_HOST=localhost
DB_PORT=5437
DB_USERNAME=marioch
DB_PASSWORD=marioch123
DB_DATABASE=status_db
EOL

You should include the following screens:
# Frontend .env.local
cat > frontend/manager-app/.env.local <<EOL
VITE_STAGE=dev
VITE_API_URL=http://localhost:3000
EOL

1. Patient creation form
2. Provider creation form
3. Patient list (showing status and assigned provider)
4. Patient status update control (e.g., dropdown)
5. Patient status history (as timeline or list)
echo "Todos los archivos .env fueron creados correctamente."

> **Optional screen:** Provider list view.
```

## Screenshots


### Submission Instructions

* You will receive a Git repository link for the base project.
* **Fork the repository**, complete your work in a new branch, and **submit a pull request** to share your solution.
* Include a `README.md` with:

* Clear instructions to run the project locally
* A short explanation of your architecture or design decisions
* A seed script to preload providers and statuses



### Time Expectation

You should spend no more than **8 hours** on this task.

Don’t worry if you can’t finish everything. What matters most is **how far you get** and **how you approach the problem**.
![Provider creation](./screenshots/provider-creation.png)

![Patient creation](./screenshots/patient-creation.png)

![Patient list](./screenshots/patient-list.png)

![Provider list](./screenshots/provider-list.png)

![Creation alert](./screenshots/creation-alert.png)


## Authors

- [@MarioCuberos](https://www.linkedin.com/in/mario-enrique-cuberos-hernandez/)
4 changes: 4 additions & 0 deletions backend/manager/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"singleQuote": true,
"trailingComma": "all"
}
Loading