{"id":20020766,"url":"https://github.com/dracuxan/StocksAPI","last_synced_at":"2025-05-05T01:30:45.434Z","repository":{"id":257464508,"uuid":"858356280","full_name":"dracuxan/StocksAPI","owner":"dracuxan","description":"How did I make API using Golang PostgreSQL?","archived":false,"fork":false,"pushed_at":"2024-10-01T06:42:48.000Z","size":25,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-23T06:57:48.578Z","etag":null,"topics":["api","go","golang","middleware","postgresql","restful","restful-api"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dracuxan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-09-16T18:49:04.000Z","updated_at":"2025-01-14T17:59:57.000Z","dependencies_parsed_at":"2024-09-16T23:46:26.121Z","dependency_job_id":"26ca4c5c-6cee-4ea0-9f0c-b6483c880c71","html_url":"https://github.com/dracuxan/StocksAPI","commit_stats":null,"previous_names":["nisarg2061/stocksapi","dracuxan/stocksapi"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dracuxan%2FStocksAPI","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dracuxan%2FStocksAPI/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dracuxan%2FStocksAPI/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dracuxan%2FStocksAPI/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dracuxan","download_url":"https://codeload.github.com/dracuxan/StocksAPI/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252422945,"owners_count":21745518,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","go","golang","middleware","postgresql","restful","restful-api"],"created_at":"2024-11-13T08:34:01.390Z","updated_at":"2025-05-05T01:30:45.086Z","avatar_url":"https://github.com/dracuxan.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Stocks Management System\nThis project is a simple stocks management system using Go and PostgreSQL.\n\n## Project Structure\n```\n.\n├── .github                # GitHub-related configuration files\n├── cmd                    # Contains the main application code\n│   ├── middleware         # Middlewares and Request handlers for handling requests\n│   │   ├── handlers.go  \n│   │   └── middleware.go\n│   ├── models             # Database models\n│   │   └── models.go\n│   ├── router             # API routing\n│   │   └── router.go\n│   └── main.go            # Application entry point\n├── .env                   # Environment variables\n├── .gitignore             # Gitignore file\n├── LICENSE                # License file\n├── Makefile               # Makefile for running commands\n├── README.md              # Project README\n├── go.mod                 # Go modules file\n├── go.sum                 # Dependencies checksum\n└── script.sql             # SQL script to set up the database\n```\n\n## Prerequisites\n\n- Go (version 1.16 or higher)\n- PostgreSQL\n- Environment variables specified in the `.env` file\n\n## Installation and Setup\n1. Clone the repository:\n```\ngit clone https://github.com/Nisarg2061/StocksAPI.git \u0026\u0026 cd StocksAPI\n```\n\n2. Set up the database:\nMake sure PostgreSQL is running locally. You can use the script.sql file to set up the database:\n```\npsql -h localhost -U postgres -d stocksdb -a -f script.sql\n```\nThis will create the required tables and populate initial data into the stocksdb database.\n\n3. Set up environment variables\nCreate a .env file in the root directory and set the required variables:\n```\nPOSTGRES_URL=your_postgres_connection_url\n```\nMake sure to replace `your_postgres_connection_url` with your actual PostgreSQL connection string (e.g., `postgres://username:password@localhost:5432/stocksdb`).\n\n4. Run the application\nYou can use the Makefile to build and run the project. To start the server, run:\n```\nmake run\n```\nThe application should now be running on the configured port.\n\n## Usage\n\n- The API routes are defined in router/router.go.\n- Handlers for various routes are in handlers.go.\n- Middleware logic is found in middleware/middleware.go.\n- Database models are in models/models.go.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdracuxan%2FStocksAPI","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdracuxan%2FStocksAPI","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdracuxan%2FStocksAPI/lists"}