This is a Django REST Framework project for an Employee Management System. It provides a set of APIs for managing employees, departments, attendance, and performance.
- Employee Management: Create, retrieve, update, and delete employee records.
- Department Management: Organize employees into departments.
- Attendance Tracking: Log daily employee attendance.
- Performance Evaluation: Track and manage employee performance.
- API Documentation: Interactive API documentation with Swagger UI.
- Data Visualization: A dashboard with charts to visualize key metrics.
Follow these instructions to set up and run the project locally.
- Python 3.8+
- pip (Python package installer)
-
Clone the repository:
git clone git@github.com:wouyang2/Intern_Final_Backend_Project.git cd Intern_Final_Backend_Project -
Create a virtual environment (recommended):
python -m venv venv source venv/bin/activate -
Install the required packages:
pip install -r requirements.txt
-
Run database migrations:
python manage.py makemigrations python manage.py migrate
-
Create a superuser to access the Django admin panel:
python manage.py createsuperuser
-
Once created your own user account, obtain an API token by making a POST request to the api/api-token-auth/ endpoint.
curl -X POST \ http://127.0.0.1:8000/api-token-auth/ \ -H 'Content-Type: application/json' \ -d '{"username": "your_username", "password": "your_password"}'
-
(Optional) Seed the database with sample data:
python manage.py seed_data
Start the Django development server:
python manage.py runserverThe project includes interactive API documentation generated by drf-yasg. You can access it at the following URLs:
- Swagger UI (Interactive):
http://127.0.0.1:8000/swagger/
A simple dashboard with key metrics is available. Once the server is running, you can view the charts at:
- Dashboard:
http://127.0.0.1:8000/api/chart