0.7.6 ā€¢ Published 3 years ago

@baseplate/core v0.7.6

Weekly downloads
4
License
-
Repository
github
Last release
3 years ago

šŸ— Baseplate

āœ‹Ā  If you just want to experiment with Baseplate, you might want to check out one of the example projects. If you're looking to work on the framework itself, read on.

Introduction

This repository contains the API component of Baseplate. It is a monorepo comprised of the following packages:

  • šŸ§ Ā  core: The core application logic.
  • šŸ“€Ā  db-mongodb: A database connector for MongoDB.
  • šŸ’æĀ  db-postgresql: A database connector for PostgreSQL (not ready).
  • šŸ“–Ā  schema: A module for representing model schemas and validating documents against them. Can run both server-side and client-side.
  • āš™ļøĀ  server: A web server to run Baseplate.
  • ā˜ļøĀ  serverless: Wrapper functions for running Baseplate in a serverless setup (not ready).

Baseplate uses a modular architecture, allowing developers to pick just the components they need for any given project.

For example, if you wanted to run Baseplate with a MongoDB database and deploy it with a web server, you'd install db-mongodb and server. The data connector modules include core themselves, so you don't need to install it yourself.

import baseplateServer from '@baseplate/server'
import * as baseplateCore from '@baseplate/mongodb'

import Actor from './models/Actor'
import Movie from './models/Movie'

baseplateCore.initialize({
  models: [Actor, Movie],
})

baseplateServer(baseplateCore)
  .start({
    host: 'localhost',
    port: 8000,
  })
  .then(() => {
    console.log('šŸ¦„')
  })

Installation

  1. Install development dependencies

    npm install
  2. Install dependencies of each package

    lerna bootstrap
  3. Compile the TypeScript files and watch for changes

    npm run watch

Testing

To start the test suite, run npm run test. If you're working on a test and you want it to run automatically as you change the code, you can run the test suite in watch mode with npm run test:watch.

Contributing

This project is written in TypeScript. It uses the ESLint linter and the Prettier code formatter.

To ensure your code conforms to the rules, run npm run format.