A web application for creating, managing, and generating PDF purchase orders with automatic signature generation.
- Create, edit, and duplicate purchase orders
- Automatic signature generation
- PDF generation with customizable layout
- User management system
- Responsive UI for desktop and mobile
- Python 3.8+
- Node.js 14+
- npm or yarn
- PostgreSQL
-
Install PostgreSQL if not already installed:
- On macOS:
brew install postgresql - On Ubuntu/Debian:
sudo apt-get install postgresql postgresql-contrib - On Windows: Download from https://www.postgresql.org/download/windows/
- On macOS:
-
Create the databases:
chmod +x backend/manage_db.sh ./backend/manage_db.shThen select option 5 to create the PostgreSQL databases.
The project uses a single virtual environment in the .venv directory at the project root. All scripts have been configured to use this environment.
-
Make the app.sh script executable:
chmod +x app.sh -
Setup the development environment:
./app.sh setup dev -
Setup the production environment:
./app.sh setup prod
This application supports separate development and production environments with isolated databases.
Run the development server with:
./app.sh dev
This will:
- Start the Django development server on port 8000
- Start the React development server on port 3000
- Use a separate PostgreSQL database for development (
po_generator_development)
Deploy to production with:
./app.sh prod
This will:
- Install PM2 if not already installed
- Set up the backend with all dependencies
- Run migrations on the production database
- Build the frontend
- Configure PM2 to run both the backend and frontend servers:
- Backend: http://localhost:8001
- Frontend: http://localhost:4567
To manage databases for both environments:
chmod +x backend/manage_db.sh
./backend/manage_db.sh
This script provides options to:
- Make migrations (environment-agnostic)
- Apply migrations to development database
- Apply migrations to production database
- Apply migrations to both databases
- Create PostgreSQL databases
- Create superuser in development
- Create superuser in production
To manage users in both environments:
chmod +x manage_users.sh
./manage_users.sh
This script provides options to:
- List users (all, active, staff, superusers) in development
- Create users in development
- Reset passwords in development
- List users (all, active, staff, superusers) in production
- Create users in production
- Reset passwords in production
- Log in with your credentials
- Navigate to the Purchase Orders page to view existing orders
- Click "Create New" to create a new purchase order
- Fill in the required fields and add line items
- Submit the form to create the purchase order
- Use the "Preview PDF" button to view the generated PDF
- Use the "Duplicate" button to create a copy of an existing purchase order
This project is licensed under the MIT License. See the LICENSE file for more details.