This API sends happy birthday messages to users on their birthday at exactly 9 am based on their time zone. It's designed with scalability and reliability in mind.
- Getting Started
- Prerequisites
- Installation
- Usage
- API Endpoints
- Testing
- Error Handling
- Contributing
- License
- Acknowledgments
These instructions will guide you on how to set up the project and run on both your local machine for development and testing purposes or your production server.
- Bun.sh
- PostgreSQL
You'll also need to set up environment variables. Copy the .env.example
to .env
and fill in your database credentials and other required configurations.
- Clone the repository:
git clone https://github.com/dimasyudhaproject/birthday-bun-ts.git -b dev birthday
- Navigate to the project directory:
cd birthday
- Install dependencies:
bun i
- Start the server:
bun start-dev
- Build the app to a Docker image:
docker build -t birthday-service:1.0.0 .
- Run the Docker container:
docker run -dit -p 3000:3000 --name birthday-service birthday-service:1.0.0
OR
- Install dependencies:
bun i --production --frozen-lockfile --verbose
- Build the app:
bun build-prod
- Start the server:
bun start-prod
Once the server is running, you can navigate to http://localhost:3000
to access the API or http://localhost:3000/api-docs
for the Swagger documentation.
POST /user
: Register a new userDELETE /user/:id
: Delete a user by IDPUT /user/:id
: Update user details
More details can be found in the Swagger documentation.
To run tests, execute:
bun test
The API returns appropriate status codes and messages for various error scenarios. Ensure to handle them gracefully in your applications.
We welcome contributions! Please read our CONTRIBUTING.md for details on our code of conduct and submission process.
This project is licensed under the MIT License. See the LICENSE.md file for details.
- Thanks to Allah SWT