This repository contains an API for the Company Database, built using the Django framework and Django Rest Framework (DRF). The project is inspired by the concepts discussed in Fundamentals of Database Systems by Ramez Elmasri.
The Company Database API allows users to interact with company-related data. It provides endpoints for querying, adding, updating, and deleting information related to:
- Departments: Handle department information, including department names.
- Employees: Manage employee records, including details such as first name, last name, email, salary, and department.
- Dependents: Track dependents associated with employees (family members).
Currently these entities implemented in the future I will implement the rest.
- Employee Information:
- Retrieve employee details by ID.
- Search for employees based on criteria (e.g., department, age).
- Add new employees to the database.
- Update employee records (e.g., salary, first_name, last_name).
- Department Management:
- List all departments.
- View department details.
- Create new departments.
- Dependent Records:
- Associate dependents with employees.
- Retrieve dependent details for a specific employee.
- Update dependent information.
- Clone this repository to your local machine:
git clone https://github.com/YoussufShakweh/companyapi.git cd companyapi
- Create a Virtual Environment and activate it:
virtualenv venv source venv/bin/activate
- Install the necessary dependencies (e.g., Python, Django, DRF) using this command:
pip3 install -r requirements.txt
- Set up your database (e.g., PostgreSQL, MySQL) and configure Django accordingly.
- Run migrations to create the database schema:
python manage.py migrate
- Start the development server:
python manage.py runserver
- Access the API endpoints via http://localhost:8000
You can access the API docs via:
- Swagger docs: http://localhost:8000/company/swagger
- Redoc docs: http://localhost:8000/company/redoc
Contributions are welcome! If you find any issues or want to enhance the API, feel free to submit a pull request.
- Ramez Elmasri: Author of the book that inspired this project.
- Youssuf Shakweh: Creator of this API.
This project is licensed under the MIT license - see the LICENSE file for details.