Create User
Users
Create User
Create a new user in the system with email and password
POST
Create User
This endpoint creates a new user account in the PostgreSQL database using Prisma ORM. The user data is stored with the provided email and password.
Endpoint
Request Body
The user’s email address. Must be unique in the database.
The user’s password. This will be stored as provided (note: password hashing should be implemented for security).
Response
The unique identifier assigned to the newly created user
The email address of the created user
The password as stored in the database
Status Codes
- 201 Created - User successfully created
- 500 Internal Server Error - Database error or validation failure
Example Request
Example Response
Success (201)
Error (500)
Error Handling
Common errors include:- Duplicate email: If the email already exists in the database
- Missing required fields: If email or password is not provided
- Database connection issues: If the PostgreSQL database is unavailable
Implementation Details
The endpoint implementation (from/backend/index.js:24-36):