devlink

DevLink

A developer collaboration platform API built with TypeScript, Express, and MongoDB. DevLink enables developers to create projects, apply to join projects, send messages, and manage their professional profiles.

🚀 Features

🛠️ Technology Stack

📁 Project Structure

src/
├── app.ts                 # Express app setup and routing
├── server.ts              # Server bootstrap and database connection
├── middleware/
│   ├── auth.middleware.ts # JWT authentication middleware
│   └── error.middleware.ts # Centralized error handling
├── modules/
│   ├── auth/              # Authentication module
│   │   ├── auth.controller.ts
│   │   ├── auth.service.ts
│   │   ├── auth.routes.ts
│   │   ├── auth.dto.ts
│   │   └── auth.types.ts
│   ├── users/             # User management module
│   │   ├── users.controller.ts
│   │   ├── users.service.ts
│   │   ├── users.routes.ts
│   │   ├── users.model.ts
│   │   ├── users.dto.ts
│   │   └── users.types.ts
│   ├── projects/          # Project management module
│   │   ├── projects.controller.ts
│   │   ├── projects.service.ts
│   │   ├── projects.routes.ts
│   │   ├── projects.model.ts
│   │   ├── projects.dto.ts
│   │   └── projects.types.ts
│   ├── applications/      # Project applications module
│   │   ├── applications.controller.ts
│   │   ├── applications.service.ts
│   │   ├── applications.routes.ts
│   │   ├── applications.model.ts
│   │   ├── applications.dto.ts
│   │   └── applications.types.ts
│   └── messages/          # Messaging module
│       ├── messages.controller.ts
│       ├── messages.service.ts
│       ├── messages.routes.ts
│       ├── messages.model.ts
│       ├── messages.dto.ts
│       └── messages.types.ts
├── config/                # Configuration files
└── structure.md           # Project structure documentation

🏗️ Architecture

DevLink follows a modular layered architecture where each feature is organized into its own module. Each module contains:

📡 API Endpoints

Authentication

Users

Projects

Applications

Messages

Health Check

🚀 Getting Started

Prerequisites

Installation

  1. Clone the repository:
git clone <repository-url>
cd devlink
  1. Install dependencies:
npm install
  1. Create a .env file in the root directory:
MONGODB_URI=mongodb://localhost:27017/devlink
PORT=3000
JWT_SECRET_KEY=your-super-secret-jwt-key
  1. Start the development server:
npm run dev

The API will be available at http://localhost:3000

📜 Available Scripts

🔒 Authentication

All endpoints except authentication routes require a JWT token. Include the token in the Authorization header:

Authorization: Bearer <your-jwt-token>

Tokens expire after 3 days.

🗄️ Data Models

User

{
  username: string;
  email: string;
  password: string; // hashed
  bio?: string;
  skills?: string[];
  githubLink?: string;
  createdAt: Date;
  updatedAt: Date;
}

Project

{
  title: string;
  description: string;
  techStack: string[];
  owner: ObjectId; // User reference
  createdAt: Date;
  updatedAt: Date;
}

Application

{
  applicant: ObjectId; // User reference
  project: ObjectId; // Project reference
  status: "pending" | "accepted" | "rejected";
  createdAt: Date;
  updatedAt: Date;
}

Message

{
  sender: ObjectId; // User reference
  recipient: ObjectId; // User reference
  content: string;
  createdAt: Date;
}

🤝 Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests if applicable
  5. Submit a pull request

📄 License

This project is licensed under the MIT License.