All Projects → gofreta → gofreta-api

gofreta / gofreta-api

Licence: other
Gofreta - REST API server

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to gofreta-api

reflect
Static site generator for WordPress.
Stars: ✭ 19 (+11.76%)
Mutual labels:  headless-cms
startup-starter-kit
The Structured Content Startup Starter Kit
Stars: ✭ 42 (+147.06%)
Mutual labels:  headless-cms
pocket-cms
☁️ A pocket sized CMS written for nodejs
Stars: ✭ 13 (-23.53%)
Mutual labels:  headless-cms
firecms
Awesome Firebase/Firestore-based CMS. The missing admin panel for your Firebase project!
Stars: ✭ 686 (+3935.29%)
Mutual labels:  headless-cms
truthy
Open source headless CMS API written using NestJS, that has pre built modules like User Management, Role Management, Permission Management, Email Module, Account Settings, OTP, Throttling, RBAC support, Localization, and many more.
Stars: ✭ 200 (+1076.47%)
Mutual labels:  headless-cms
nuxt-cockpit
A Tutorial to Bundle Cockpit CMS & Nuxt.js in a full JAMstack
Stars: ✭ 45 (+164.71%)
Mutual labels:  headless-cms
kontent-tutorial-react-js
A simple website written in React using Kentico Kontent. Serves as a basis for a React tutorial.
Stars: ✭ 14 (-17.65%)
Mutual labels:  headless-cms
nuxt-ghost
Easy Ghost content API integration with Nuxt.js.
Stars: ✭ 27 (+58.82%)
Mutual labels:  headless-cms
dashboard
Backpulse is an API Based CMS. Build you own website without worrying about the content administration system.
Stars: ✭ 13 (-23.53%)
Mutual labels:  headless-cms
yllet
Yllet is a set of packages for the WordPress API for both React and non-React projects
Stars: ✭ 46 (+170.59%)
Mutual labels:  headless-cms
contentjet-api
Headless API-first content management system
Stars: ✭ 95 (+458.82%)
Mutual labels:  headless-cms
gatsby-starter
Gatsby Starter for creating portfolio & blog.
Stars: ✭ 55 (+223.53%)
Mutual labels:  headless-cms
directus-metalsmith-snipcart
Lookbook web app with Directus' open source headless CMS, Metalsmith, Vue.js & Snipcart
Stars: ✭ 14 (-17.65%)
Mutual labels:  headless-cms
awesome-medusajs
A curated list of awesome resources related to MedusaJS 😎
Stars: ✭ 113 (+564.71%)
Mutual labels:  headless-cms
laravel-storyblok
Make Laravel and Storyblok work together beautifully.
Stars: ✭ 45 (+164.71%)
Mutual labels:  headless-cms
vaahcms
VaahCMS is a laravel based open-source web application development platform shipped with a headless content management system (CMS).
Stars: ✭ 56 (+229.41%)
Mutual labels:  headless-cms
pageflo
A new super flexible open source CMS
Stars: ✭ 34 (+100%)
Mutual labels:  headless-cms
agilitycms-eleventy-starter-2020
A sample Eleventy starter that uses Agility CMS and aims to be a foundation for building fully static sites using 11ty and Agility CMS.
Stars: ✭ 18 (+5.88%)
Mutual labels:  headless-cms
buzzyblog
React + WordPress REST API, a new endeavor to provide a better experience to content creators, web masters and digital marketers, etc
Stars: ✭ 50 (+194.12%)
Mutual labels:  headless-cms
graphql-workshop
⚒ 🚧 A GraphQL workshop to learn GraphQL implementations
Stars: ✭ 20 (+17.65%)
Mutual labels:  headless-cms

Gofreta REST API server

⚠️ This project is no longer actively maintained. Better and more extendable alternative is PocketBase.

"Go + Mongo" REST API server implementation for Gofreta.

Installation

  • Install MongoDB 3.2+ and after that apply the following command to insert an initial user and language items (you can change them later):

    mongo localhost/gofreta --eval '
    var nowTimestamp = Date.now() / 1000 << 0;
    // insert user "admin" with password "123456"
    var adminUser = {"username": "admin", "email": "[email protected]", "status": "active", "password_hash": "$2a$12$rdX7N6gpAzKJ/7DzCMyVdeRaTUv6faL6GxhTODzlJcuDHRf4hedoO", "reset_password_hash": "", "access": {"user": ["index", "view", "create", "update", "delete"], "key": ["index", "view", "create", "update", "delete"], "language": ["create", "update", "delete"], "media": ["index", "view", "upload", "update", "delete", "replace"], "collection": ["index", "view", "create", "update", "delete"]}, "created": nowTimestamp, "modified": nowTimestamp};
    db.user.insert(adminUser);
    // insert English(en) language
    var language = {"title": "English", "locale": "en", "created": nowTimestamp, "modified": nowTimestamp};
    db.language.insert(language);
    '
  • Download the latest Gofreta binary release and place it on your server. Execute the binary and specify the environment configuration file (see Configurations):

    ./gofreta -config="/path/to/config.yaml"

That's it :). Check the API Reference documentation for info how to use the API.

Configurations

Here is a yaml config file with the default application configurations: You can extend it by using the -config flag (eg. -config="/path/to/config.yaml").

# the API base http server address
host: "http://localhost:8090"

# the Data Source Name for the database
dsn: "localhost/gofreta"

# mail server settings (if `host` is empty no emails will be send)
mailer:
  host:     ""
  username: ""
  password: ""
  port:     25

# these are secret keys used for JWT signing and verification
jwt:
  verificationKey: "__your_key__"
  signingKey:      "__your_key__"
  signingMethod:   "HS256"

# user auth token session duration (in hours)
userTokenExpire: 72

# reset password settings
resetPassword:
  # user reset password token secret
  secret: "__your_secret__"
  # user reset password token valid duration time (in hours)
  expire: 2
  # if not empty, the link will be included in the reset password email
  # (use `<hash>` as a placeholder for the reset password token, eg. `http://example.com/reset-password/<hash>`)
  pageLink: ""

# pagination settings
pagination:
  defaultLimit: 15
  maxLimit:     100

# upload settings
upload:
  maxSize: 5
  thumbs:  ["100x100", "300x300"]
  dir:     "./uploads"
  url:     "http://localhost:8090/upload"

# system email addresses
emails:
  noreply: "[email protected]"
  support: "[email protected]"

I recommend you to double check the following parameters: host, dsn, mailer, jwt, resetPassword.secret and upload.

API Reference

Detailed info and response examples are available at the offical Gofreta docs - https://gofreta.com/docs

Development

Docker

Requirements:

Clone or download the repository and execute the following commands:

# start the docker daemon service (if is not started already)
sudo systemctl start docker

# navigate to the project root dir
cd /path/to/gofreta-api

# start the project docker services
docker-compose up -d

# fetch and install the dependent packages
./docker/scripts/glide install

# start the API service and listen to `localhost:8090`
./docker/scripts/start

For convenience the following helper docker-compose scripts are available:

  • ./docker/scripts/start - initialize the API service with the provided ./docker/api/config.yml configurations
  • ./docker/scripts/glide - alias to the api_service glide binary, eg. ./docker/scripts/glide install
  • ./docker/scripts/go - execute any golang commands within the api_service container, eg. ./docker/scripts/go test ./...
  • ./docker/scripts/mongo - connect to the interactive mongodb shell, eg. ./docker/scripts/mongo

Manual

Requirements:

To download and install the package, execute the following command:

# install the application
go get github.com/gofreta/gofreta-api

# install glide (a vendoring and dependency management tool), if you don't have it yet
go get -u github.com/Masterminds/glide

# navigate to the applicatin directory
cd $GOPATH/src/github.com/gofreta/gofreta-api

# fetch and install the dependent packages
$GOPATH/bin/glide install

Now you can build and run the application by running the following command:

# navigate to the applicatin directory
cd $GOPATH/src/github.com/gofreta/gofreta-api

# run the application with the default configurations
go run server.go

# run the application with user specified configuration file
go run server.go -config="/path/to/config.yaml"

Credits

Gofreta REST API is part of Gofreta - an Open Source project licensed under the BSD3-License.

Help us improve and continue the project development - https://gofreta.com/support-us

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].