Welcome to the GC Portal repository. This is the official platform for the General Championship (GC) at IIT Bombay, developed and maintained by the ITC Web Team. The portal facilitates management and tracking of GC events and results.
The GC Portal is designed to manage and track the various General Championship (GC) events at IIT Bombay. It serves as a platform for event organizers, participants, and admins to view schedules, submit entries, and see results.
The website is live at itc.gymkhana.iitb.ac.in/techgc.
- Frontend: React, Tailwind CSS
- Backend: Django REST Framework (DRF)
- Database: PostgreSQL
- Others: GitHub Actions for CI/CD, Nginx, Gunicorn
To get started with the project locally, follow the steps below.
Ensure you have the following installed:
- Python (v3.8+)
- Node.js (v14+), npm or yarn
- PostgreSQL
- Django (v3.2+)
-
Clone the repository:
git clone https://github.com/ITC-Web-Team/GC_Portal.git
-
Navigate to the backend directory:
cd GC_Portal/backend -
Create a virtual environment:
python -m venv env
-
Activate the virtual environment:
- On macOS/Linux:
source env/bin/activate - On Windows:
.\env\Scripts\activate
- On macOS/Linux:
-
Install the required Python dependencies:
pip install -r requirements.txt
-
Set up your PostgreSQL database:
Open PostgreSQL and create the database:
CREATE DATABASE gc_portal; CREATE USER gc_user WITH PASSWORD 'yourpassword'; GRANT ALL PRIVILEGES ON DATABASE gc_portal TO gc_user;
-
Add your database connection information in a
.envfile:DATABASE_URL=postgres://gc_user:yourpassword@localhost:5432/gc_portal
-
Apply the migrations:
python manage.py migrate
-
Create a superuser for the Django admin panel:
python manage.py createsuperuser
-
Navigate to the frontend directory:
cd ../frontend -
Install the Node.js dependencies:
npm install
or
yarn install
-
Configure the API URL in the environment file (if necessary):
REACT_APP_API_URL=http://localhost:8000/api
-
Start the Django backend:
cd ../backend python manage.py runserver -
In a new terminal, start the React frontend:
cd ../frontend npm startor
yarn start
The React frontend will be running at http://localhost:3000 and the Django backend will be at http://localhost:8000.
We welcome contributions from the ITC Web Team and external developers. To contribute:
- Fork the repository.
- Create a new branch for your feature or bugfix.
- Commit your changes and submit a pull request.
-
Use Prettier and ESLint for frontend code formatting:
npm run lint
-
For backend (Django), ensure the code follows PEP 8 standards and format with
black:black .
The website is deployed using GitHub Actions and managed on a server using Nginx and Gunicorn.
-
SSH into the server:
ssh user@server_ip
-
Pull the latest code from the
mainbranch:git pull origin main
-
Navigate to the backend directory and apply migrations:
cd backend python manage.py migrate -
Collect static files for Django:
python manage.py collectstatic
-
Restart Gunicorn and Nginx:
sudo systemctl restart gunicorn sudo systemctl restart nginx
This project is licensed under the MIT License.