Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Rust-ActixWeb-Postgres API with Actix-Web, Postgres, and Deadpool connection pooling #60

Merged
merged 1 commit into from
Oct 8, 2024

Conversation

HarshitShukla-dev
Copy link
Contributor

Closes: #40

Overview

This PR introduces a basic CRUD API implementation for managing user data using Rust with the Actix-Web framework and PostgreSQL database which can be easily extended with additional features satisfying the developer's needs. It includes the following features:

  • User model: Represents the user data with fields for ID, username, email, and password.
  • CRUD operations: Routes for creating, reading, updating, and deleting users (POST /users, GET /users, GET /users/{id}, PUT /users/{id}, DELETE /users/{id}).
  • Database setup: PostgreSQL connection pooling configured using Deadpool-Postgres.
  • Environment variables: Using Dotenvy for managing environment configuration.
  • Comments: Detailed inline comments added for better code comprehension.

Testing

  1. Ensure you have a PostgreSQL database running and create the required users table.
  2. Add the database connection details in the .env file.
  3. Run the API using cargo run and use Postman to test the endpoints:
    • POST /users for creating a user.
    • GET /users to fetch all users.
    • GET /users/{id} to fetch a specific user.
    • PUT /users/{id} to update a user's information.
    • DELETE /users/{id} to remove a user.

…ostgres

- Implement user model, routes, services, and database configuration
- Add environment variable support with dotenvy
- Set up connection pooling using deadpool-postgres
- Define routes for creating, reading, updating, and deleting users
- Include comments for better understanding of the code
- Add a README file with project structure, setup instructions, and API usage
Copy link

vercel bot commented Oct 7, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
create-my-api ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 7, 2024 7:18pm

@Puskar-Roy
Copy link
Owner

Hello @HarshitShukla-dev, thank you for your pull request! We will review it shortly. 😇❣️
Your contributions help us grow and improve our project. Please make sure you have read and followed our CONTRIBUTING GUIDELINES.
Your efforts are appreciated, and we value your participation in our community. Don't forget to ⭐ our repository!
Happy coding!✨

@Puskar-Roy
Copy link
Owner

Hey @HarshitShukla-dev! We're excited to let you know that your pull request has been merged into the APIverse🚀🎁
Your commitment, effort, and expertise have greatly influenced our project, and we're incredibly thankful for your contributions.😇
Your code is now part of our expanding ecosystem, assisting developers worldwide in creating exceptional APIs.❣️🔥
Happy Coding! ✨ We look forward to seeing you again soon!❣️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[ADD API] : Rust-ActixWeb-Postgres
2 participants