Coder Social home page Coder Social logo

ezy / seedpress-cms Goto Github PK

View Code? Open in Web Editor NEW
76.0 5.0 23.0 197 KB

A headless CMS built in Express for PostgresQL using Sequelize. Generally follows the Wordpress post and term schema.

License: MIT License

JavaScript 100.00%
nodejs expressjs postgresql sequelize jwt passport passport-local passport-jwt sequelize-orm sequelize-cli

seedpress-cms's Introduction

๐ŸŒฑ Seedpress Express API

Build Status codecov.io License: MIT Twitter Follow

Seedpress is a headless Node JS API server built with Express, for PostgreSQL using Sequelize ORM. It generally follows the logic and conventions of the Wordpress schema. Seedpress authenticates users using JSON web tokens managed by Passport. It's production ready, and should work as a great starter for any content based Progressive Web Application.

Hosting

Testing

Features

  • Authentication with JSON Web Token
  • Email, Password validations
  • User login and registration
  • Full API and Unit test coverage
  • Page and Term models with belongsToMany two way relationship
  • Easily deployable to Heroku (Procfile)

Schema

  • Post

    • id
    • postTitle
    • postSlug
    • postType
    • postDate
    • postContent
    • postAuthor
    • postImage
    • postMedia
    • postStatus
    • postExpiry
    • postFrequency
    • postTerms
    • createdAt
    • updatedAt
  • Terms

    • id
    • termType
    • termName
    • createdAt
    • updatedAt
  • PostTerms

    • termId
    • postId
    • createdAt
    • updatedAt

To run locally

Make sure to install and run PostgreSQL first. There are a list of package.json scripts that include core sequelize migrations and seeds.

brew update
brew install postgres

Then you'll need to adjust the config file config/config.js to suit your setup.

Then run yarn reset and your db will create from scratch and seed data under the db name seedpress_dev.

Running yarn dev will start your dev server where needed.

Testing

You'll need to setup the test server using yarn resettest. To trigger the mocha/chai tests enter:

yarn test

Postman

There is a postman collection file for API testing and development in test/seedpress-api.postman_collection.json. It contains scripts and basic CRUD for:

  • /auth

    • [POST] Register (/register)
    • [POST] Login (/login)
  • /posts

    • [POST] Single post (/ - with auth)
    • [PATCH] Single post (/:slug - with auth)
    • [DEL] Single post (/:slug - with auth)
    • [GET] All posts (/)
    • [GET] Single post (/:slug)

To deploy on Heroku

heroku login
heroku create
git push heroku master

Sequelize ORM

Seedpress uses Sequelise ORM to interact with Postgres. Install globally on your dev machine using yarn global sequelize-cli then run commands with sequelize or alternately run commands locally in your dev folder with the built in dev package ./node_modules/.bin/sequelize init.

seedpress-cms's People

Contributors

chilts avatar ezy 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

Watchers

 avatar  avatar  avatar  avatar  avatar

seedpress-cms's Issues

Front End optional interface

Hello, Is there a possibility of adding an optional front end....!?!
Maybe like React. As (optional to anyone deploying the project)

`npm test` should run unit tests (not start a server)

Hi @ezy, firstly, thanks for making this project. I saw it on Twitter earlier this evening.

I think npm test should run unit tests (ie. the test:only script in package.json) rather than start the server in test mode. I'd also like to clean up some of the other scripts here too, such as the exports and suchlike. If you're keen let me know, or we can discuss here what you'd like. :)

Thanks again.

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.