GitHunt

Full Stack - Personnel List App - Backend

Table of Contents

Overview

  • This is the backend side of my Personnel list app project.
  • I used reactjs for frontend.
    You can see the frontend side of this project from here ๐Ÿ‘ˆ

Project Info

  • Department and Personnel tables are interconnected and each department has its own personnel..
  • Company personnel who have logged into the system can see the departments of the company and the personnel working under those departments in detail.
  • Staff members can add or update new staff to the department list.
  • Only superusers will have the authority to delete staff.
  • We will construct this structure using a generic view. In order to override Class methods, we will provide if-else structures that should act accordingly whether the person is a staff or superuser. We will use IsAuthenticated from Rest framework permissions.
  • I used nested serializer and method fields in our serializer.
  • I used the cors-headers package to connect the frontend to our API.
  • You can perform staff operations using the following account information:
    • userName: michaelscott
    • password: Littlekidlover1

Entity Relationship Diagram

erd

You can reach my project from here ๐Ÿ‘ˆ

Preview of the Project

personal-back

Built With

  • Django
  • Django Rest Framework
  • Django Rest Auth
  • Django Cors Headers

Project Structure

.โ”€โ”€โ”€โ”€ django-personnel-app-backend (repo)
โ”‚
โ”œโ”€โ”€ main
โ”‚ย ย    โ”œโ”€โ”€ __pycache__
โ”‚ย ย    โ”œโ”€โ”€ __init__.py
โ”‚ย ย    โ”œโ”€โ”€ asgi.py
โ”‚ย ย    โ”œโ”€โ”€ urls.py
โ”‚ย ย    โ”œโ”€โ”€ wsgi.py
โ”‚ย ย    โ””โ”€โ”€ settings.py
โ”‚โ”€โ”€โ”€ personalApp
โ”‚ย       โ”œโ”€โ”€ __pycache__
โ”‚       โ”œโ”€โ”€ migrations
โ”‚ย       โ”‚โ”€โ”€ __init__.py
โ”‚ย       โ”œโ”€โ”€ admin.py
โ”‚ย       โ”œโ”€โ”€ apps.py
โ”‚ย       โ”œโ”€โ”€ models.py
โ”‚ย       โ”œโ”€โ”€ serializers.py
โ”‚ย       โ”œโ”€โ”€ signals.py
โ”‚       โ”œโ”€โ”€ tests.py
โ”‚       โ”œโ”€โ”€ urls.py
โ”‚ย       โ””โ”€โ”€ views.py
โ”œโ”€โ”€โ”€โ”€ users
โ”‚       โ”œโ”€โ”€ __pycache__
โ”‚       โ”œโ”€โ”€ migrations
โ”‚       โ”œโ”€โ”€ __init__.py
โ”‚       โ”œโ”€โ”€ admin.py
โ”‚       โ”œโ”€โ”€ apps.py
โ”‚       โ”œโ”€โ”€ models.py
โ”‚       โ”œโ”€โ”€ serializers.py
โ”‚       โ”œโ”€โ”€ signals.py
โ”‚       โ”œโ”€โ”€ tests.py
โ”‚       โ”œโ”€โ”€ urls.py
โ”‚       โ””โ”€โ”€ views.py
โ”œโ”€โ”€ manage.py
โ”œโ”€โ”€ db.sqlite3
โ”œโ”€โ”€ debug.log
โ”œโ”€โ”€ requirements.txt
โ””โ”€โ”€ .env

How To Use

To clone and run this application, you'll need Git

# Clone this repository
$ git clone https://github.com/esadakman/django-personnel-app-backend

# Install dependencies
    $ py -m venv env
    > env/Scripts/activate (for win OS)
    $ source env/bin/activate (for macOs/linux OS)
    $ pip install -r requirements.txt


# Add .env file for secret key and set your secret_key

- Create a .env file for =>
  -- SECRET_KEY,

- After these you can run the project as usual =>
    $ py manage.py migrate
    $ py manage.py createsuperuser

# Run the app
    $ python manage.py runserver

Contact

esadakman/django-personnel-app-backend | GitHunt