CASE

Typescript lightweight Backend-as-a-Service

README

CASE

A complete backend without leaving your IDE

What is CASE ?


CASE is a Typescript lightweight BaaS (Backend As A Service) requiring minimal coding.

It provides a complete backend to your client app without the hassle that comes with it.

Key features


- ⚡ Instant backend with DB, REST API and Admin panel without any configuration
- 🧠 Smart SDK to import in your favorite JS front-end
- 🛠️ Essential features like Auth, Storage, Validation and Hooks

Forget about drag-and-drop visual builders


With CASE, you structure your data using TypeScript classes straight from your coding environment.

  1. ```js
  2. // entities/cat.entity.ts
  3. @Entity()
  4. export class Cat extends BaseEntity {
  5.   @Prop()
  6.   name: string

  7.   @Prop({
  8.     type: PropType.Date
  9.   })
  10.   birthDate: Date

  11.   @Prop({
  12.     type: PropType.Relation,
  13.     options: {
  14.       entity: Owner
  15.     }
  16.   })
  17.   owner: Owner
  18. }
  19. ```

Effortless integration in your client app


And allow the following code in your JS client built with your favorite stack: React, Svelte, Angular, Vue or any front-end. You can even use it in NodeJS.

  1. ```js
  2. import CaseClient from '@casejs/case-client'

  3. // Init SDK
  4. const cs = new CaseClient()

  5. // Get all cats with their owner
  6. const cats = await cs.from('cats').with(['owner']).find()

  7. // Filter cats.
  8. const cats = await cs
  9.   .from('cats')
  10.   .where('breed = siamese')
  11.   .andWhere('birthDate > 2020-01-01')
  12.   .find()

  13. // Create a new cat.
  14. const newCat = await cs.from('cats').create({
  15.   name: 'Milo',
  16.   age: 2
  17. })

  18. // Upload.
  19. const fileUrl: string = await cs.from('cats').addFile(file)

  20. // Login.
  21. await cs.login('users', 'user1@case.app', 'case')
  22. ```

Getting started


Prerequisites


- NodeJS (v16.14.0 or higher). The recommended version is 18.x.

Create your CASE project


Run the following on your terminal replacing my-case-app with your app's name:

  1. ```
  2. npx create-case-app my-case-app
  3. ```

Then serve the app locally:

  1. ```
  2. cd my-case-app
  3. npm start
  4. ```

🎉 Your backend is ready !


You can now:
- See your **Admin panel** at http://localhost:4000
- Use your **REST API** at http://localhost:4000/api

You can now go through the docs to build your next block.

Community & Resources


- Docs - Learn CASE features
- Discord - Come chat with the CASE community
- Dev.to - Stay tuned to CASE developments
- Github - Report bugs and share ideas to improve the product.

Contributors


Thanks to our first wonderful contributors !