Skip to content

Latest commit

Β 

History

10 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Patient Management System - MedCloud Challenge

Node.js React PostgreSQL Docker License

Complete patient management system developed for the Development Challenge Nine from MedCloud.

πŸ“‹ About the Project

This system was developed as a solution for MedCloud's technical challenge, implementing a modern full-stack application for patient record management with complete CRUD functionality, interactive dashboard, and scalable architecture.

🎯 Key Features

  • Complete Patient CRUD: Create, view, edit, and delete patient records
  • Interactive Dashboard: Real-time statistics and demographic analysis
  • Advanced Search & Filters: Search by name, email, age, and age groups
  • Smart Pagination: Efficient navigation through records
  • Robust Validation: Validation on both frontend and backend
  • Data Export: Export functionality in JSON and CSV formats
  • Responsive Design: Works perfectly on desktop and mobile
  • Smart Caching: Caching system for performance optimization
  • Real Persistence: Data stored in PostgreSQL with Redis backup

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   Frontend      β”‚    β”‚    Backend      β”‚    β”‚   Database      β”‚
β”‚   React + MUI   │◄──►│  Node.js + Express │◄──►│  PostgreSQL    β”‚
β”‚   Context API   β”‚    β”‚  REST API       β”‚    β”‚   + Redis       β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ› οΈ Tech Stack

Frontend

  • React 18 - Main framework
  • Material-UI (MUI) - Component library
  • React Router - SPA routing
  • React Query - State management and caching
  • Axios - HTTP client
  • React Toastify - Notifications

Backend

  • Node.js - JavaScript runtime
  • Express.js - Web framework
  • PostgreSQL - Primary database
  • Redis - Caching and sessions
  • bcryptjs - Password hashing
  • JWT - Authentication
  • Joi - Data validation
  • Winston - Logging

DevOps

  • Docker & Docker Compose - Containerization
  • Nginx - Reverse proxy (production)
  • GitHub Actions - CI/CD (configured)

πŸš€ Quick Start

Prerequisites

  • Docker and Docker Compose
  • Node.js 18+ (for local development)
  • Git

1. Clone the Repository

git clone https://github.com/Pasblinn/MedCloud-Challenge.git
cd MedCloud-Challenge

2. Run with Docker

# Start all services (backend, frontend, PostgreSQL, Redis)
docker-compose up -d

# Wait a few seconds for all services to start

3. Access the Application

4. Sample Data

The system comes with pre-loaded sample data for demonstration purposes.

πŸ“ Project Structure

medcloud/
β”œβ”€β”€ frontend/                 # React Application
β”‚   β”œβ”€β”€ public/
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/       # Reusable components
β”‚   β”‚   β”œβ”€β”€ contexts/         # Context API (global state)
β”‚   β”‚   β”œβ”€β”€ hooks/            # Custom hooks
β”‚   β”‚   β”œβ”€β”€ pages/            # Application pages
β”‚   β”‚   β”œβ”€β”€ services/         # Services and API calls
β”‚   β”‚   β”œβ”€β”€ styles/           # Global styles
β”‚   β”‚   └── utils/            # Utilities and helpers
β”‚   β”œβ”€β”€ Dockerfile
β”‚   └── package.json
β”œβ”€β”€ backend/                  # Node.js API
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ config/           # Configuration
β”‚   β”‚   β”œβ”€β”€ controllers/      # Controllers
β”‚   β”‚   β”œβ”€β”€ middleware/       # Middlewares
β”‚   β”‚   β”œβ”€β”€ models/           # Data models
β”‚   β”‚   β”œβ”€β”€ repositories/     # Data layer
β”‚   β”‚   β”œβ”€β”€ routes/           # API routes
β”‚   β”‚   β”œβ”€β”€ services/         # Business logic
β”‚   β”‚   └── utils/            # Utilities
β”‚   β”œβ”€β”€ Dockerfile
β”‚   └── package.json
β”œβ”€β”€ database/                 # Database scripts
β”‚   └── init.sql
β”œβ”€β”€ docker-compose.yml        # Service orchestration
└── README.md

πŸ”§ Local Development

Frontend

cd frontend
npm install
npm start                     # Development: http://localhost:3000
npm run build                 # Production build
npm test                      # Run tests

Backend

cd backend
npm install
npm run dev                   # Development with nodemon
npm start                     # Production
npm test                      # Run tests

Environment Variables

Backend (.env)

# Copy the example file and edit as needed
cp backend/.env.example backend/.env
NODE_ENV=development
PORT=3001
DB_HOST=postgres
DB_PORT=5432
DB_NAME=patient_management
DB_USER=postgres
DB_PASSWORD=postgres123
REDIS_HOST=redis
REDIS_PORT=6379
JWT_SECRET=your-super-secret-jwt-key
CORS_ORIGIN=http://localhost:3000

Frontend (.env)

REACT_APP_API_URL=http://localhost:3001/api
REACT_APP_ENV=development

πŸ“Š API Endpoints

Patients

Method Endpoint Description
GET /api/patients List all patients
GET /api/patients/:id Get patient by ID
POST /api/patients Create new patient
PUT /api/patients/:id Update patient
DELETE /api/patients/:id Delete patient
GET /api/patients/search Search patients
GET /api/patients/stats Patient statistics
GET /api/patients/export Export data

Example Payload

{
  "name": "John Doe",
  "email": "john.doe@email.com",
  "birthDate": "1985-03-15",
  "address": "123 Main Street, Downtown, New York - NY, 10001"
}

πŸ§ͺ Testing

Frontend

cd frontend
npm test                      # Jest + React Testing Library
npm run test:coverage        # Test coverage

Backend

cd backend
npm test                      # Jest + Supertest
npm run test:integration     # Integration tests

🐳 Docker

Development

docker-compose up -d          # All services
docker-compose logs -f        # View logs in real-time
docker-compose down           # Stop all services

Production

docker-compose -f docker-compose.prod.yml up -d

πŸ“ˆ Monitoring and Performance

  • Structured logging with Winston
  • Performance metrics in backend
  • Smart caching with Redis
  • Query optimization in PostgreSQL
  • Lazy loading in frontend
  • Gzip compression enabled

πŸ”’ Security

  • Robust validation with Joi
  • Password hashing with bcryptjs
  • JWT for authentication
  • Rate limiting implemented
  • CORS configured
  • Helmet.js for security headers
  • SQL injection protection

πŸš€ Deployment

Docker (Recommended)

# Build images
docker-compose build

# Production deployment
docker-compose -f docker-compose.prod.yml up -d

Manual

  1. Configure PostgreSQL and Redis
  2. Set environment variables
  3. Run npm run build in frontend
  4. Run npm start in backend
  5. Configure reverse proxy (Nginx)

🀝 Contributing

  1. Fork the project
  2. Create a feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

πŸ“ Roadmap

  • Complete authentication with roles
  • Real-time notifications
  • Advanced dashboard
  • GraphQL API
  • E2E tests with Cypress
  • PWA (Progressive Web App)
  • Internationalization (i18n)
  • Data auditing

πŸ› Known Issues

  • Browser cache may cause stale data (solution: hard refresh)
  • ZIP code validation not implemented (accepts any format)

πŸ“œ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ‘¨β€πŸ’» Author

Pablo Tadini

Developed as a solution for the MedCloud Development Challenge Nine.


🎯 Challenge Requirements βœ…

This project meets all challenge requirements:

  • βœ… Complete CRUD for patients
  • βœ… Robust data validation
  • βœ… Responsive and modern interface
  • βœ… PostgreSQL database persistence
  • βœ… Documented RESTful API
  • βœ… Docker containerization
  • βœ… Automated testing
  • βœ… Complete documentation
  • βœ… Scalable architecture
  • βœ… Development best practices

Developed with ❀️ by Pablo Tadini for the MedCloud Challenge

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages