A RESTful API and WebSocket service built with Go. This project serves as a learning exercise, where I implement various features such as authentication, CRUD operations for posts, and real-time communication using WebSockets.
- Validator
- PostgreSQL
- Docker
- JWT
- Mux
- Authentication
- Users's CRUD
- Post's CRUD
- Database integration with PostgreSQL
- User's pagination
- Endpoints validations
- WebSockets
To get started, ensure you have Docker installed. Then, follow these steps to set up the database and run the application:
- Navigate to the
database
directory:
cd database
- Build the PostgreSQL Docker image:
docker build . -t postgres-rest-ws-golang
- Run the PostgreSQL container:
docker run -p 54321:5432 postgres-rest-ws-golang
- Return to the project root directory:
cd ..
- Run the Go application:
go run main.go
Now, you can test the API endpoints using an HTTP client like Postman.