- Node >= 14
- PostgreSQL
-
Run this code below
npm install
-
Set .env file
DB_USER = postgres DB_PASSWORD = postgres DB_NAME = express DB_HOST = 127.0.0.1 DB_PORT = 5432 DB_LOG = True # True or False FORCE_MIGRATE = True # True or False
if FORCE_MIGRATE True that will be automatically create created tables on database
-
Available command
npm run dev npm run debug npm run build
- Create user using this this
curl --location 'localhost:3000/user' \ --header 'Content-Type: application/json'\ --data-raw ' { "email": "v@a.com", "first_name": "aw", "last_name": "123", "birthday_date": "1993-07-28", "timezone": "Asia/Jakarta", "location": "Jakarta" }' - Delete using this
curl --location --request DELETE 'localhost:3000/user/1' - Update user using this
curl --location --request PUT 'localhost:3000/user/1' \ --header 'Content-Type: application/json' \ --data-raw '{ "email": "v@a.com", "first_name": "asd", "last_name": "sadasd", "birthday_date": "1993-07-28", "timezone": "Asia/Jakarta", "location": "Jakarta" }' - There is two cron running on this system which first cron is running every 30 minutes to get which user have a birthday at 9 AM on their local timezone and save to task table. And second Cron is running every 30 seconds to send Happy Birthday Email to Users based on task table sent status is false.