This is a web application designed to manage the activities and events of the Erasmus Student Network at Politecnico di Milano. The system is built using Django (backend) and React (frontend), providing a modern and efficient user experience.
Copyright © 2025 Erasmus Student Network – Politecnico di Milano. This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Please refer to the LICENSE file for more details.
main: Stable, production-ready code. Only tested and approved code is merged here.development: Staging area for new features and fixes. All work is merged here before moving tomain.
-
Create a branch:
-
For every new feature or fix, create a new branch.
-
Naming conventions:
- Feature:
feature/feature-name - Bugfix:
fix/bug-name
- Feature:
-
-
Develop:
- Implement your changes.
- Ask teammates for support if needed.
- Test everything locally before pushing.
-
Open a Pull Request (PR):
- Once finished, open a PR targeting the
developmentbranch.
- Once finished, open a PR targeting the
-
Review:
- Your PR will be reviewed.
- Once approved, it will be merged into
development.
Clone the repository from the development branch:
git clone -b development git@github.com:esnpolimi/mgmt.gitNavigate into the project folder. You will find two main subfolders:
backend/frontend/
⚠️ Important: Request private files from a teammate, as they are not included in the public repository for security reasons.
-
Install Docker.
- Windows: Use Docker Desktop (ensure the daemon is running).
- macOS/Linux: Install via package manager or Docker website.
-
From the project root (where
local.ymlis located), run:-
Build the containers (first time or after changes to
Dockerfile/requirements.txt):docker compose -f local.yml build
-
Start the containers:
docker compose -f local.yml up
-
-
Reserve ports
8000,3000,8080, and3306.-
Windows:
netsh int ipv4 add excludedportrange protocol=tcp startport=3000 numberofports=1 netsh int ipv4 add excludedportrange protocol=tcp startport=8000 numberofports=1 netsh int ipv4 add excludedportrange protocol=tcp startport=8080 numberofports=1 netsh int ipv4 add excludedportrange protocol=tcp startport=3306 numberofports=1 netsh int ipv4 show excludedportrange protocol=tcp
-
macOS/Linux: Normally no port reservation is needed, but make sure no services are running on those ports.
-
-
Access the services:
- Backend: http://localhost:8000
- Frontend: http://localhost:3000
Next step is to import a local copy of a database dump (SQL file) into your local MySQL server:
- After running the Docker 'mgmt' container, access the url
http://localhost:8080to open phpMyAdmin. - Login with user
userand passwordpassword - Click on the
newgestdatabase, then Check All tables and Drop them, making sure no tables are present anymore - Click on the
Importtab, then choose the SQL file and clickImport(leave all other options as default)
-
Install Python 3.11 (the same version used in the Dockerfile) and add it to your PATH.
-
Create and activate a virtual environment:
python3.11 -m venv venv # macOS/Linux source venv/bin/activate # Windows (Command Prompt) venv\Scripts\activate # Windows (PowerShell) .\venv\Scripts\Activate.ps1
-
Install dependencies:
cd backend pip install -r requirements.txt -
Set environment variables and run the server:
-
macOS/Linux:
DJANGO_ENV=dev DJANGO_SETTINGS_MODULE=backend.settings.dev python manage.py runserver
-
Windows (Command Prompt):
set DJANGO_ENV=dev && set DJANGO_SETTINGS_MODULE=backend.settings.dev && python manage.py runserver
-
Windows (PowerShell):
$env:DJANGO_ENV="dev"; $env:DJANGO_SETTINGS_MODULE="backend.settings.dev"; python manage.py runserver
-
To confirm the environment is set correctly, temporarily add this snippet to manage.py:
import os
print("DJANGO_ENV:", os.getenv("DJANGO_ENV", "Not Set"))
print("DJANGO_SETTINGS_MODULE:", os.getenv("DJANGO_SETTINGS_MODULE"))When running runserver, you should see development or production.
-
Install Node.js version 22 (same as in the Dockerfile).
-
Install dependencies:
cd frontend npm install -
Run the frontend:
-
Development mode:
npm run dev
Access it at http://localhost:3000.
-
Production build:
npm run build
-
Preview production build locally:
npm run preview
-
cd backend
pip install <package> # Installs the package in your venv
pip freeze > requirements.txt # Updates requirements.txt with installed packagespip freeze overwrites the file with all installed packages. Ensure only required packages are included.
To update all packages:
pip install pip-upgrader
pip-upgradecd frontend
npm install <package> # Installs the package and updates package.jsonTo update all packages:
npm install -g npm-check-updates
npx npm-check-updates -u
npm install