Giter Site home page Giter Site logo

greenpress / greenpress Goto Github PK

View Code? Open in Web Editor NEW
90.0 4.0 29.0 9.96 MB

Start here: npm install & npm start

Dockerfile 0.83% Shell 0.22% HTML 1.72% JavaScript 30.80% Vue 20.74% TypeScript 40.93% SCSS 0.75% CSS 1.46% Smarty 2.55%
platform opensource greenpress hacktoberfest scale docker

greenpress's Introduction

CircleCI Running tests

GreenPress

Open-source blogs and content websites platform, made for the 21st century. Greenpress

Dependencies

Direct usage

  • Node.js
  • NPM
  • Docker / MongoDB
  • (Optional: Redis)

Dockerized usage

  • Docker
  • Docker Compose

Getting started

Install

$ npm install
$ npm run build

Run production

$ npm start

Run development

# In case you have separated MongoDB instance on your local machine:
$ npm run dev

# In case you don't (will run MongoDB using Docker):
$ npm run dev --x=all

Dockerized Usage

Pre-running

Before running a docker-compose environment, you'll need an .env file and the compose library.

You can just copy the .env.example and call it .env (manually), but you can also do it on command line:

$ cd compose

# for linux or mac:
$ cp .env.example .env

# for all operation systems (including windows):
$ npm run create-env

Running Greenpress via Docker-Compose is a very simple task. You might need to pre-install Docker and Docker Compose, and then run these commands:

$ cd compose
$ docker-compose up

Scaling dockerized application

When using dockerized solution, you can choose to run each service separately, and scale each service according to your needs. To run a composition that is more suitable to those cases, use the "scaled" yaml:

$ cd compose
$ docker-compose -f docker-compose.scaled.yml up

If you're using a small machine, such as shared hosting packages, or low cpu or memory cloud services, you should probably use the basic environment, such as the regular compose file, or directly using Node.js.

Set custom configurations

There are 2 ways to extend the default Greenpress configurations. Basic way is by environment variables, and the second part is to add a greenpress.config.js file to your project's root folder.

The greenpress.config.js can either export the configuration object, or export a function that will get the base configuration object, and expected to return a new configuration object. Note that the base configuration object passed to the function will include data that calculated by environment variables before.

greenpress's People

Contributors

cameljohn avatar chanigintzler avatar codingben avatar davidmeirlevy avatar drorrose avatar meerhamzadev avatar naorpeled avatar omergronich avatar or-yam avatar qballer avatar ranwahle avatar shahar-polak-imagen avatar sliron1989 avatar tikokito123 avatar zvikfir avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

greenpress's Issues

[blog-front] GDPR Consent component

  1. check if a cookie of the GDPR consent (cookie name: AgreedToCookies) exists.
  2. if not - render the GDPR consent line at the bottom of the website (fixed position).
  3. when the user agrees to the terms - should save a cookie for it (AgreedToCookies=${(new Date()).toJSON()})

[content] Comments endpoints

apply commenting endpoints:

  1. get all comments by post id
  2. get all comments by path (category & post path).
  3. for starters, all no inner-comments available.
  4. regular users can get or create new comments.
  5. editors and admins can also edit / delete.
  6. verify encoding and HTML tags!

[blog-front] Signin + Signup components

Use the API to signin & signup to the blog.

can use the mechanism to login the admin panel (the API is the same, but admin panel requires different role).

Separate codefresh pipelines between main branch hooks and PRs hooks

As you can see, I already did it in the admin-panel repository, but it should be for all services:
should have 2 different pipelines - one that runs only on the main branch (currently master for most of them), and the second for PRs only, and to exclude the main branch explicitly.

[admin] [Feature] open image-upload modal on WYSIWYGs image button

scenario:

  1. add content via WYSIWYG.
  2. click on the "image" button to add image

current behavior: open "browse files" and it doesn't do anything.

expected behavior:

  1. open modal to upload or search assets in manages storages, using the image uploader.
  2. after the image was selected / uploaded - the image will be entered to the WYSIWYG content.

The modal basic behavior:

  1. select a storage
  2. view assets in storage.
  3. drag & drop component (ImageUploader).
  4. on image selection / upload - emit the image to the parent component.

Note: This feature has 2 mechanisms to control:

  1. the GpEditor that used CKEditor.
  2. the ImageUploader and the StorageService to manage storage.

[mailing] [Feature] Send email with parameters

for endpoint such as:
POST /api/mailing/send

the request body should have:

{
  providerId: string,
  emailTemplateId?: string,
  subject: string,
  content: string,
  templateParams?: any,
  from?: string (email),
  to: Array<string>,
  bcc: Array<string>,
}

parts of those values can be inherited from the email template (subject, content, from, and part of the template params).

[admin] Plugins mechanism

Add capability to insert admin panel plugins easily.
every plugin should get ability to insert routes, and insert components to several editing screens.

for example: plugins that can be used from the "edit post" page, to help you add posts, etc..

[admin] [Menus] ability to add / remove / update

Create a better UX to add / remove / update menus.
make sure that the main menu is not removable.

The API is a simple CRUD and already exists:
GET /api/menus - get all
POST /api/menus - create
PUT /api/menus/:menuName - update
DELETE /api/menus/:menuName - remove a menu..

Update menu page already exists.. needs to have a better UX.

[admin] [Feature] Static image uploader

Every content editor wants a place to upload images and retrieve its public URL, that should be available from all pages.

Capabilities wanted:

  • see list of files in storage
  • upload files to storage and get their public URL.
  • remove assets from this details panel
  • move folders
  • refresh list
  • show asset name below/above image
  • rename asset

You can use the ImageUploader component, and also manage the list of files in storage.

[CLI] [Feature] live-replace environment on production machine

Consider a machine working with docker-compose.
The docker-compose YAMLs located at the compose directory in greenpress/greenpress repository.

currently, the YAML includes the following services: greenpress, mongo, redis.

configuration steps:

  1. it should have an nginx / lightspeed that will be exposed on port 80. (call is the gateway)
  2. mongo and redis should be exposed locally to 127.0.0.1, but not outside of the machine.
  3. greenpress should get a random port.
  4. the gateway should run and reverse-proxy to greenpress.

bootstrapping steps:

  1. .env file should updateGREENPRESS_IMAGE variable from .env.production file.
  2. docker run only to this image and pass all relevant variables with docker-compose. should run with a new random port on 127.0.0.1 only.
  3. make sure it gets mongo and redis URIs, that should already running.
  4. restart the gateway and pass the port of the new greenpress instance.
  5. docker stop for the old greenpress instance.

the expected result:
the new version of greenpress should be up and running, using existing mongo and redis on the machine, and expose to port 80 using the gateway.

Mandatory:
all of this should be done with one single command.

[content] [Enhancement] Separate database operations from controllers to services

This issue should have several different PRs.

  • menus
  • tags
  • posts
  • categories
  • configurations
  • comments

Hint to start:

  1. look at a controller file.
  2. every function that doesn't expect request and response should not be defined there at all.
  3. every usage for cache and models, should not be there either.
  4. every actual building for mongo queries specifics should be out of there.

[CLI] [Feature] - autocomplete

There are a few npm packages that implement the autocomplete feature

yargs

yargs offers a simple autocompletion API:

var argv = require('yargs')
    .completion('completion', function(current, argv, done) {
        setTimeout(function() {
          done([
            'apple',
            'banana'
          ]);
        }, 500);
    })
    .argv;

UPDATE: yargs is picked

[New service] mailing-service

A new service is required.
Currently, a basic functionality to send emails exists on the authentication service, and it should be removed from there.

core & fundamentals:

  1. use the api-kit to create a restful API.
  2. should have endpoints for editors & admins, and endpoints for internal services requests.
  3. call secrets-service to store mail access.

Requested operations:

  1. manage mail providers + access tokens.
  2. manage templates for emails.
  3. send emails by template + payload (used for admins and for internal services calls).

[blog-front] Email Verification Page

The URL should be:
${uri}/verification/email/${token}

should add verification text and button to verify.
API already exists in authentication-service.

[assets] [Change request] Remove encrypted data when failed to save storage

When creating storage, it can happen that the credentials are stored successfully but the actual storage failed to be saved.
In that case, we should remove the encrypted values stored in the secrets-service.

  1. fo to apps/assets
  2. look for POST /api/storage endpoint (creating storage providers).
  3. on the controller (createStorage) - when getting the credentials- check the connection before storing the credentials at the secret service.
  4. do the same for the updateStorage function at the controller.

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.