chi-rest-api

module
v0.0.0-...-3751b6e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 25, 2023 License: MIT

README ΒΆ

CHI Rest API πŸ’»

GitHub license GitHub issues GitHub stars Golang SQLite Go-Chi Swagger

This is a simple RESTful API project developed using Golang πŸš€, Swagger πŸ“‘, Chi πŸ‘·, and SQLite πŸ“. The purpose of this API is to create and manage users πŸ‘₯ and products πŸ“¦. It provides endpoints for creating, retrieving, updating, and deleting users and products.

πŸ“‚ Project Structure

chi-rest-api/
β”œβ”€ cmd/
β”‚  β”œβ”€ server/
β”‚  β”‚  β”œβ”€ main.go
β”œβ”€ configs/
β”‚  β”œβ”€ configs.go
β”œβ”€ docs/
β”œβ”€ internal/
β”‚  β”œβ”€ dto/
β”‚  β”œβ”€ entity/
β”‚  β”œβ”€ infra/
β”‚  β”‚  β”œβ”€ database/
β”‚  β”‚  β”œβ”€ webserver/
β”œβ”€ pkg/
β”‚  β”œβ”€ entity/
β”œβ”€ test/
  • cmd/server/: Contains the main application file for your server.

  • configs/: Houses configuration files or settings for your Go application.

  • docs/: May include documentation files or assets related to your project.

  • internal/: Organizes your internal code, with separate folders for DTO, entities, and infrastructure.

  • internal/infra/: Infrastructure code with subdirectories for database and webserver.

  • pkg/entity/: Contains code related to entities used in your application.

  • test/: May include test files or assets for your project.

πŸ› οΈ Prerequisites

Before running this project, you'll need to have Golang and SQLite installed on your system.

πŸš€ Running the Project

To run the project:

  1. Clone this repository to your local machine.

  2. Open your terminal and navigate to the project's root directory:

    cd chi-rest-api
    
  3. Run the following command to start the application:

    go run ./cmd/server/main.go
    
  4. The API will be available at http://localhost:3001.

Usage πŸ’»

You can use tools like curl or Postman to interact with the API. The API provides endpoints for creating, retrieving, updating, and deleting users and products.

Swagger Documentation πŸ“–

The API is documented using Swagger, providing comprehensive details about endpoints, request parameters, and response formats. Access the Swagger documentation at http://localhost:3001/swagger/index.html when the API is running.

Database πŸ“

This project uses SQLite as the database for simplicity. You can find the database file in the data directory.

🀝 Contributing

If you wish to contribute to this project, please follow these guidelines:

  1. Fork the repository.

  2. Create a new branch for your feature or bug fix.

  3. Implement your changes.

  4. Test your changes thoroughly.

  5. Create a pull request with a clear description of your changes.

πŸ“„ License

This project is licensed under the MIT License. Feel free to use and modify it according to your needs.

Enjoy using this CHI Rest API with Golang, Swagger, Go-Chi, and SQLite for managing users and products! πŸŽ‰

You can further customize this README with your specific details and make any additional changes as needed.

Directories ΒΆ

Path Synopsis
cmd
Package docs Code generated by swaggo/swag.
Package docs Code generated by swaggo/swag.
internal
dto
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL