Giter VIP home page Giter VIP logo

dicoding-forum-api-main's Introduction

dicoding-forum-api

CI codecov

Back-End Expert project assignment from dicoding.com. With this assignment, students are expected to be able to create a back-end application in the form of a RESTful API that is testable, scalable, reliable, agile, easy and fast to deploy, and has reliable security by industry standards.

Features

  • User Registration.
  • Login and Logout.
  • Adding Threads.
  • Viewing Threads.
  • Adding and Deleting Thread Comments.
  • Adding and Deleting Replies to Thread Comments.
  • Like and Dislike Comment.

Project utils

Project Setup

  1. Add .env to the project root with the configuration below:

    # Server config
    HOST=<your server host>
    PORT=<desired port for nodejs>
    
    # PostgreSQL config
    PGHOST=<psql server host>
    PGPORT=<psql server port>
    PGUSER=<psql user>
    PGPASSWORD=<psql password>
    PGDATABASE=<desired database>
    
    # PostgreSQL config for testing
    PGHOST_TEST=<psql server host>
    PGPORT_TEST=<psql server port>
    PGUSER_TEST=<psql user>
    PGPASSWORD_TEST=<psql password>
    PGDATABASE_TEST=<desired database>
    
    # JWT config
    ACCESS_TOKEN_KEY=<random string>
    REFRESH_TOKEN_KEY=<random string>
    ACCESS_TOKEN_AGE=<duration in ms>
  2. Add test.json to the config/db folder with the test config from .env.

    {
      "host": "PGHOST_TEST",
      "port": PGPORT_TEST,
      "user": "PGUSER_TEST",
      "password": "PGPASSWORD_TEST",
      "database": "PGDATABASE_TEST",
    }
  3. Run the commands below to install dependencies and setup the database:

    npm install
    npm run pgm up
    npm run pgm:test up

dicoding-forum-api-main's People

Contributors

andre-arc avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.