Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

medcore

A web application built with Flask.

Quick Start

  1. Activate virtual environment:

    source venv/bin/activate  # Linux/Mac
    venv\Scripts\activate    # Windows
  2. Install dependencies (if not already installed)

    pip install -r requirements.txt
  3. Set up environment variables

    cp .env.example .env
    # Edit .env file with your configuration
  4. Run the application

    python run.py

Your application will be available at http://localhost:5000

📁 Project Structure

medcore/
├── venv/                   # Virtual environment
├── medcore/             # Main application code
│   ├── api/                # API module
│   ├── auth/               # Authentication module
│   ├── models/             # Models module
│   ├── static/             # Static files (CSS, JS, images)
│       ├── uploads/
│   ├── templates/          # HTML templates (if web app)
│   └── app.py              # Main application file
├── tests/                  # Test files
├── docs/                   # Documentation
├── requirements.txt        # Python dependencies
├── .env                   # Environment variables (local)
├── .env.example          # Environment variables template
├── .gitignore            # Git ignore rules
├── run.py                # Application runner
└── README.md             # This file

🛠️ Development

Framework: Flask

Lightweight WSGI web application framework

Application Type: API Only

Available Endpoints

  • GET / - API welcome message
  • GET /health - Health check endpoint

Adding New Routes

Flask specific instructions:

'''

    # Add framework-specific route examples
    if framework == 'flask':
        readme_content += '''
from flask import Flask

@app.route('/new-route')
def new_route():
    return 'Hello from new route!'

''' elif framework == 'fastapi': readme_content += '''

from fastapi import FastAPI

@app.get("/new-route")
async def new_route():
    return {"message": "Hello from new route!"}

''' elif framework == 'django': readme_content += '''

  1. Add to app/urls.py:
path('new-route/', views.new_route, name='new_route'),
  1. Add to app/views.py:
def new_route(request):
    return JsonResponse({'message': 'Hello from new route!'})

''' elif framework == 'bottle': readme_content += '''

@app.route('/new-route')
def new_route():
    return {'message': 'Hello from new route!'}

''' elif framework == 'pyramid': readme_content += '''

  1. Add route in main():
config.add_route('new_route', '/new-route')
  1. Add view function:
@view_config(route_name='new_route', renderer='json')
def new_route_view(request):
    return {'message': 'Hello from new route!'}

🧪 Testing

Run tests with:

pytest tests/

📦 Deployment

Environment Variables

Make sure to set these in production:

  • SECRET_KEY: A secure secret key
  • DEBUG: Set to False in production
  • PORT: Port number for the application

Docker (Optional)

Create a Dockerfile:

FROM python:3.9-slim

WORKDIR /app

COPY requirements.txt .`
RUN pip install -r requirements.txt

COPY . .

EXPOSE 5000

CMD ["python", "run.py"]

🤝 Contributing

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

📄 License

This project is licensed under the MIT License.

🙏 Acknowledgments


Happy coding! 🎉

About

MedCore is a modem and comprehensive hospital management system

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages