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.
-
[Robales Lopez, Lautaro Nicols]
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
Currently, two official plugins are available:
- @vitejs/plugin-react uses Babel for Fast Refresh
- @vitejs/plugin-react-swc uses SWC for Fast Refresh
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
toplugin:@typescript-eslint/recommended-type-checked
orplugin:@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 theextends
list
=======================================
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.
- 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:
-
Install Python 3.10 or higher using the package manager from you OS:
-
if macOS run using zsh:
brew install python
-
if Ubuntu/Debian run using bash:
sudo apt-get install python3
-
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
-
-
Install pip (Python package manager):
python -m ensurepip
to get the latest version of pip:
python -m pip install --upgrade pip
-
At the root of the project, create a virtual environment:
python -m venv venv
-
Activate the virtual environment using:
-
On macOS/Linux:
source venv/bin/activate
-
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.
-
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 orsudo apt-get install docker-compose
in Ubuntu/Debian -
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
anddocker-compose.yml
files at the root of the project. -
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
-
If defaults settings are used,the Django server should now be running on
http://localhost:8000/
-
You can access the Django admin panel (if the 'DEBUG' flag is set to True):
http://localhost:8000/_/` #using superuser credentials
-
You can access the API documentation with Swagger UI at
http://localhost:8000/api/swagger-ui/
or -
You can access the API documentation with ReDoc at
http://localhost:8000/api/redoc-ui/
-
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
-
to restart the container use:
docker start [container_id] #replace `[container_id]` with the container ID
-
to remove the image use:
docker rmi [backend] #replace `[backend]` with the image name
-
to remove the container and image use:
docker rm -f [container_id] #replace `[container_id]` with the container ID