Website: http://share.fh.iiitd.edu.in/
- Node - ^14.x
- NPM - ^8.1.x
- Python - ^3.6
- Pipenv - ^11.9.0
- Virtualenv - ^20.0.17
docker build -t shareiiit .
docker images
docker image rm e8a702109da7
docker run -d -p 3000:3000 --name react-app react-image
docker-compose up
docker-compose down
Change URL in Url.js according to your Backend site and run the following commands
cd frontend
npm install
npm run start
- Update the database details in settings.py and OSA Domain in settings.py
- Get inside the backend directory
cd backend
- Activate the virtual environment using either pipenv or virtualenv
pipenv shell
pipenv install
OR
virtualenv venv
source venv/bin/activate
pip install -r requirements.txt
- Create migrations
python manage.py makemigrations
python manage.py migrate
- If db needs to populated with categories and/or skills, run
python manage.py runscript init-db --script-args add-categories
python manage.py runscript init-db --script-args add-skills
-
Check .env file. For dev mode, set DJANGO_DEV as 'true' and 'false' for prod mode.
-
Start the server
python manage.py runserver
- Build the frontend code using
npm run build
on your local computer and push thebuild
folder to the repo git pull
on the entire code on ssh server- Copy frontend build folder to /var/www/
sudo cp -r frontend/build/* /var/www/share.osa.iiitd.edu.in/
- Install packages and update migrations of backend
source backend/venv/bin/activate
pip install -r requirements.txt
python backend/manage.py makemigrations
python backend/manage.py migrate
python backend/manage.py collectstatic --noinput
- Copy static folders of admin panel to /var/www/
sudo cp -r backend/staticfiles/* /var/www/share.osa.iiitd.edu.in/static/
- Restart Socket and Nginx
sudo systemctl restart share-iiitd.socket
sudo systemctl restart nginx
All commands are available in server.sh
The django project has been dividied into three parts based on the functionality: accounts, posts and messaging. The code corresponding to each part is inside that particular django app.
The code for notification generation is in posts/signals.py
file.
The scripts folder contains two scripts:
-
init-db script to initialize a db if required, the script makes use of skills.csv file which has been sourced from https://github.com/varadchoudhari/LinkedIn-Skills-Crawler
-
delete-posts to for permanent deletion of posts.