cinnamon

Cinnamon

Built with ❤︎ by Apollo Software Limited


Cinnamon is our opinionated Enterprise TypeScript framework for building API services.
📚 Learn more on our documentation site: https://docs.apollosoftware.xyz/cinnamon 📚


"The line of code that's the fastest to write, that never breaks, that doesn't need maintenance, is the line you never had to write."



(β) Cinnamon is currently in beta! We are actively working on the framework and welcome feedback and contributions! Please feel free to open issues and pull requests on this repository.

For information about the current status of the project, please see the VERSIONS file.




The key design principle of Cinnamon is to encourage use of best practices and patterns in a way that is natural, intuitive, and reliable. Its declarative programming style aims to reduce the amount of boilerplate code required to build a project. Collectively, these allow teams to focus their valuable time on building their product and user-experience and not on mundane boilerplate code.

Convinced? Have a project ready to go in seconds with create-cinnamon-project.


import { Controller, Route, Method, Context } from '@apollosoftwarexyz/cinnamon';
import { MaybeAuthenticated } from '../middlewares/Authentication';

@Controller('api', 'v1')
export default class IndexController {

    /**
     * Greets the user.
     * If they are authenticated, they will be greeted by name.
     */
    @Middleware(MaybeAuthenticated)
    @Route(Method.GET, '/')
    public async index(ctx: Context) {
        return {
            body: `Hello, ${ctx.user?.smartName ?? 'Guest'}!`
        };
    }

}

↑ A controller from the template project created with create-cinnamon-project with the Database and Authentication features selected.


Getting Started

Simply run the following command to set up a new Cinnamon project:

$ yarn create cinnamon-project my-project

This will create a new Cinnamon project in the my-project directory, prompt you to select features that will be automatically added, and provide instructions on how to run the project.

Then, check out our documentation to learn more about how to use Cinnamon!


Features


Development

  1. Cinnamon uses Yarn Berry (4.x)’s built-in workspace management. If necessary, you should install it with yarn set version stable:
     # To update the local version:
     cd /path/to/cinnamon/repository
        
     # You cannot use "yarn set version latest" reliably, because it will install
     # the latest version of Yarn 1.x, if you don't have Yarn 2+ installed.
     yarn set version stable
        
     # Afterwards, run yarn --version to confirm everything was installed correctly.
     yarn --version
     # ...should output "4.x.x"
    
  2. Run yarn in the repository root to install the packages and link the workspaces.
  3. To build the project, use yarn build.

You can also use yarn watch to watch for changes and rebuild the project.


License

MIT License