Dzen-api is a component of back-end part of SPA comments app, which is responsible for maintaining WebSocket connection with the client, and provide necessary app functionality.
Use this link to connect to the WebSocket Server
- Server: Establishing WebSocket connection with the client and events handing.
- Database: Storing comments information in a database within several tables using relations.
- Broadcasting: Sending and receiving messages in real time for multiple users.
- SingleResponse: Sending and receiving messages in real time for single user.
- Files: Creating file records in database and storing them on cloud service.
- Files validation: Validating files before storing them on cloud service.
- Comments validation: Validating comments before storing them in database.
- Containerization: Containerizing the application using Docker.
- TypeScript
- Node.js
- Express.js
- WebSocket
- PostgreSQL
- Prisma
- AWS S3
- Axios
- Heroku
- Docker
- ESLint
- Prettier
- Husky
- Lint-Staged
To install the project, follow these steps:
- Clone the repository with git clone
- Run
npm install
in the root directory - The project requires these environment variables to be set:
-
DATABASE_URL
- the url of the database(e.g.postgresql://user:password@localhost:5432/database
) -
PORT
- the port websocket server will be running on(Heroku use it). -
HTTP
- the url of the http server to connect. -
AWS_ACCESS_KEY_ID
, -
AWS_SECRET_ACCESS_KEY
, -
AWS_REGION
- credentials for AWS S3 service.
- Run
npm run dev
in the root directory to start the development server - Run
npm run start
in the root directory to start the production server
Contributions are welcome! If you want to contribute to [dzen-api], follow these steps:
- Fork the repository.
- Create a new branch.
- Make your changes.
- Submit a pull request.