A Django-based Employee Management System with REST APIs, PostgreSQL, and Swagger documentation. Includes models for Employee, Department, Attendance, and Performance, plus seeded fake data for testing.
- Modular Django apps:
employees,department,attendance,performance - PostgreSQL database configuration via
.env - CRUD REST APIs for all models
- API documentation at
/swagger/(Swagger UI) - Database seeding with Faker
- Clone the repository
- Install dependencies
pip install -r requirements.txt - Configure environment variables
- Copy
.env.exampleto.envand fill in your secrets
- Copy
- Run migrations
python manage.py migrate
- Seed the database
python manage.py seed_data
- Start the server
python manage.py runserver
/api/employees/: Employee CRUD/api/departments/: Department CRUD/api/attendance/: Attendance CRUD/api/performance/: Performance CRUD
- Visit
/swagger/for interactive API docs (Swagger UI)
See .env.example for required variables:
POSTGRES_DB=employeedb
POSTGRES_USER=postgres
POSTGRES_PASSWORD=yourpassword
POSTGRES_HOST=localhost
POSTGRES_PORT=5432
Run python manage.py seed_data to generate 50 employees, departments, attendance, and performance records.
employee_project/
├── employees/
│ ├── models.py
│ ├── serializers.py
│ ├── views.py
│ └── management/commands/seed_data.py
├── department/
│ ├── models.py
│ ├── serializers.py
│ ├── views.py
├── attendance/
│ ├── models.py
│ ├── serializers.py
│ ├── views.py
├── performance/
│ ├── models.py
│ ├── serializers.py
│ ├── views.py
├── employee_project/
│ ├── settings.py
│ ├── urls.py
│ ├── swagger_urls.py
├── requirements.txt
├── .env.example
├── .env
├── README.md
- Django, Django REST Framework, drf-yasg, django-environ, Faker