This is a practise project for making an backend API for a twitter-like microblogApp frontend. This api includes CRUD functions and db table creation for postgres. This project is made to practise skills in Express.js API creation and SQL database handling. This project is not complete but it includes all the core functions and is in a good state.
Clone the repository and run pnpm/npm install for needed dependencies. Also configure .env file that should include the following fields: (explanation) You also need to create your own postgreSQL database beforehand.
PORT: # Port for the api server to run in
NODE_ENV: # development/production
JWT_SECRET: # Secret for token signing
DB_USER: # Username for db
DB_PASSWORD: # Password set for the db
DB_HOST: # Host address for the db
DB_PORT: # Port of the db
DB_DATABASE: # Name of the db- Typescript
- PostgreSQL
- Express.js
- Node.js
- JWT
One of the challenges was learning how to handle credential and users. I decided to go with JWT tokens but I think there is room improve in terms of token expiry and user session handling.