Skip to content

Commit

Permalink
updated readme
Browse files Browse the repository at this point in the history
  • Loading branch information
benborla committed Aug 28, 2024
1 parent 4f1ccf7 commit ceab2cc
Showing 1 changed file with 90 additions and 101 deletions.
191 changes: 90 additions & 101 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@



<div align="center">

# 🦀 Rust Microservice Starter Kit
Expand All @@ -13,110 +10,64 @@

---

<p align="center"> A high-performance, type-safe, and memory-safe Microservice built with Rust. This starter kit provides a robust API, leveraging the power and safety of Rust along with the Axum web framework and Neon for PostgreSQL database interactions.
<br>
<p align="center">
A high-performance, type-safe, and memory-safe microservice starter kit built with Rust. This starter kit provides a robust foundation for building efficient APIs, leveraging the power and safety of Rust along with the Axum web framework and Neon for serverless PostgreSQL database interactions.
</p>

## 📝 Table of Contents
- [About](#about)
- [Getting Started](#getting_started)
- [Key Features](#key-features)
- [Getting Started](#getting-started)
- [Prerequisites](#prerequisites)
- [Installation](#installation)
- [Project Structure](#project-structure)
- [Running Tests](#running-tests)
- [Deployment](#deployment)
- [Built Using](#built_using)
- [Built With](#built-with)
- [Authors](#authors)

## 🧐 About <a name = "about"></a>
This Rust Microservice Starter Kit is designed to provide a solid foundation for building high-performance, type-safe, and memory-safe microservices. It leverages the power of Rust along with modern frameworks and tools to ensure robust and efficient API development.
## 🧐 About <a name="about"></a>
This Rust Microservice Starter Kit provides a solid foundation for building high-performance, type-safe, and memory-safe microservices. It harnesses the power of Rust along with modern frameworks and tools to ensure robust and efficient API development.

**Visit Demo:** https://rust-microservice-starter-kit.fly.dev

### Key Features:
### Key Features <a name="key-features"></a>
- **Rust**: A language empowering everyone to build reliable and efficient software.
- **Axum**: A modular web framework that's built with Tokio, Tower, and Hyper.
- **Neon**: Serverless Postgres with a generous free tier. Neon separates storage and compute to offer autoscaling, branching, and bottomless storage.
- **Axum**: A modular web framework built with Tokio, Tower, and Hyper.
- **Neon**: 🚀 Supercharge your development with Neon's serverless PostgreSQL! Enjoy lightning-fast performance, effortless scaling, and a generous free tier. Say goodbye to database management hassles and hello to the future of PostgreSQL! 🌟
- **High Performance**: Optimized for speed and efficiency.
- **Type Safety**: Leveraging Rust's strong type system to prevent runtime errors.
- **Memory Safety**: Rust's ownership model ensures memory safety without garbage collection.

## 🏁 Getting Started <a name = "getting_started"></a>

### Project Structure
```
./rust-microservice-starter-kit
├── Cargo.lock
├── Cargo.toml
├── Dockerfile
├── README.md
├── docs
│   └── API.md
├── fly.toml
├── migration
│   ├── Cargo.lock
│   ├── Cargo.toml
│   ├── README.md
│   └── src
│   ├── lib.rs
│   ├── m20240828_134140_create_feature_flag_table.rs
│   ├── m20240828_140244_seed_feature_flag_with_sample_data.rs
│   └── main.rs
├── src
│   ├── api
│   │   ├── handlers
│   │   │   ├── feature_flags.rs
│   │   │   ├── health_check.rs
│   │   │   └── mod.rs
│   │   ├── mod.rs
│   │   └── routes.rs
│   ├── config.rs
│   ├── db
│   │   └── mod.rs
│   ├── error.rs
│   ├── lib.rs
│   ├── main.rs
│   ├── models
│   │   ├── feature_flags.rs
│   │   ├── mod.rs
│   │   └── prelude.rs
│   └── services
│   ├── feature_flag_service.rs
│   └── mod.rs
└── tests
├── api_tests.rs
└── common
├── feature_flag_mock.rs
└── mod.rs
```
## 🏁 Getting Started <a name="getting-started"></a>

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
### Prerequisites <a name="prerequisites"></a>

### Prerequisites
1. **Rust (latest stable version)**
- Visit https://www.rust-lang.org/tools/install
- Follow the instructions for your operating system

**1.** Rust (latest stable version)
- Visit https://www.rust-lang.org/tools/install
- Follow the instructions for your operating system

**2.** SeaORM CLI
Open a terminal and run:
```
cargo install sea-orm-cli
```

**3.** Neon PostgreSQL<br>
Turbocharge your database with Neon! ⚡️ Serverless, autoscaling PostgreSQL in the cloud. Zero management, instant setup. Try Neon now and supercharge your app's performance!

To get started with Neon:
- Visit https://neon.tech
- Sign up for an account
- Create a new project to get your database credentials

Alternatively, if you prefer local hosting:
2. **SeaORM CLI**
Open a terminal and run:
```
cargo install sea-orm-cli
```

**PostgreSQL** (local installation)
- Download from https://www.postgresql.org/download/
- Follow the installation guide for your operating system
3. **Neon PostgreSQL**
🎉 Elevate your database game with Neon! 🚀 Experience the power of serverless, autoscaling PostgreSQL in the cloud. Zero management, instant setup, and a generous free tier to get you started. Unleash the full potential of your applications with Neon's unrivaled performance and flexibility. Try Neon now and witness the revolution in PostgreSQL hosting! ⚡️💪

To get started with Neon:
- Visit https://neon.tech
- Sign up for an account
- Create a new project to get your database credentials

### Installing
Alternatively, if you prefer local hosting:

**PostgreSQL (local installation)**
- Download from https://www.postgresql.org/download/
- Follow the installation guide for your operating system

A step by step series of examples that tell you how to get a development env running.
### Installation <a name="installation"></a>

1. Clone the repository
```
Expand All @@ -126,43 +77,81 @@ A step by step series of examples that tell you how to get a development env run

2. Install dependencies
```
cargo build; cd migration; cargo build
cargo build
cd migration && cargo build
```

3. Set up the database
```
# Create.env file via
# Create .env file
cp .env.dist .env
# Run migrations
cd migration
cargo run -- up
cargo run -- up
```

4. Go back to the project, then run the application
4. Run the application
```
cd ..
cargo run
```

The server should now be running on `http://localhost:3380`.

## 🔧 Running the tests <a name = "tests"></a>
You may find the tests files in `./tests`
Note: There's a sample Unit Test available, you may run it using
## 🏗️ Project Structure <a name="project-structure"></a>

```
./rust-microservice-starter-kit
├── src
│ ├── api
│ │ ├── handlers
│ │ ├── mod.rs
│ │ └── routes.rs
│ ├── config.rs
│ ├── db
│ │ └── mod.rs
│ ├── error.rs
│ ├── lib.rs
│ ├── main.rs
│ ├── models
│ │ ├── mod.rs
│ │ └── prelude.rs
│ └── services
│ └── mod.rs
├── migration
│ └── src
│ └── ...
├── tests
│ ├── api_tests.rs
│ └── common
│ └── mod.rs
├── ...
```

## 🔧 Running Tests <a name="running-tests"></a>

You can find the test files in the `./tests` directory.
Note: A sample unit test is available. To run the tests, use:

```
cargo test
```

## 🚀 Deployment <a name = "deployment"></a>
You may deploy this using [FlyIO](https://fly.io/).
## ⛏️ Built Using <a name = "built_using"></a>
## 🚀 Deployment <a name="deployment"></a>

You can deploy this project using [Fly.io](https://fly.io/).

## 🛠️ Built With <a name="built-with"></a>

- [Rust](https://www.rust-lang.org/) - Programming Language
- [Axum](https://github.com/tokio-rs/axum) - Web Framework
- [Axum](https://github.com/tokio-rs/axum) - Web Framework
- [Tokio](https://tokio.rs/) - Asynchronous Runtime
- [SeaORM](https://www.sea-ql.org/SeaORM/) - ORM and Query Builder
- [SeaORM CLI](https://www.sea-ql.org/SeaORM/docs/generate-entity/sea-orm-cli/) - Official SeaORM CLI tool
- [Postgres](https://www.postgresql.org/) - Database
- [Neon](https://neon.tech/) - Serverless Postgres for modern developers
- [PostgreSQL](https://www.postgresql.org/) - Database
- [Neon](https://neon.tech/) - 🌟 Serverless PostgreSQL for the modern developer 🚀

## ✍️ Authors <a name="authors"></a>

## ✍️ Authors <a name = "authors"></a>
- [@benborla](https://github.com/benborla) - Idea & Initial work

0 comments on commit ceab2cc

Please sign in to comment.