https://github.com/sirridemirtas/anonsocial
Anonymous social media platform backend written in Go using Gin framework and MongoDB.
https://github.com/sirridemirtas/anonsocial
Last synced: 4 months ago
JSON representation
Anonymous social media platform backend written in Go using Gin framework and MongoDB.
- Host: GitHub
- URL: https://github.com/sirridemirtas/anonsocial
- Owner: sirridemirtas
- License: mit
- Created: 2024-12-24T19:51:42.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2025-01-23T19:03:13.000Z (5 months ago)
- Last Synced: 2025-01-23T20:19:02.519Z (5 months ago)
- Language: Go
- Homepage:
- Size: 31.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# AnonSocial Backend
A social media platform backend written in Go using Gin framework and MongoDB.
## Requirements
- Go 1.20+
- MongoDB## Setup
1. Clone the repository:
```bash
git clone https://github.com/sirridemirtas/anonsocial.git
```2. Install dependencies:
```bash
go mod download
```3. Environment variables are already set in `.env.development`
## Running the Application
### Development Mode (with Hot Reload)
```bash
go run github.com/air-verse/air@latest
```### Production Mode
```bash
GO_ENV=production go run main.go
```## API Endpoints
Base URL: `/api/v1`
### Auth
- `POST /auth/register` - Register new user
- `POST /auth/login` - Login
- `POST /auth/logout` - Logout (requires auth)### Users
- `GET /users` - Get all users
- `GET /users/:id` - Get user by ID
- `PUT /users/:id` - Update user (requires auth)
- `DELETE /users/:id` - Delete user (requires admin)### Posts
- `GET /posts` - Get all posts
- `GET /posts/:id` - Get post by ID
- `GET /posts/university/:universityId` - Get posts by university
- `GET /posts/:id/replies` - Get post replies
- `POST /posts` - Create new post (requires auth)
- `DELETE /posts/:id` - Delete post (requires auth)