The User Service is one of 3 microservices for the Ada Developers Academy Cloud Curriculum e-commerce application. It handles the creation and management of user accounts in the e-commerce system.
- User — represents a customer account, containing
first_name,last_name,email, andis_admin
| Method | Path | Description |
|---|---|---|
| GET | / |
Health check |
| POST | /users/ |
Create a new user |
| GET | /users/ |
Get all users (supports query filters) |
| GET | /users/<id> |
Get a single user by ID |
| GET | /users/email |
Get a single user by email |
| PUT | /users/<id> |
Update a user by ID |
| DELETE | /users/<id> |
Delete a user by ID |
- Python 3.13+
- PostgreSQL
- AWS account or local AWS credentials (for SQS consumer)
git clone <repo-url>
cd user-servicepython3 -m venv venv
source venv/bin/activatepip install -r requirements.txtCreate a .env file in the project root:
SQLALCHEMY_DATABASE_URI=postgresql+psycopg2://postgres:postgres@localhost:5432/user_service_db
SQLALCHEMY_TEST_DATABASE_URI=postgresql+psycopg2://postgres:postgres@localhost:5432/user_service_test_db
psql -U postgres
# Inside psql CLI
CREATE DATABASE user_service_db;
CREATE DATABASE user_service_test_db;flask db upgradeflask run --debugpytest