Event Registration Website for Colleges
College Event Registration Website.
(used for Faces-2021)
Folder | Description |
---|---|
backend | Django App (Rest API) |
client | Next App (with SSR and SSG) |
Folder | Description |
---|---|
master | Main Branch which is deployed during registration |
registrations-closed | Deploy when registration Closed |
1. clone the repository
git clone https://github.com/rgab1508/FACES-21.git
cd FACES-21/
python -m virtualenv venv
.\venv\Scripts\activate (windows)
or
source venv/bin/activate (Linux)
cd backend/
pip intall -r requirements.txt
python manage.py makemigrations
python manage.py createsuperuser
python manage.py runserver
Production
Deploying in a Virtual Private Server
Setting up all the environment Variables required
export DJANGO_DEBUG=False
export OTP_VERIFY_SECRET='<RANDOM_LONG_STRING>'
Adding domain or IP in backend/backend/setting.py
ALLOWED_HOSTS = ['127.0.0.1', '<UR_DOMAIN_OR_PUBLIC_IP>']
or edit this file
export DB_NAME='<DATABASE_NAME>'
export DB_USERNAME='<DATABASE_USERNAME>'
export DB_PASSWORD='<DATABASE_PASSWORD>'
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': os.getenv("DB_NAME"),
'USER': os.getenv("DB_USERNAME"),
'PASSWORD': os.getenv("DB_PASSWORD"),
'HOST': 'localhost',
'PORT': '',
}
}
Development
Running locally
cd client/
npm install
npm run dev
cd client/
npm install
npm run build
npm run start
sudo vim /etc/nginx/sites-availabe/website
server {
root /var/www/html;
index index.html index.htm index.nginx-debian.html;
server_name <DOMAIN_OR_PUBLIC_IP>;
location /static {
alias <PATH_TO_STATICFILES>
# eg: /home/<USERNAME>/FACES-21/backend/staticfiles;
}
location /media {
alias <PATH_TO_MEDIA>
# eg: /home/<USERNAME>/FACES-21/backend/media;
}
location /admin/ {
include proxy_params;
proxy_pass http://unix:/run/gunicorn.sock;
}
location /api/ {
include proxy_params;
proxy_pass http://unix:/run/gunicorn.sock;
}
location / {
proxy_pass http://localhost:3000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
}