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.
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 so far can be found here.
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
$ npm install
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
# unit tests
$ npm run test
# e2e tests
$ npm run test:e2e
# test coverage
$ npm run test:cov
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.
This project is in the box for know. I hope to get back to this in 2019.
If you would like to discuss something regarding this repo, create a new issue or drop me a line to [email protected].