A RESTful API for managing projects, tasks, and users. Built with Go, PostgreSQL, and JWT authentication.
- User registration and login with secure password hashing
- JWT-based authentication and authorization
- CRUD operations for projects and tasks
- Role-based access control for project members
- Comprehensive unit tests
- Swagger/OpenAPI documentation
- Go (Golang)
- PostgreSQL
- Gorilla Mux (HTTP router)
- JWT (github.com/golang-jwt/jwt)
- bcrypt for password hashing
- Testify for unit testing
- Docker (optional for containerization)
- Go 1.18+
- PostgreSQL
- (Optional) Docker & Docker Compose
git clone https://github.com/yourusername/project-management-api.git
cd project-management-api
Create the database and run migrations (if any):
psql -U postgres -c "CREATE DATABASE projectdb;"
# Run migration scripts if provided
go run ./cmd/main.go
The API will start on localhost:8888
.
docker-compose up --build
Swagger UI is available at:
http://localhost:8888/swagger/
go test ./...
POST /api/auth/register
Content-Type: application/json
{
"email": "user@example.com",
"password": "securepassword"
}
POST /api/auth/login
Content-Type: application/json
{
"email": "user@example.com",
"password": "securepassword"
}
POST /api/projects
Authorization: Bearer <JWT_TOKEN>
Content-Type: application/json
{
"name": "New Project",
"description": "Project description"
}
internal/
entity/ # Domain models
repository/ # Database access
usecase/ # Business logic
interface/ # HTTP handlers, middleware
mocks/ # Mock implementations for testing
cmd/ # Application entry point
docs/ # Swagger/OpenAPI docs
- Fork the repository
- Create your feature branch (
git checkout -b feature/foo
) - Commit your changes (
git commit -am 'Add new feature'
) - Push to the branch (
git push origin feature/foo
) - Create a new Pull Request
MIT License
Contact:
For questions or feedback, open an issue or contact rezacharsetad@gmail.com