Giter Club home page Giter Club logo

nalanews-backend's Introduction

NalaNews Backend Node.js Express.js RESTful API

The frontend of this project can be found here (Angular)

Contents

Features:

  • Users/Authors can create their profiles (token-based authentication)
  • Users/Authors can edit their profile
  • Users/Authors can create blogs. They can set the country of their blog (i.e. philipines, unites states, united kingdom etc)
  • Users/Authors can create blogs. They can set the category of their blog (i.e. business, entertainment, general etc)
  • Blogs of a particular country can be viewed
  • Blogs of a particular category can be viewed

Tech used:

Runtime environment

  • Node.js
  • Express.js

Database

  • MongoDB

Image storage service

  • Cloudinary

Testing framework

  • Jest

Containerization tool

  • Docker

How to get the project:

Using Git (recommended)

  1. Navigate & open CLI into the directory where you want to put this project & Clone this project using this command.
git clone https://github.com/chesspamungkas/nalanews-backend

Using manual download ZIP

  1. Download repository
  2. Extract the zip file, navigate into it & copy the folder to your desired directory

Setting up environments

  1. There is a file named .env.example on the root directory of the project
  2. Create a new file by copying & pasting the file on the root directory & rename it to just .env
  3. The .env file is already ignored, so your credentials inside it won't be committed
  4. Change the values of the file. Make changes of comment to the .env.example file while adding new constants to the .env file.

Run the project using docker

  1. To build docker image

    docker compose build --no-cache
  2. To run the containers in detached mode (wait for a while for database connection)

    docker compose up -d
  3. To view running containers

    docker container ps
  4. To view API logs

    docker logs nalanews-api
  5. To run tests, first enter within the API container

    • on windows CMD (not switching to bash)
          docker exec -it nalanews-api /bin/sh
    • on windows CMD (after switching to bash)
          docker exec -it nalanews-api //bin//sh
      or
          winpty docker exec -it nalanews-api //bin//sh
    • now run test command
          npm test
  6. To exit from API container, press Ctrl+D on terminal

  7. To stop the containers bash docker compose down

API endpoints:

Indication

  • Authentication required
  • Authentication not required

User

Country

Category

Blog

nalanews-backend's People

Contributors

chesspamungkas avatar

Watchers

James Cloos avatar  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.