A opinionated starter template for building REST APIs with Express, Drizzle ORM and PostgreSQL.
- User registration
- User verification via email
- User deletion
- Admin routes
Returns the user. Requires AUTH_TOKEN
in the request header.
Updates the user. Requires AUTH_TOKEN
in the request header.
User can only update themselves. Properties that can be updated are name
, email
and password
.
if email
is updated, the user will be unverified and a new verification email will be sent.
Creates a new user. Requires name
, email
and password
in the request body.
![](https://private-user-images.githubusercontent.com/59236972/287817809-f31e266e-68c3-44be-a0b2-d07c15ee83c6.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkxNjMwMjYsIm5iZiI6MTczOTE2MjcyNiwicGF0aCI6Ii81OTIzNjk3Mi8yODc4MTc4MDktZjMxZTI2NmUtNjhjMy00NGJlLWEwYjItZDA3YzE1ZWU4M2M2LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEwVDA0NDUyNlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWM0NTQxNjc1NWZmMzE2OWUxYjc2ZTExZDYzNDgyNTc3ODk4Yzg5M2MyODAwOWM2YmVmNWNlN2Q5N2UxYTRkYjkmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.e9RF9UDLfSw87M43Ibo-pHF5JWZm1bBXcpObTn1L0PE)
![](https://private-user-images.githubusercontent.com/59236972/287817833-f3763930-d88c-471c-85f3-eb7dfba350e5.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkxNjMwMjYsIm5iZiI6MTczOTE2MjcyNiwicGF0aCI6Ii81OTIzNjk3Mi8yODc4MTc4MzMtZjM3NjM5MzAtZDg4Yy00NzFjLTg1ZjMtZWI3ZGZiYTM1MGU1LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEwVDA0NDUyNlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWRmZGNmMmM0ZjI1Mjc0NmZkMGQ4NmRjOTEwOTRmN2FhYjYwZjI5YTkzZmU0ZTFjNmIwZjM0MzZhM2Y2OGFkYTQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.XvQgX0ZhXv1vd1o5pFM3XjN1-D8es1WJasWxHvjyen4)
Verifies the user. Requires token
and email
in the query string.
Removes the user. Requires AUTH_TOKEN
in the request header.
A user can only remove themselves. A admin can remove any user.
Logs in the user. Requires email
and password
in the request body.
Returns all users. It is an admin route, requires AUTH_TOKEN
.
Returns all verified users. It is an admin route, requires AUTH_TOKEN
.
Removes all unverified users. It is an admin route, requires AUTH_TOKEN
.
Install the dependencies
pnpm install
Run the development server:
pnpm dev