Skip to content

Seminario-Integrador-2024/GestionTUP

Repository files navigation

๐Ÿ’ป Sistema de Gestion TUP ๐Ÿš€ ๐Ÿ“š

GitHub followers License FrontCI Pipeline

Django Python React TypeScript Vite Docker Docker Compose ESLint Prettier Google Cloud

Run on Google Cloud

Table of Contents

About the project

Team project for the Seminario Universitario course at the UTN - FRRe. The project consists of a web application for managing the TUP (Tecnicatura Universitaria en Programacion) of the students of the UTN - FRRe. The project is divided into two parts, the frontend and the backend. The frontend is developed using React/TS/Vite and the backend using Python with Django/DRF.

Team

Documentation

Frontend Documentation (React)

React + TypeScript + Vite

This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.

Currently, two official plugins are available:

Expanding the ESLint configuration

If you are developing a production application, we recommend updating the configuration to enable type aware lint rules:

  • Configure the top-level parserOptions property like this:
export default {
  // other rules...
  parserOptions: {
    ecmaVersion: "latest",
    sourceType: "module",
    project: ["./tsconfig.json", "./tsconfig.node.json"],
    tsconfigRootDir: __dirname,
  },
};
  • Replace plugin:@typescript-eslint/recommended to plugin:@typescript-eslint/recommended-type-checked or plugin:@typescript-eslint/strict-type-checked
  • Optionally add plugin:@typescript-eslint/stylistic-type-checked
  • Install eslint-plugin-react and add plugin:react/recommended & plugin:react/jsx-runtime to the extends list

=======================================

Backend

This section is used for setting up the backend Django server, using Python and Django REST framework, along with 3th party libraries like drf-spectacular for API documentation.

This deployment is done using the Dockerfile. This template provides a minimal setup to get Python working in a Django web server.

Setting up the backend for Development

  • Tools needed:
    • Shell (bash, zsh, PowerShell, etc.)
    • Python 3.10 or higher
      • pip (Python package manager)
    • Docker
      • Docker Compose (optional)
    • Visual Studio Code (optional - recommended)

Steps to set up the backend environment:

  1. Install Python 3.10 or higher using the package manager from you OS:

    1. if macOS run using zsh:

      brew install python
    2. if Ubuntu/Debian run using bash:

      sudo apt-get install python3
    3. if Windows run using PowerShell or PowerShell Core:

      winget install python

      Note: If you are using a different OS, or prefer a manual installation, please refer to the official Python download page

  2. Install pip (Python package manager):

    python -m ensurepip

    to get the latest version of pip:

    python -m pip install --upgrade pip
  3. At the root of the project, create a virtual environment:

    python -m venv venv
  4. Activate the virtual environment using:

    1. On macOS/Linux:

      source venv/bin/activate
    2. On Windows:

      .\venv\Scripts\Activate

    Note:

  • You can deactivate the virtual environment using the deactivate command, once you are done working on the project.
  • A complete list of python dependencies can be found in the requirements.txt file at the root of the project.

Setting up the Docker container for testing server

  1. Install Docker using the official downloader Docker Desktop, or using the package manager from your OS: 1.On macOS run:

     brew install docker

    2.On Linux/Debian run:

     sudo apt-get install docker

    1.On Windows run:

     winget install docker

    Note: You may also need to install Docker Compose using brew install docker-compose in macOS or sudo apt-get install docker-compose in Ubuntu/Debian

  2. Build the Docker image using at the root of the project:

    docker build -t [backend] . #replace `[backend]` with the desired image name

    Docker settings can be configured in the Dockerfile and docker-compose.yml files at the root of the project.

  3. Run the Docker container using

    docker run -p 8000:8000 [backend] #replace `[backend]` with the image name used in the previous step.

    You can also run the container in the background using the -d flag or specify a different port using -p [host_port]:8000

  4. If defaults settings are used,the Django server should now be running on

    http://localhost:8000/
  5. You can access the Django admin panel (if the 'DEBUG' flag is set to True):

    http://localhost:8000/_/` #using superuser credentials
  6. You can access the API documentation with Swagger UI at http://localhost:8000/api/swagger-ui/ or

  7. You can access the API documentation with ReDoc at http://localhost:8000/api/redoc-ui/

  8. to stop the container press Ctrl + C in the terminal where the container is running.

    *If the container is running in the background use:

    docker ps #get the container ID

    and then:

    docker stop [container_id] #replace `[container_id]` with the container ID
  9. to restart the container use:

    docker start [container_id] #replace `[container_id]` with the container ID
  10. to remove the image use:

    docker rmi [backend] #replace `[backend]` with the image name
  11. to remove the container and image use:

   docker rm -f [container_id] #replace `[container_id]` with the container ID