Backend NestJS API
- 🧬 git clone to install project on your computer
- ✔ run "npm install" or "yarn install" to install all dependencies for a project
- 💉 "npm start" to start server
To start working with PostgreSQL 🐘 you should write next commands:
- 🐘 install postgres if you don't have it installed locally yet https://www.postgresql.org/download/
- 🐋 "sudo -u postgres psql" if you want to work in psql in your terminal or run local PostgreSQL server on your computer
- 🎀 then you should write in psql "create database stonly;"
- 🧭 create user stonly with encrypted password '123';
- 🛵 grant all privileges on database stonly to stonly;
- ⛔ you should create(register) User
- 💯 then login to get access token(save this token, you will need it for registration)
- 🚚 now you can create any issue
❗️Remember to create some issue you must be Authorized. If you use postman: go to Headers -> key: Authorization -> value: Token
- Add User and relations oneToMany with Issues
- Add AuthGuard to check if we have access to the current route or not
- Add validation pipes to get all errors in one array
- Add queryBuilder to check issue author
- Add columns createdAt and updatedAt to issue
- Add issue count
- Add issue sorting by Date
- Add offset and limit for issue
- Add slug and methods to find some issue by slug
- Add decorator to check current user
- Add middleware to check access token
- Add a lot of interfaces to make good types
- Add special errorResponse: IErrorResponse to send correct errors to client
If you want to run tests you can have a problem with absolute imports and you need to change them to relative I am so sorry,but I can't resolve this problem,because I write real e2e or unit tests 5 times in my life and I really want to learn how to write tests and up my skill
- 🚀 Node v18+
- 🐘 Postgres v14+
- 💣 Typeorm 0.3+
type: 'postgres', host: 'localhost', port: 5432, username: 'stonly', password: '123', database: 'stonly', entities: [__dirname + '//*.entity{.ts,.js}'], synchronize: true, migrations: [__dirname + '/migrations//*{.ts,.js}']