Skip to content

DevFoundry-Backend is a scalable Node.js + Express.js backend powering the DevFoundry platform — where developers forge their projects. It features GitHub OAuth login, JWT-based authentication, role-based access control, project submission workflows, and curated project data APIs..

Notifications You must be signed in to change notification settings

chetannada/DevFoundry-Backend

Repository files navigation

🚀 DevFoundry-Backend

A scalable Node.js + Express.js backend powering the DevFoundry frontendwhere developers forge their builds.
This API handles curated project data, GitHub OAuth login, JWT-based authentication, role-based access control, and contributor-friendly submission workflows.
Built for modular clarity and production-grade deployment across environments.

🔗 Live API: devfoundry-backend.vercel.app
📦 Frontend Repo: DevFoundry App

🛠️ Tech Stack

Backend

  • Node.js – Runtime environment
  • Express.js – Web framework for RESTful APIs
  • MongoDB – NoSQL database
  • Mongoose – ODM for MongoDB
  • JWT – Authentication via JSON Web Tokens
  • GitHub OAuth – Secure login via GitHub

Deployment

  • Vercel – Serverless deployment

🔐 Authentication Flow

  • GitHub OAuth login
  • JWT token generation and verification
  • Protected routes via middleware
  • Role-based access support (admin/contributor)

📦 API Endpoints

🔧 Core/Community Builds

Method Endpoint Description
GET /api/builds/get Fetch all core/community builds
POST /api/builds/add Add a new core/community builds (auth required)
PUT /api/builds/update/:id Update core/community builds by ID (auth required)
DELETE /api/builds/delete/:id Delete core/community builds by ID (auth required)
PUT /api/builds/review/:id Review and update status of a core/community build (admin only)
PUT /api/builds/restore/:id Restore a previously deleted core/community build (admin only)

🔐 Authentication

Method Endpoint Description
GET /api/auth/github Initiate GitHub login
GET /api/auth/callback GitHub OAuth callback
GET /api/auth/me Fetch authenticated user profile (auth required)
POST /api/auth/logout Log out the current user

🌱 Structure of this Project

/DevFoundry-Backend

├── api/                           # Entry point for API routing
│ └── index.js
├── controllers/                   # Handles HTTP requests and responses for auth and build routes
│ ├── authController.js
│ └── buildController.js
├── services/                      # Core business logic and data operations for builds
│ └── buildService.js
├── middleware/                    # Auth middleware for route protection
│ └── auth.js
├── models/                        # Mongoose schemas for MongoDB
│ ├── authUserModel.js
│ └── buildModel.js
├── routes/                        # Route definitions and grouping
│ ├── authRoutes.js
│ ├── index.js
│ └── buildRoutes.js
├── utils/                         # Shared utilities (JWT, error handling)
│ ├── buildType.js
│ ├── constants.js
│ ├── error.js
│ └── jwt.js
├── .env                           # Environment variables (fill actual values)
├── index.js                       # App entry point
└── README.md                      # Project documentation

🔥 Clone this Repository

You need to write the following commands on the terminal screen (in vscode) so that you can run this project locally.

git clone "https://github.com/chetannada/DevFoundry-Backend.git"

Go to the project directory

cd DevFoundry-Backend

Install dependencies

npm install

Set up environment variables:

  • .env - environment variables for this project to run in development environment (fill with actual values for environment variables)

Run the server:

npm run start

This server should now be running on http://localhost:5000.

If you want to Fork repository and want to run locally, follow this guidelines Fork and Clone Github Repository

✏️ Contributing

Pull requests are welcome! If you’d like to add features, improve error handling, or optimize performance, feel free to fork and submit a PR.

📄 License

This project is open-source and available under the MIT License.

🤝 Let's Connect

linkedin twitter discord

About

DevFoundry-Backend is a scalable Node.js + Express.js backend powering the DevFoundry platform — where developers forge their projects. It features GitHub OAuth login, JWT-based authentication, role-based access control, project submission workflows, and curated project data APIs..

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •