A web platform connecting researchers in Mexico to collaborate on projects, articles, and events. Designed as a specialized networking tool for the CIATEQ community, it helps researchers find collaborators based on expertise, fostering interdisciplinary cooperation.
This guide will help you set up the project on either Mac or Windows.
- Docker and Docker Compose
- Git
git clone https://github.com/amirmx2905/Investigators.git
cd InvestigatorsCreate a .env file in the Investigators directory with the following content:
# Django settings
DEBUG=True
SECRET_KEY=[|/Ur0JeBDBvuE=?%60p.I9]?V9~rKj{ASSb](O-kzVA\zM>FU #Change this secret key to a random value in production
ALLOWED_HOSTS=localhost,127.0.0.1
CORS_ALLOWED_ORIGINS=http://localhost:5173,http://localhost:80,http://localhost
# Database settings
DB_ENGINE=django.db.backends.postgresql
DB_NAME=investigators
DB_USER=postgres
DB_PASSWORD=your_password # Make sure to use a strong password
DB_HOST=db
DB_PORT=5432
# Frontend settings
VITE_API_URL=http://localhost/api
TIME_ZONE=UTCNote: In the .env file you should only change the DB_PASSWORD field (for database security). The other variables are configured to work with the Docker setup and should remain as provided.
The first time you start the Docker containers you should use the following command:
docker-compose up --buildThis command will:
- Build all necessary Docker images (the --build flag ensures everything is built from scratch)
- Create containers for PostgreSQL, Django backend, React frontend, and Nginx
- Set up networking between containers
- Load initial test data into the database
- Start all services
Once all containers are running, you can access:
- Frontend: http://localhost/
- API: http://localhost/api/
- API Documentation: http://localhost/api/docs/
The applicacion comes with a pre-configured admin user to access the frontend:
- Username: admin
- Password: admin
To stop all containers, use the following command:
docker-compose downAfter the initial build, you can use the following command:
docker-compose up
#or ctrl+cIf you make changes to the code and need to rebuild:
docker-compose up --buildInvestigators/
├── backend/ # Django backend
│ ├── investigators/ # Main app
│ ├── project/ # Project settings
│ ├── manage.py # Django management script
│ └── requirements.txt
├── frontend/ # React frontend
│ ├── src/ # Source code
│ ├── package.json # Node dependencies
│ └── vite.config.js # Vite configuration
├── nginx/ # Nginx configuration for production
│ ├── conf/ # Config files
│ └── Dockerfile # Nginx Docker image
├── docker-compose.yml # Docker services configuration
└── .env # Environment variablesYou can access the PostgreSQL database using:
# Connect to the PostgreSQL container
docker exec -it investigators-db-1 bash
# Connect to the database
psql -U postgres -d investigators
# Within psql, you can run SQL queries
# For example, list all tables:
\dtOr using a database tool like DBeaver, connect with:
Host: localhost
Port: 5433 (mapped port in docker-compose)
Database: investigators
User: postgres
Password: your_password (or whatever you set in .env)If you see errors about ports already in use:
# Stop any current PostgreSQL service
sudo service postgresql stop # Linux
brew services stop postgresql # MacOr change the external port in docker-compose.yml
ports:
- "5433:5432" # Change 5433 to any available portCheck the logs for specific errors:
docker-compose logs backend
docker-compose logs frontend
docker-compose logs nginxThis project is licensed under the MIT License - see the LICENSE file for details.