Skip to content

This project is a backend microservice for managing risk matrices, companies, users, and related entities. It is built with FastAPI and uses PostgreSQL as the database via SQLAlchemy.

Notifications You must be signed in to change notification settings

jbeleno/Back_matriz

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Back_matriz

This project is a backend microservice for managing risk matrices, companies, users, and related entities. It is built with FastAPI and uses PostgreSQL as the database via SQLAlchemy.

Features

  • REST API for managing:
    • Companies
    • Users (with authentication)
    • Risk matrices
    • Risks
    • Impact and probability values
    • Affected objectives and phases
    • Mitigation actions
    • Objective types
  • CORS enabled for easy integration with frontends.
  • Database migrations handled automatically at startup.
  • Authentication endpoint for user login.

Project Structure

Back_matriz/
│
├── app/
│   ├── crud.py         # Database operations
│   ├── database.py     # Database connection and models base
│   ├── main.py         # FastAPI application and endpoints
│   ├── models.py       # SQLAlchemy models
│   ├── schemas.py      # Pydantic schemas
│   └── __init__.py
│
├── requirements.txt    # Python dependencies
├── Procfile            # For deployment (e.g., Heroku)
└── README.md

Installation

  1. Clone the repository and navigate to the Back_matriz directory.
  2. Install dependencies:
    pip install -r requirements.txt
  3. Set up your PostgreSQL database. The default connection string is in app/database.py.

Running the Service

You can run the API locally with:

uvicorn app.main:app --reload

Or, if deploying (e.g., on Heroku), the Procfile is already configured:

web: uvicorn app.main:app --host=0.0.0.0 --port=8000

API Endpoints

The API exposes endpoints for CRUD operations on all main entities. Example endpoints:

  • GET /empresas/ - List companies
  • POST /usuarios/ - Create user
  • POST /login - User authentication
  • GET /matrices/ - List matrices
  • ...and more for risks, impacts, probabilities, objectives, phases, mitigations, etc.

Technologies Used

  • FastAPI
  • SQLAlchemy
  • PostgreSQL
  • Pydantic
  • Uvicorn

License

Specify your license here.

About

This project is a backend microservice for managing risk matrices, companies, users, and related entities. It is built with FastAPI and uses PostgreSQL as the database via SQLAlchemy.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published