Gasless Gossip is an on-chain chat application that enables users to send and receive messages along with tokens without gas fees. This backend is built using NestJS and MongoDB, providing a scalable and efficient API for the application.
- User Authentication & Authorization (JWT-based)
- Real-time Chat using WebSockets
- On-chain Transaction Integration
- Message Encryption & Security
- MongoDB Database with Mongoose ODM
- Modular & Scalable NestJS Architecture
- Framework: NestJS
- Database: MongoDB
- WebSockets: Built-in NestJS Gateway
- Blockchain: Starknet Integration (Planned)
- Authentication: JWT-based authentication
- Environment Management: dotenv
π¦ gasless-gossip-backend
β£ π src
β β£ π auth # Authentication & Authorization
β β£ π chat # Chat module (WebSockets & Messaging)
β β£ π users # User management
β β£ π common # Shared utilities & DTOs
β β£ π config # Configurations
β β£ π database # MongoDB connection setup
β β£ π main.ts # Entry point
β β ...
β£ π .env.example # Environment variables template
β£ π README.md # Project documentation
β π package.json # Dependencies
git clone https://github.com/your-repo/gasless-gossip-backend.git
cd gasless-gossip-backendnpm installCopy the .env.example file and create a .env file:
cp .env.example .envThen, update the required environment variables.
npm run start:devnpm run build
npm run start:prod| Method | Endpoint | Description |
|---|---|---|
| POST | /auth/signup | Register a new user |
| POST | /auth/login | Authenticate user |
| GET | /users/:id | Get user details |
| GET | /chat/messages | Fetch chat messages |
| POST | /chat/send | Send a new message |
Run unit tests using:
npm run testRun end-to-end (e2e) tests:
npm run test:e2e- Fork the repository.
- Create a new feature branch:
git checkout -b feature-branch - Commit your changes:
git commit -m 'Add new feature' - Push to the branch:
git push origin feature-branch - Open a Pull Request.