Skip to content

API built with Nestjs and TypeORM to use on a slack clone project

License

Notifications You must be signed in to change notification settings

tiagofscoelho/slack-clone-api

Repository files navigation

Slack Clone - API

Objective

I would like to play with Nestjs and TypeORM. The goal of this repo is to expose an API with Nestjs and TypeORM in order to create a Slack clone with Vue + Vue Class component and the new Vue CLI 3 that will be hosted in another repo.

Disclaimer

I am starting to code with Nest and TypeORM at the starter date of this repo (5 July 2018). You may find some things that could be improved in terms of organization and/or code because my experience with the Nest/TypeORM is zero and with Typescript is quite small.

One of the things that might sound wierd is the fact that I am using classes to define interfaces. Thats because Nest's documentation says that:

"What may be surprising, we recommend using classes here. [Instead of interfaces] Why? Classes are part of the JavaScript ES6 standard, and therefore they represent just plain functions. On the other hand, TypeScript interfaces are removed during the transpilation, Nest can't refer to them. It's important because features such as Pipes enable additional possibilities when they have access to the metatype of the variable."

API documentation

API documentation so far can be found here.

Features

Below is listed the features that I am aiming to support with the API.

  • Registration ✓
  • Login ✓
  • JWT authentication ✓
  • Manage channels
  • Send/Receive messages in channels
  • Upload Files
  • Direct messages
  • Account settings

Installation

$ npm install

Running the app

Create a new file .env on the root directory. Take a look at .env.example to check which variables are needed to start the server.

After start the application, server will be running on port 3000.

# development
$ npm run start

# watch mode
$ npm run dev

# production mode
npm run start:prod

Test

# unit tests
$ npm run test

# e2e tests
$ npm run test:e2e

# test coverage
$ npm run test:cov

Updates

8 July 2018

I am amazed about how easy it was to create the registration/login feature plus the JWT authentication mechanism in 24 hours. I know that it is earlier but I already felt that Nest and TypeORM are awesome. Both have good documentation and are easy to play with.

17 December 2018

This project is in the box for know. I hope to get back to this in 2019.

Discussion

If you would like to discuss something regarding this repo, create a new issue or drop me a line to [email protected].

About

API built with Nestjs and TypeORM to use on a slack clone project

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published