Welcome to the Golang Todo Application Backend! This backend serves as the backend for a todo application similar to Microsoft Todo. It is designed to provide a seamless experience for users, even those unfamiliar with Golang. The application features user authentication through JWT bearer tokens
, PostgreSQL
database integration, migration management, and a RESTful API documented with Swagger (OpenAPI).
Follow these steps to set up and run the Golang Todo Application Backend on your local machine.
- Golang installed on your machine (last update on go 1.21.4)
- PostgreSQL database server
- Make tool installed
-
Clone the repository:
git clone https://github.com/moxicom/todo-back.git cd todo-back
-
Create a
.env
file and aconfigs/config.yaml
file with your database connection details:.env:
DB_PASSWORD=YOUR_PASSWORD PASSWORD_SALT=mysalt
config.yaml
# Server port server_port: "8080" # db host: "localhost" user: "postgres" dbname: "gorm_test" port: "5432" sslmode: "disable"
-
Run the migration to set up the database:
make migrate
-
Start the Golang Todo Application Backend:
make run
The application will run on
http://localhost:8080
by default. -
Access the Swagger documentation at
your_server_link/swagger/index.html
to explore and interact with the REST API.
The API is documented using Swagger (OpenAPI). Visit Swagger Documentation for detailed information on available endpoints, request/response formats, and authentication requirements.
Feel free to contribute to this project by submitting bug reports, feature requests, or pull requests. Your contributions are highly appreciated!
- Special thanks to the Golang community and the developers of libraries and tools used in this project.
Happy coding! 🚀