/jokopi

Backend rest api for jokopi app

Primary LanguageJavaScript

alt text

Tech Stack

jokopi.

Rest API for jokopi app!

Demo · Related Projects

Powered by Vercel ⚡


Table of Contents

Overview

Jokopi REST API is a backend server implementation designed for a coffee shop using the Express framework. It provides a robust and scalable solution for managing various aspects of a coffee shop's operations, such as menu items, orders, customer information, and more.

The REST API follows the principles of Representational State Transfer (REST), which enables easy integration with various clients, including web and mobile applications. It utilizes the HTTP protocol for communication, allowing clients to perform operations such as retrieving, creating, updating, and deleting resources.

Features

  • Authorization & Authentication
  • Upload Images
  • CRUD (Products, User, Transactions, Promo)
  • Whitelisting JWT
  • Remote Notification to Android & iOS App
  • Error Handling & Validation

Tech Stack

Getting Started

Prerequisites

Instalation & Environments

  1. Clone this repository to your local

    git clone https://github.com/nyannss/jokopi.git
  2. Install dependencies

    cd jokopi && npm install
  3. Setup environments (you can see in .env.example)

    • Database server using postgreSQL

      DB_HOST = (put your db host)
      DB_PORT = (put your port of db host)
      DB_USER = (put your db username)
      DB_PASS = (put your db password)
      DB_NAME = (put your db  name)
    • JSON Web Token Secret Key (prefer using random string) [see more information]

      JWT_SECRET_KEY = (put your secret key)
    • Database server using MongoDB [you can create account in here]

      MONGODB_HOST = (put your mongodb host)
      MONGODB_USER = (put your mongodb user)
      MONGODB_PASS = (put your mongodb password)
      MONGODB_NAME = (put your mongodb database name)
    • Image server using Cloudinary [you can create account in here]

      CLOUDINARY_NAME = (put your cloudinary name)
      CLOUDINARY_KEY = (put your cloudinary key)
      CLOUDINARY_SECRET = (put your cloudinary secret)
    • SMTP Authentication for sending email (use gmail for free) [more info]

      SMTP_HOST = (put your smtp host)
      SMTP_EMAIL = (put your smtp email/username)
      SMTP_PASS = (put your smtp password)
    • Firebase Admin (generate service-account json and encode base64) [see more]

      GOOGLE_APPLICATION_CREDENTIALS = (your encoded service-account.json content)
  4. Last, run the app

    npm run app

Postman Documentation

You can see the documentation from Postman or import it with json file.

If you using json file, just open your postman and click import.

Table Structure

For PostgreSQL, You can download table structure (ddl) from this link.

For MongoDB, You just setup and define it to env the database, it will be automatically created by mongoose.

Related Projects

Contributors

License

This project using ISC License

Report

Any error report you can pull request or contact: nyannss@proton.me