modulepackage
0.0.0-20240529221533-5d307af46402
Repository: https://github.com/orhanfatih/blog-api.git
Documentation: pkg.go.dev
# README
Blog API
This is a simple RESTful API for a blogging platform built with Go.
Features
- User registration and authentication with JWT token-based authentication
- User management: create, read, update, delete user profiles
- Post management: create, read, update, delete blog posts
Tech Stack
- Go, Echo, Gorm, PostgreSQL, JWT
API Endpoints
Auth Endpoints
POST v1/auth/register
: Register a new userPOST v1/auth/login
: Authenticate and obtain a JWT tokenPOST v1/auth/logout
: Logout and invalidate the JWT token.
User Endpoints
GET v1/user/me
: Get user profilePATCH v1/user/
: Update user profileDELETE v1/user/
: Delete user profile
Blog Post Endpoints
POST v1/posts/
: Create a new blog postGET v1/posts/:id
: Get a blog post by IDPUT v1/posts/:id
: Update a blog postDELETE v1/posts/:id
: Delete a blog postGET v1/posts/
: Get blog posts
Requirements:
- Docker
How to run
Running the Application
-
Set up environment variables:
- Create a file named
.env
in the root directory of your project. - Inside the
.env
file, define your environment variables (copy fields from .env.template) and fill values
- Create a file named
-
Build and Run the application:
docker-compose up --build
# Packages
No description provided by the author
No description provided by the author
No description provided by the author