Skip to content

BuiKhanhHuy/myjob_api

Repository files navigation

Image

JOB PORTAL SYSTEM

MyJob Backend API (Django REST Framework)

Setup

👉 Clone repo

git clone https://github.com/BuiKhanhHuy/myjob_api.git
cd myjob_api

👉 Update the data in .env file

Create .env file

myjob_api/
  |-- ...
  |-- myjob_api
  |-- myjob
  |-- .env 👈
APP_ENV=local #(local or production)
DEBUG=True (True or False)
APPEND_SLASH=False (True or False)
ALLOWED_HOSTS=* (If there are multiple separated by comma ',')
CSRF_TRUSTED_ORIGINS=https://yourdomain
DB_ENGINE=django.db.backends.mysql
DB_HOST=
DB_NAME=myjob_db (your db name)
DB_PASSWORD=123456789 (your root mysql password)
DB_PORT=3306 (your mysql port)
DB_USER=root (default)
EMAIL_HOST=smtp.gmail.com
EMAIL_HOST_PASSWORD= (your password)
EMAIL_HOST_USER= (your email host user)
EMAIL_PORT=587
SERVICE_REDIS_HOST= (your redis host)
SERVICE_REDIS_PASSWORD= (your redis password)
SERVICE_REDIS_PORT= (your redis port) 
SERVICE_REDIS_USERNAME= (your redis username)
SERVICE_REDIS_DB= (your redis database)
SOCIAL_AUTH_FACEBOOK_KEY= (your facebook key)
SOCIAL_AUTH_FACEBOOK_SECRET= (your facebook secret)
SOCIAL_AUTH_GOOGLE_OAUTH2_KEY= (your google oauth2 key)
SOCIAL_AUTH_GOOGLE_OAUTH2_SECRET= (your google oauth2 secret)
TWILIO_ACCOUNT_SID= (your twilio account side)
TWILIO_AUTH_TOKEN= (your twilio auth token
TWILIO_PHONE= (your twilio phone)
CLOUDINARY_CLOUD_NAME= (your cloudinary cloud name)
CLOUDINARY_API_KEY= (your cloudinay api key)
CLOUDINARY_API_SECRET= (your cloudinay  api secret)
WEB_CLIENT_URL=http://localhost:3001 (your web client url)

👉 Run app

Docker

Manual (Windows)

 

docker compose -p myjob-api-project up -d 

 

python -m venv venv
venv\Scripts\activate
pip install -r requirements.txt
python manage.py migrate
python manage.py runserver 0.0.0.0:8001

→ New terminal in project

celery -A myjob_api.celery worker --pool=prefork --loglevel=info

→ New terminal in project

celery -A myjob_api beat -l info --scheduler django_celery_beat.schedulers:DatabaseScheduler

→ Import data from myjob_db.sql file at:

 myjob_api/
     |-- ...
     |-- myjob_api
     |-- myjob
     |-- data/
             |-- …
             | myjob_db.sql 👈

👉 Go to all API: http://localhost:8001/swagger/

Image

👉 Go to Admin page: http://localhost:8001/admin/

Image

Test administrator account:

Live demo

👉 Link:

👉 Test administrator account

dbdiagram

dbdiagram

Frontend repo link

🌐 Web-app