{"id":21310994,"url":"https://github.com/dgonzo27/rust-tide-pg","last_synced_at":"2025-03-15T20:41:23.121Z","repository":{"id":219013502,"uuid":"609327845","full_name":"dgonzo27/rust-tide-pg","owner":"dgonzo27","description":"A Rust (Tide) API with a containerized PostgreSQL database.","archived":false,"fork":false,"pushed_at":"2023-03-07T03:26:00.000Z","size":29,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-22T09:42:32.320Z","etag":null,"topics":["jwt-auth","rust","rust-api","sqlx","tide"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dgonzo27.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null},"funding":{"github":["dgonzo27"]}},"created_at":"2023-03-03T21:51:08.000Z","updated_at":"2023-03-07T03:29:28.000Z","dependencies_parsed_at":"2024-01-25T01:00:01.707Z","dependency_job_id":null,"html_url":"https://github.com/dgonzo27/rust-tide-pg","commit_stats":null,"previous_names":["dgonzo27/rust-tide-pg"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dgonzo27%2Frust-tide-pg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dgonzo27%2Frust-tide-pg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dgonzo27%2Frust-tide-pg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dgonzo27%2Frust-tide-pg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dgonzo27","download_url":"https://codeload.github.com/dgonzo27/rust-tide-pg/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243790947,"owners_count":20348378,"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":["jwt-auth","rust","rust-api","sqlx","tide"],"created_at":"2024-11-21T17:15:36.732Z","updated_at":"2025-03-15T20:41:23.094Z","avatar_url":"https://github.com/dgonzo27.png","language":"Rust","funding_links":["https://github.com/sponsors/dgonzo27"],"categories":[],"sub_categories":[],"readme":"# Rust + Tide + PostgreSQL\n\n[![Rust](https://img.shields.io/badge/Rust-v1.67.1-blue?logo=rust\u0026logoColor=000000)](https://www.rust-lang.org) [![Tide](https://img.shields.io/badge/Tide-v0.16.0-blue?logo=tide\u0026logoColor=4050FB)](https://github.com/http-rs/tide) [![Docker](https://img.shields.io/badge/Docker-latest-blue?logo=docker\u0026logoColor=blue)](https://www.docker.com/products/docker-desktop/) [![Pre-Commit](https://img.shields.io/badge/Hooks-Pre--Commit-blue?logo=pre-commit\u0026logoColor=FAB040)](https://pre-commit.com) [![Bash](https://img.shields.io/badge/GNU-Bash-blue?logo=gnu-bash\u0026logoColor=4EAA25)](https://www.gnu.org/software/bash/) [![GitHub_Actions](https://img.shields.io/badge/CI/CD-GitHub_Actions-blue?logo=githubactions\u0026logoColor=2088FF)](https://docs.github.com/en/actions)\n\nThis repository contains a Rust (Tide) API with a containerized PostgreSQL database. Additionally, the repository contains a Rust test suite for integration testing API routes as it relates to CRUD operations and transactions against the containerized database.\n\n## Table of Contents\n\n- [Getting Started](#getting-started)\n  - [Prerequisites](#prerequisites)\n  - [Local Development Guide](#local-development-guide)\n  - [Other Commands](#other-commands)\n- [Need Support?](#need-support)\n- [Reporting Security Vulnerabilities and Security Bugs](#reporting-security-vulnerabilities-and-security-bugs)\n- [Contributing](#contributing)\n\n## Getting Started\n\nThis section provides supporting steps and documentation for developing locally.\n\n### Prerequisites\n\nBefore jumping into the code, there are a few prerequisites.\n\n1. Local development should be done from a UNIX-based machine - use Linux, MacOS, or WSL2 if you're on a Windows machine.\n\n2. GitHub access should be managed through an SSH key in your UNIX environment. If you're unfamiliar with this process [start here](https://docs.github.com/en/authentication/connecting-to-github-with-ssh).\n\n3. [Docker Desktop](https://www.docker.com/products/docker-desktop/) should be installed on your machine for local development. If you're on Windows, configure your settings to enable Docker Desktop in WSL2.\n\n4. [pre-commit](https://pre-commit.com/) should be installed globally on your machine for linting and validating your code prior to pushing up to GitHub.\n\n5. [Rust](https://www.rust-lang.org/tools/install) should be installed globally on your machine for compiling and running code.\n\n6. Optionally, the [Rust-Analyzer](https://marketplace.visualstudio.com/items?itemName=rust-lang.rust-analyzer) extension can be installed in VS Code for a better development experience.\n\n### Local Development Guide\n\nThis project uses a variation of [scripts to rule them all](https://github.com/github/scripts-to-rule-them-all).\n\n1. Clone the repository (if this is your first time).\n\n   ```sh\n   git clone git@github.com:dgonzo27/rust-tide-pg.git\n   ```\n\n2. Navigate into the repository directory.\n\n   ```sh\n   cd rust-tide-pg\n   ```\n\n3. Ensure pre-commit is enabled for this repository.\n\n   ```sh\n   pre-commit install\n   ```\n\n4. You might need to give yourself access to the scripts for running this project.\n\n   ```sh\n   chmod +rwx scripts/clean\n   chmod +rwx scripts/compile\n   chmod +rwx scripts/database\n   chmod +rwx scripts/format\n   chmod +rwx scripts/server\n   chmod +rwx scripts/setup\n   chmod +rwx scripts/stop\n   chmod +rwx scripts/test\n   ```\n\n5. Run the project.\n\n   ```sh\n   scripts/setup\n   ```\n\n6. From a new terminal tab or an API client of your choice, test some API routes.\n\n   ```sh\n   # create a new user\n   curl -v -d '{\"username\": \"my_username\", \"first_name\": \"My\", \"last_name\": \"Username\", \"password\": \"password\"}' http://localhost:8080/api/v1/auth/signup\n\n   # login as the new user\n   curl -v -d '{\"username\": \"my_username\", \"password\": \"password\"}' http://localhost:8080/api/v1/auth/login\n\n   # using the returned access token, test the movie routes\n   curl -H \"Authorization: Bearer \u003caccess_token_here\u003e\" -v -d '{\"title\": \"test\", \"description\": \"test\"}' http://localhost:8080/api/v1/movies\n   curl -H \"Authorization: Bearer \u003caccess_token_here\u003e\" -g http://localhost:8080/api/v1/movies\n   curl -H \"Authorization: Bearer \u003caccess_token_here\u003e\" -g http://localhost:8080/api/v1/movies/1\n   curl -H \"Authorization: Bearer \u003caccess_token_here\u003e\" -X PUT -d '{\"id\": 1, \"title\": \"new title\", \"description\": \"new desc\"}' http://localhost:8080/api/v1/movies/1\n   curl -H \"Authorization: Bearer \u003caccess_token_here\u003e\" -X DELETE http://localhost:8080/api/v1/movies/1\n   ```\n\n7. Stop the Rust server from your original terminal tab.\n\n   ```sh\n   ctrl + c\n   ```\n\n8. Run the test suite.\n\n   ```sh\n   scripts/test\n   ```\n\n9. Stop the development environment.\n\n   ```sh\n   scripts/stop\n   ```\n\n### Other Commands\n\n1. Format and validate all files.\n\n   ```sh\n   scripts/format\n   ```\n\n2. Clean your database, removing any existing volumes and images (data).\n\n   ```sh\n   scripts/clean\n   ```\n\n## Need Support?\n\nFile an issue via [GitHub Issues](https://github.com/dgonzo27/rust-tide-pg/issues).\n\n## Reporting Security Vulnerabilities and Security Bugs\n\nSecurity vulnerabilities and bugs should be reported privately, via email, to the maintainers of this repository. Please contact [Dylan Gonzales](mailto:dylangonzales247@gmail.com). For more information, visit the [security guidelines](./SECURITY.md).\n\n## Contributing\n\nBefore contributing to this repository, please review the [code of conduct](./CODE_OF_CONDUCT.md).\n\nContributions and suggestions are welcomed. However, there is a level of responsibility placed on the contributor to follow best-practices, provide thorough testing, follow the branching strategy, use the pull request template, and maintain a positive and coachable attitude when receiving feedback or questions on your code. For more details on these responsibilities, please visit the [contributing guide](./CONTRIBUTING.md).\n\nWhen contributing, you are granting the maintainers of this repository the rights to use your contribution(s).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdgonzo27%2Frust-tide-pg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdgonzo27%2Frust-tide-pg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdgonzo27%2Frust-tide-pg/lists"}