Code Monkey home page Code Monkey logo

dmytro-chushko / article-manager Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 270 KB

Article managment project. Articles are parsing every minute from RSS feed. Articles are managed (CRUD) in the admin panel, accsess to the panel is closed by authorization. There is also a public route that displays a list of articles with pagination/sorting/search

JavaScript 2.17% TypeScript 96.78% HTML 0.71% Dockerfile 0.34%
docker-compose i18n jwt material-ui nestjs postgresql react-hook-form redux redux-toolkit typeorm vite-react-typescript yup-validation

article-manager's Introduction

Article-manager. Article menegment project

Article managment project. Articles are parsing every minute from RSS feed. Articles are managed (CRUD) in the admin panel, accsess to the panel is closed by authorization. There is also a public route that displays a list of articles with pagination/sorting/search

Installation:

Clone the repo from comand line:

$ git clone https://github.com/dmytro-chushko/article-manager.git
$ cd article-manager

Install packeges in ./clinet and ./server directory:

$ cd clinet
$ npm i
$ cd ..
$ cd server
$ npm i
$ cd ..

To run the project:

To run with Docker:

  1. Make sure you have an actual version of Docker installed on your computer. Download and install if it is necessary.
  2. Configure .env files in both ./client and ./server directories like described below
  3. Staying in root directory build the docker images from command line:
$ docker-compose build
  1. Run the project:
$ docker-compose up
  1. You may change settings in docker-compose.yml file

To run from your local machine:

  1. Make sure you have a version of Node.js not lower than 18.18.1 installed on your computer. Download and install if it is necessary.
  2. Make sure you have PostgreSQL database. Download and install if it is necessary.
  3. Configure .env files in both ./client and ./server directories like described below
  4. Being in the ./server directory run the back-end application from the command line:
$ npm run start:dev
  1. Being in the ./client directory run the front-end application from the command line:
$ npm run dev

Navigate to the address in your browser http://localhost:5173. This page will automatically reload after saving changes to project files.
Navigate to the address in your browser http://localhost:8090/api/docs to see the Swagger API documentation.

Configuration of the .env files:

For front-end application:

Create .env file in the ./client diretory and set this variable:

  • VITE_BASE_URL = backend application host name

For back-end application:

Create .development.env file in the ./server directory and set the next variables:

  • PORT = application port
  • DB_TYPE = postgres
  • POSTGRES_HOST = database host
  • POSTGRES_POR T= database port
  • POSTGRES_USER = database user
  • POSTGRES_PASSWORD= database password
  • POSTGRES_DB = databasee name
  • NEWS_DATA_API_BASE_URL = newsdata.io query
  • NEWS_DATA_API_KE Y= newsdata.io api key
  • JWT_SECRET_KEY = secret key for JWT service
  • TOKEN_EXP_IN = lifetime access token expiration 24h
  • CLIENT_HOST = client host

Or you can use these ones if are using docker-compose running approach:

PORT=8090
DB_TYPE =postgres
POSTGRES_HOST=postgres
POSTGRES_PORT=5432
POSTGRES_USER=postgres
POSTGRES_PASSWORD=root
POSTGRES_DB=postgres
NEWS_DATA_API_BASE_URL=https://newsdata.io/api/1
NEWS_DATA_API_KEY=pub_404100d3a7c802dc95e02e3221e8e5c1e4dce
JWT_SECRET_KEY=jfkd;lsa5908323-iop[e]7645
TOKEN_EXP_IN=24h
CLIENT_HOST=http://localhost:5173

Articles parsing

Articles are parsed from NEWSDATA.IO - documentation.
For retrieving articles you need API KEY. You may use these:

pub_404100d3a7c802dc95e02e3221e8e5c1e4dce

Or create your own. You should previously sign up on NEWSDATA.IO for this.
Articles are parsed every minute and stored to the data base if they do not duplicate with already saved ones

Free account allowed to retrieve articles only 200 times per day

Admin panel

  • Click on the ADMIN link in the right side of the interface and pass to the login page
  • Admin credentials already have created after running the project

    email: [email protected]
    password: 123456

  • In the admin panel you have the same list of articles as in the feed but here you can change titles, descriptions and images in the articles. For editing click Edit button. Editing performs in an inline maner
  • Also you may create the new article by pressing Plus button and upload it by Push button

Technologies

Base backend libraries

  • Framework: NestJS
  • Validation: Class Validator
  • ORM: TypeORM
  • DB: PostgreSQL
  • API Protocol: REST(OpenAPISwagger)
  • Auth: JWT

Base frontend libraries

  • Framework: React SPA (Vite)
  • Forms | Validation: Hook Forms, Yup
  • State | Query: Redux RTK
  • UI: Material UI

Environment:

  • Docker Compose

article-manager's People

Contributors

dmytro-chushko avatar

Stargazers

Vince Fulco--Bighire.tools 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.