A Flask-based web application for managing employees. The application supports adding, editing, and deleting employees, and displays a list of all employees.
- Docker
- Postgres
-
Clone the repository:
git clone <repository_url> cd flask_postgres_employee_app
-
Add your database credentials to the
docker-compose.yml
file:services: db: image: postgres:13 environment: POSTGRES_DB: <database_name> POSTGRES_USER: <database_user> POSTGRES_PASSWORD: <database_password>
-
Add your database credentials to the
app.py
file:app.config['SQLALCHEMY_DATABASE_URI'] = 'postgresql://<database_user>:<database_password>@db:5432/<database_name>'
-
Build and run the Docker container:
docker-compose up --build
-
Run database migrations:
docker-compose exec web flask db upgrade
-
Access the application: Open your browser and navigate to
http://localhost:5000/
.
-
Add Employee:
- Fill out the form with the employee's name, email, and phone number.
- Click "Add Employee".
-
Edit Employee:
- Click the "Edit" link next to the employee you want to edit.
- Update the employee's information in the form.
- Click "Update".
-
Delete Employee:
- Click the "Delete" link next to the employee you want to delete.