Skip to content

B-HANSEN/DevConnector

Repository files navigation

DevConnector

A social network for developers built with MongoDB, React, and Node.js.

Features

  • JWT-based authentication (register, login, logout)
  • Developer profiles with skills, bio, work experience, education, and social links
  • GitHub repository integration (displays latest repos on profile)
  • Posts feed with likes and comments
  • Gravatar avatar support

Tech Stack

Backend: Node.js (ESM), TypeScript, Hono, MongoDB, Mongoose 9, JWT, bcryptjs, Zod, dotenv Frontend: React 19, Redux Toolkit, React Router 7, Axios, Vite 8

Getting Started

Prerequisites

  • Node.js v18+
  • MongoDB Atlas account (or local MongoDB)

Installation

  1. Clone the repo and install all dependencies (root + client):
npm install
  1. Create a .env file in the project root with your credentials (this file is gitignored):
MONGO_URI=your_mongodb_connection_string
JWT_SECRET=your_jwt_secret
GITHUB_TOKEN=your_github_personal_access_token

Running the App

npm run dev        # start backend + frontend concurrently
npm run server     # backend only (port 5001)
npm run client     # frontend only (port 3000)

Open http://localhost:3000

API Endpoints

Auth

Method Endpoint Description Access
POST /api/users Register new user Public
POST /api/auth Login / get token Public
GET /api/auth Get current user Private

Profiles

Method Endpoint Description Access
GET /api/profile Get all profiles Public
GET /api/profile/me Get own profile Private
GET /api/profile/user/:user_id Get profile by user ID Public
POST /api/profile Create or update profile Private
DELETE /api/profile Delete account & profile Private
PUT /api/profile/experience Add experience Private
DELETE /api/profile/experience/:exp_id Delete experience Private
PUT /api/profile/education Add education Private
DELETE /api/profile/education/:edu_id Delete education Private
GET /api/profile/github/:username Get GitHub repos Public

Posts

Method Endpoint Description Access
GET /api/posts Get all posts Private
POST /api/posts Create a post Private
GET /api/posts/:id Get post by ID Private
DELETE /api/posts/:id Delete a post Private
PUT /api/posts/like/:id Like a post Private
PUT /api/posts/unlike/:id Unlike a post Private
POST /api/posts/comment/:id Add comment Private
DELETE /api/posts/comment/:id/:comment_id Delete comment Private

Deployment (Vercel)

Set the following environment variables in your Vercel project settings:

Variable Description
MONGO_URI MongoDB Atlas connection string
JWT_SECRET Secret key for JWT signing
GITHUB_TOKEN GitHub personal access token

Notes

  • Credentials are loaded via .env (gitignored) using dotenv
  • Port defaults to 5001 locally (port 5000 is reserved by macOS AirPlay Receiver)
  • The server uses ES modules ("type": "module") — Node.js v18+ required for native fetch support

About

React v19 full-stack app — developer social network with JWT authentication, Redux toolkit. Features profile management, a post feed with likes and comments, and Gravatar avatars.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages