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

Update README.md #54

Merged
merged 2 commits into from
Oct 30, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
128 changes: 100 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,56 +1,128 @@
# Affinity Backend

## Introduction
This repository contains the backend for the **Affinity** project, built using the [Axum](https://github.com/tokio-rs/axum) framework in Rust. The backend manages API requests and communicates with a PostgreSQL database, ensuring high performance and scalability.

## Tech Stack
- **Language**: Rust
- **Framework**: Axum
- **Database**: PostgreSQL
- **Containerization**: Docker
- **CI/CD**: Github Actions ,Jenkins, Docker Compose

## Setup
# 🚀 Affinity Backend

Welcome to the **Affinity** backend repository! This project is powered by the blazing-fast [Axum](https://github.com/tokio-rs/axum) framework, built using **Rust** to handle API requests and efficiently communicate with a **PostgreSQL** database. Our backend is optimized for high performance and scalability, designed to meet the demands of modern applications.
<div align="center">
<img src="https://github.com/user-attachments/assets/ba566e43-01cf-4340-902f-57c091756896" alt="Affinity Architecture" width="300"/>
</div>

<img src="https://user-images.githubusercontent.com/74038190/212284100-561aa473-3905-4a80-b561-0d28506553ee.gif" width="900">

## 🛠️ Tech Stack

- **🦀 Language**: Rust
- **⚙️ Framework**: Axum
- **💾 Database**: PostgreSQL
- **🐳 Containerization**: Docker
- **🚀 CI/CD**: GitHub Actions, Jenkins, Docker Compose

<img src="https://user-images.githubusercontent.com/74038190/212284100-561aa473-3905-4a80-b561-0d28506553ee.gif" width="900">

## 📋 Setup

### Prerequisites

Make sure you have the following installed:

- [Rust](https://www.rust-lang.org/tools/install)
- [PostgreSQL](https://www.postgresql.org/)
- [Docker](https://www.docker.com/) (optional, if running in a container)

### Installation

1. **Clone the repository:**

```bash
git clone https://github.com/Sidharth-Singh10/Affinity-backend
cd Affinity-backend
2. **Build and run the backend:**
```

2. **Build and run the backend:**

```bash
cargo build
cargo run
```
### Running in Docker
The `dockerfile` is incomplete, add `env` accordingly.
The `docker-compose` is incomplete.
database url does not feed into the backend `env`

### Running in K8
`helm install <app-name> ./hell_charts`
does the work without setting up a database.
Configure `values.json` before running the command.

## Contributing
Read [CONTRIBUTING.md](https://github.com/Sidharth-Singh10/Affinity-backend/blob/main/CONTRIBUTING.md)

## Affinity Project
<img src="https://user-images.githubusercontent.com/74038190/212284100-561aa473-3905-4a80-b561-0d28506553ee.gif" width="900">

### Running in Docker 🐳

To run the project in Docker, ensure that the environment variables for database connection are properly set. Follow these steps:

1. **Build the Docker image:**

```bash
docker build -t affinity-backend .
```

2. **Run the Docker container:**

```bash
docker run -e DATABASE_URL=<your_database_url> -p 8000:8000 affinity-backend
```

3. **Using Docker Compose:**

Update the `docker-compose.yml` file with the correct environment variables, and then:

```bash
docker-compose up
```

<img src="https://user-images.githubusercontent.com/74038190/212284100-561aa473-3905-4a80-b561-0d28506553ee.gif" width="900">

### Running on Kubernetes with Helm ⛵

Deploy the project on a Kubernetes cluster using Helm:

1. **Configure `values.yaml`:**

Make sure your `values.yaml` file is properly set up with the required database configuration.

2. **Install the application with Helm:**

```bash
helm install <app-name> ./helm_charts
```

<img src="https://user-images.githubusercontent.com/74038190/212284100-561aa473-3905-4a80-b561-0d28506553ee.gif" width="900">

## 🌱 Contributing

We welcome contributions! Please check out our [CONTRIBUTING.md](https://github.com/Sidharth-Singh10/Affinity-backend/blob/main/CONTRIBUTING.md) to get started. Contributions are expected to follow good practices, maintain code quality, and align with the project’s objectives.

<img src="https://user-images.githubusercontent.com/74038190/212284100-561aa473-3905-4a80-b561-0d28506553ee.gif" width="900">

## 🏗️ Affinity Project Overview

1. **Architecture** (deprecated)

![image](https://github.com/user-attachments/assets/402a9b69-eccd-478b-9c0e-50810200c28d)
2. **Links**
- Frontend: `https://github.com/rishyym0927/Affinity_frontend`
![Architecture](https://github.com/user-attachments/assets/402a9b69-eccd-478b-9c0e-50810200c28d)

2. **Frontend Repository**:
The frontend code for this project is available at:
[Affinity Frontend](https://github.com/rishyym0927/Affinity_frontend)

<img src="https://user-images.githubusercontent.com/74038190/212284100-561aa473-3905-4a80-b561-0d28506553ee.gif" width="900">

## ❤️ Our Valuable Contributors
<div align="center">
<img src="https://github.com/user-attachments/assets/c7f169de-e8e9-418e-a08e-c69b34c23a41" alt="Affinity Architecture" width="200"/>
</div>


## Our Valuable Contributors ❤️✨

[![Contributors](https://contrib.rocks/image?repo=Sidharth-Singh10/Affinity-backend)](https://github.com/Sidharth-Singh10/Affinity-backend/graphs/contributors)

<img src="https://user-images.githubusercontent.com/74038190/212284100-561aa473-3905-4a80-b561-0d28506553ee.gif" width="900">

## 📄 License

This project is licensed under the MIT License - see the [LICENSE](https://github.com/Sidharth-Singh10/Affinity-backend/blob/main/LICENSE) file for details.


This version includes all necessary build, run, and deployment instructions formatted as code blocks for ease of use.
<img src="https://user-images.githubusercontent.com/74038190/212284100-561aa473-3905-4a80-b561-0d28506553ee.gif" width="900">