Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/erickgbr/devtree
Devtree clone with Typescript and express
https://github.com/erickgbr/devtree
mongodb mongoose mongoosejs node node-js nodejs typescript
Last synced: 5 days ago
JSON representation
Devtree clone with Typescript and express
- Host: GitHub
- URL: https://github.com/erickgbr/devtree
- Owner: ErickGBR
- Created: 2024-12-05T13:34:49.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2025-01-22T06:52:56.000Z (28 days ago)
- Last Synced: 2025-01-22T07:35:35.844Z (28 days ago)
- Topics: mongodb, mongoose, mongoosejs, node, node-js, nodejs, typescript
- Language: TypeScript
- Homepage:
- Size: 43.9 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
---
# Devtree Clone Backend
This project is a backend implementation of a Devtree clone, created using TypeScript and React. It uses Express for the backend framework, Express Validator for data validation, and Mongoose for MongoDB interaction.
## Installation
You can install the necessary dependencies using one of the following package managers:
- **Yarn**
`yarn install`- **npm**
`npm install`- **Bun**
`bun install`## Running the Project
To run the project after compilation, use one of the following commands:
- **Yarn**
`yarn dev`- **npm**
`npm run dev`Make sure to have MongoDB running locally or use a cloud-based instance to store your data.
## Available Endpoints
### Register User
- **URL**: `http://127.0.0.1:4000/auth/register`
- **Method**: `POST`#### Request Body:
```json
{
"handle": "", // Unique user handle (string)
"name": "", // User's full name (string)
"email": "", // User's email address (string)
"password": "" // User's password (string)
}
```#### Response:
The server will respond with a status indicating whether the registration was successful or if any validation errors occurred.---
### Login User
- **URL**: `http://127.0.0.1:4000/auth/login`
- **Method**: `POST`#### Request Body:
```json
{
"email": "", // User's email address (string)
"password": "" // User's password (string)
}
```#### Response:
- **Success**: Returns a token or user information (depending on implementation).
- **Failure**: Returns an error message or validation error details.---
## Features
### Validation and Middleware
This backend uses **Express Validator** to validate incoming request data, ensuring all inputs meet the expected formats and constraints. Additionally, middleware is implemented to handle tasks like error handling, request logging, and authentication.## Technologies Used
- **Express** - Backend framework
- **Express Validator** - Middleware for validation
- **Mongoose** - MongoDB ODM (Object Data Modeling)
- **TypeScript** - Type-safe JavaScript
- **React** - Frontend framework (mentioned for the full stack context)## Future Updates
- Add more endpoints for profile management, post creation, and data retrieval.
- Implement token-based authentication with JWT.---