Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🚀 DevLinks API

A RESTful API built with Go, Gin, and MongoDB that lets developers create profiles and manage all their social links from a single place.

Go Gin MongoDB License


📖 Table of Contents


✨ Features

👤 Profile Management

  • Create developer profiles
  • Fetch all profiles
  • Fetch profile by username
  • Update profile details
  • Delete profiles

🔗 Link Management

  • Add social links
  • Get all profile links
  • Update existing links
  • Delete links

🛠 Tech Stack

Technology Purpose
Go Backend Language
Gin HTTP Framework
MongoDB Database
Air Live Reload
Godotenv Environment Variable Management

📂 Project Structure

devlinks-api/
├── cmd/
│   └── api/
│       └── main.go
│
├── internal/
│   ├── config/
│   ├── database/
│   ├── handler/
│   ├── models/
│   ├── repository/
│   └── server/
│
├── .air.toml
├── .env
├── go.mod
├── go.sum
└── README.md

🚀 Getting Started

1. Clone the Repository

git clone https://github.com/artistic-programmer/devlinks-api.git

cd devlinks-api

2. Install Dependencies

go mod tidy

3. Configure Environment

Create a .env file.

MONGO_URI=mongodb://localhost:27017
MONGO_DB_NAME=devlinks
PORT=8080

4. Start MongoDB

Ensure MongoDB is running locally.

5. Run the Server

With Air:

air

Without Air:

go run ./cmd/api

The API will be available at

http://localhost:8080

📡 API Endpoints

Profiles

Method Endpoint
POST /profiles
GET /profiles
GET /profiles/:username
PATCH /profiles/:username
DELETE /profiles/:username

Links

Method Endpoint
POST /profiles/:username/links
GET /profiles/:username/links
PATCH /profiles/:username/links/:linkID
DELETE /profiles/:username/links/:linkID

📄 Example Response

{
  "id": "6867f9f58f4d4f93e6d3f001",
  "username": "anshu",
  "bio": "Backend Developer",
  "links": [
    {
      "id": "6867fa1c8f4d4f93e6d3f002",
      "platform": "github",
      "url": "https://github.com/artistic-programmer"
    }
  ]
}

👨‍💻 Author

Made with ❤️ by Artistic Programmer

If you found this project useful, consider giving it a ⭐ on GitHub.

About

RESTful API for managing developer profiles and social links using Go, Gin, and MongoDB.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages