AlexRazor1337 / nest-article-service

Nest.js backend for Medium clone (article website)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

About the project

This is a simple NestJS application that uses the NestJS framework to create a REST API for a simple blog application. The application uses TypeORM to connect to a PostgreSQL database.

In the application you can register a user, login, write/update/delete and article, read global feed, (un)favorite any article and then look at favorite feed, leave a comment. Also you can look at other people profiles and follow them, to get them into your feed. The application uses JWT for authentication and authorization.

All routes are made according to RealWorld API Spec so it can work with any frontend implementation that is made according to this spec.

Installation

  1. Install the dependencies:

    $ npm install
  2. Host the database using Docker

    $ docker-compose up -d
  3. Fill .env file:

    DB_HOST="localhost"
    DB_NAME="nest-article"
    DB_USERNAME="admin"
    DB_PASSWORD="password"
    PORT=3000
    
  4. Migrate and the database

    $ npm run db:migrate
  5. (Optional) Seed the database with some data

    $ npm run db:seed

Running the app

# development with watch mode
$ npm run start:dev

# production mode
$ npm run start:prod

About

Nest.js backend for Medium clone (article website)


Languages

Language:TypeScript 98.8%Language:JavaScript 1.2%