/klontong-api

REST API for Klontong app

Primary LanguageJavaScript

Requirements

  • NodeJS 18.x
  • PostgreSQL

🛠️ Installation Steps:

1. Clone this repository

git clone https://github.com/wyakaga/klontong-api.git

2. Change the working directory into folder directory

cd klontong-api

3. Install with npm

npm install

4. Create .env file

NODE_ENV = development
PORT = [your server port number]
JWT_SECRET = [your jwt secret]

DB_USERNAME = [your database username]
DB_PASSWORD = [your database password]
DB_NAME = [your database name]
DB_HOST = localhost

CLOUD_NAME = [your Cloudinary name]
CLOUD_KEY = [your Cloudinary key]
CLOUD_SECRET = [your Cloudinary secret]
CLOUD_FOLDER = [your Cloudinary folder name]

7. Migrate and seed database

migrate :

npx sequelize-cli db:migrate

seed :

npx sequelize-cli db:seed:all

6. Run with npm

npm run dev

👤 Demo Account

Admin :

email: admin@mail.com
password: admin123

Customer :

email: user@mail.com
password: user123

Table Structure

click this link to view it

Postman Documentation

Take a look at the postman collection to run the API by import it