@baseplate/core v0.7.6
š 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
Install development dependencies
npm install
Install dependencies of each package
lerna bootstrap
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
.
3 years ago