This is the backend for the Nongtalk application, a chat platform built with Node.js, Express, TypeScript, Prisma, and Socket.IO. It provides APIs for user registration, authentication, friend management, messaging, and profile management.
- Node.js: JavaScript runtime for server-side development.
- Express: Web framework for building RESTful APIs.
- TypeScript: Adds static types to JavaScript for better scalability.
- Prisma: ORM for database management.
- Socket.IO: Enables real-time bidirectional communication for chat features.
POST /auth/register
Host: localhost:5000
Content-Type: application/json
{
"email": "[email protected]",
"username": "yassir",
"password": "12345678"
}POST /auth/login
Host: localhost:5000
Content-Type: application/json
{
"email": "[email protected]",
"password": "12345678"
}POST /friends
Host: localhost:5000
Authorization: Bearer <Token>
Content-Type: application/json
{
"friendCode": "USR834028"
}GET /friends
Host: localhost:5000
Authorization: Bearer <Token>GET /profile
Host: localhost:5000
Authorization: Bearer <Token>PATCH /profile
Host: localhost:5000
Authorization: Bearer <Token>
Content-Type: application/json
{
"username": "faisal"
}POST /message
Host: localhost:5000
Authorization: Bearer <Token>
Content-Type: application/json
{
"friendCode": "USR834028"
}- Clone the repository:
git clone https://github.com/VsalCode/nongtalk-backend.git
- Navigate to the project directory:
cd nongtalk-backend - Install dependencies:
npm install
- Set up environment variables:
- Create a
.envfile in the root directory. - Add necessary configurations (e.g., database URL, JWT secret).
DATABASE_URL="your-database-url" JWT_SECRET="your-jwt-secret" PORT=5000
- Create a
- Run the application:
npm run dev
- Fork the repository.
- Create a new branch for your feature or bug fix:
git checkout -b feature/your-feature-name
- Make your changes and commit them with a descriptive message:
git commit -m "Add your commit message" - Push your changes to your fork:
git push origin feature/your-feature-name
- Create a pull request on the main repository.
- Ensure your code follows the project's coding standards and passes any tests.
This project is licensed under the MIT License. See the LICENSE file for details.