Coder Social home page Coder Social logo

beeman / angular-cms Goto Github PK

View Code? Open in Web Editor NEW

This project forked from typijs/typijs

0.0 2.0 0.0 7.16 MB

An flexiable, extendable, modular, single CMS app based on Angular, Express, MongoDB

License: MIT License

TypeScript 74.78% JavaScript 0.14% HTML 14.95% CSS 10.13%

angular-cms's Introduction

Angular Cms

The single app CMS based on Angular, Express, NodeJs and MongoDB.

Status: Working In Progress, not ready to use in production

How it work?

Let assume you need build the dynamic website, in Angular CMS, we need to breakdown this page to properties, blocks like this

cms-demo-site-breakdown

So thinking of the architecture in which the site which breakdowns to many pages, each page will also breakdowns to blocks and properties. After that we will definite the page types, block types to build the site.

From this idea, in Angular CMS, we will definite the Home Page page type like this

@PageType({
    displayName: "Home Page",
    componentRef: HomeComponent,
    description: "This is home page type"
})
export class HomePage extends PageData {

    @Property({
        displayName: "Logo",
        displayType: UIHint.Input
    })
    logo: string;

    @Property({
        displayName: "Latest Projects Page Root",
        displayType: UIHint.Input
    })
    latestProjectRoot: string;

    @Property({
        displayName: "Highlight Features",
        description: "This is highlight feature will be in banner area",
        displayType: UIHint.ContentArea
    })
    features: Array<any>;

    @Property({
        displayName: "Highlight Portfolios",
        displayType: UIHint.ContentArea,
    })
    portfolios: Array<any>;

    @Property({
        displayName: "Footer",
        displayType: UIHint.ContentArea
    })
    footer: Array<any>;

    @Property({
        displayName: "Footer Text",
        description: "This is footer text to show the copyright",
        displayType: UIHint.Xhtml
    })
    footerText: string;
}

Basically, we have just created the page type with properties: logo, features, portfolios, footer...

Then corresponding to page type, we will create a template (like Html template). In Angular CMS, this template actually is the Angular Component

import { Component } from '@angular/core';
import { CmsComponent } from '@angular-cms/core';
import { HomePage } from './home.pagetype';

@Component({
    templateUrl: './home.component.html',
})
export class HomeComponent extends CmsComponent<HomePage> {
    constructor() {
        super();
    }
}

Now when create the page with page type of Home Page, the HomeComponent is charge of rending the page's template

So after we done all things above, how to we create a page. In Angular CMS, we have the admin/editor UI to manage all pages like this

The Editor UI can be accessed via router: http://localhost:4200/cms/editor

The Admin UI can be accessed via router: http://localhost:4200/cms/admin

cms-demo-site

This Admin/Editor UI is build with plug-in architecture

cms-demo-site

Each page you created has the unique friendly SEO URL like /home-page, /home-page/about, /portfolio/article-1...and the page is published, it can be access via those urls

Check it out with other nice features:

Features

  1. Page Types, Page Template, Page Properties
  2. Block Types, Block Template, Block Properties
  3. Media management: Upload multi files (images, doc, pdf, ...), resizing image, drag and drop...
  4. Friendly URL
  5. SEO (using Angular Universal)
  6. Multi site
  7. Modules architecture for extend the Admin UI

and last but most important: the site you build with Angular CMS is actually the Angular App, it mean it is Angular from router, render, .... You will only work with Angular.

However, it still need a storage to store data, right?. Angular CMS uses the API system which was built by ExpressJS (NodeJS framework) and MongoDB (using mongoose as ORM)

Screenshots

The minimal, simple, clear screen for Editor to edit content

cms-demo-site

On page preview

cms-demo-site

Upload media by drag & drop

cms-demo-site

Edit content by drag & drop block into Content area

cms-demo-site

Drop image into Html editor

cms-demo-site

Content tree view with menu and inline edit

cms-demo-site

cms-demo-site

Prerequisites

Must install:

  • Node.js version 12+ or later
  • MongoDB

Optional:

  • MongoDB Compass Community (Optional)
  • Visual Studio Code

Module dependency

    graph TD
    A(cms core)-->B(cms modules)
    B-->C(cms portal)
    C-->Z(cms demo)
    X(cms api)-->Z

How to run in dev mode

Setup Npm Symlinks

For running examples, we need set up the symlinks between modules as below:

  1. Go to cms-api folders and run command
    npm install
    npm link
  1. Go to cms-server folder and run commands
    npm link @angular-cms/api

Run in Dev Mode

  1. First step, under cms-server folder, run the command
    npm install
    npm run dev

If you have the issue installing such as the @angular-cms/api package is not found, temporary remove it in package.json, run install command then add it again

This command will run script to connect to mongo db, so make sure you have the correct path to your db. For example, in my local, I have the db path like as D:/ProgramData/MongoDB/data/db

    mongod --dbpath D:/ProgramData/MongoDB/data/db

If you install the MongoDB and run it as the service in Window, you can skip this step

  1. After the MongDb instance running, you can use the example data under the resources/db. Each json file will be corresponding to one collection in Mongo

Using Mongo Compass to backup these collections

cms-demo-site

  1. Final step, under cms folder, run the command sequentially
    npm install
    ng build core
    ng build modules
    ng build portal
    npm run dev

Make sure you installed Angular CLI with --global

Versioning

We are current on Alpha

Authors

License

This project is licensed under the GNU License - see the LICENSE file for details

Acknowledgments

  • Inspiration from Episerver

Notes

angular-cms's People

Contributors

angularxcms avatar charles443 avatar danghung1202 avatar dependabot[bot] avatar martin1202 avatar

Watchers

 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.