DEV Community

Cover image for Typetron Beta is here: typetron.org
Ionel Cristian Lupu for Typetron

Posted on β€’ Edited on

2

Typetron Beta is here: typetron.org

Since my last post about Typetron there have been some crazy months but it is finally here.

Typetron BETA is here!

Typetron is a Node.js web framework used for creating backend services. I demonstrate this in two of the available tutorials:

How does it look like in code?

Controlers

import { Controller, Delete, Get, Put, Post } from '@Typetron/Router'
import { Article } from 'App/Entities/Article'
import { ArticleForm } from 'App/Forms/ArticleForm'

@Controller('articles')
export class ArticleController {
    @Get()
    all() {
        return Article.get()
    }

    @Post()
    add(form: ArticleForm) {
        return Article.create(form)
    }

    @Put(':Article')
    update(article: Article, form: ArticleForm) {
        return article.fill(form).save()
    }

    @Delete(':Article')
    async delete(article: Article) {
        await article.delete()
    }
}
Enter fullscreen mode Exit fullscreen mode

Entities

import { Column, Entity, ID, HasMany, Relation } from '@Typetron/Database'
import { Comment } from 'App/Entities/Comment'

export class Article extends Entity {
    @Column()
    id: ID

    @Column()
    title: string

    @Column()
    content: string

    @Column()
    createdAt: Date

    @Column()
    updatedAt: Date

    @Relation(() => Comment, 'article')
    comments: HasMany<Comment>
}
Enter fullscreen mode Exit fullscreen mode

If you don't know anything about Javascript or Typetron, you can find some great FREE courses here that I recommend you to watch

It would be great to see your feedback and what features you would like to see in a framework like this. Take the tutorials and see what's missing πŸ˜„.

Check the website typetron.org
Twitter at @Typetron_
My Twitter @ionellupu_
Come and leave a question on Reddit
Join the Facebook group
Let's talk on Slack
Linkedin - Typetron

Sentry image

See why 4M developers consider Sentry, β€œnot bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

Top comments (0)

AWS GenAI LIVE image

Real challenges. Real solutions. Real talk.

From technical discussions to philosophical debates, AWS and AWS Partners examine the impact and evolution of gen AI.

Learn more

πŸ‘‹ Kindness is contagious

Please leave a ❀️ or a friendly comment on this post if you found it helpful!

Okay