Git Product home page Git Product logo

blog-rust's Introduction

Hi there, this is a toy project to experiment building a simple blog CRUD application with Rust, Axum and MongoDB. This project provides a simple API for adding users and articles, and view/read all the articles as well The goal of this project is completely educational, feel free to use it however you want.

๐Ÿšจ It's still a work in progress. ๐Ÿค“ ๐Ÿ’ป

Image 1 Image 2

I recommend using docker and docker compose to try the project, but feel free to use the other method as well.

Feature List

  • โœ… Add Article
  • โœ… Add User
  • โœ… View Articles
  • โณ Delete Article
  • โณ Authentication

Usage

Docker

You need to have docker and docker comopse installed.

Without Docker

You need to have rust and MongoDB installed.

  • Run the following command to install Rust:

    curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

NOTE: If you find the command sketchy, please head to the official website and check for yourself ๐Ÿ˜

  • Install MongoDB (Community Edition) Official Documentation
  • Check that the mongodb server is running locally, for example, on Mac OS run:

    brew services list | grep mongodb

  • If the server is in the started status then everything should be fine.

NOTE: Check the docs for linux and windows.

  • Head to the project directory and run the web server

    cargo run

Examples

Add an article using curl

curl -X POST -H "Content-Type: application/json" -d '{
    "title": "Title goes here", \
    "body": "article body goes here" \
}' http://localhost:3000/api/article`

View all existing articles

curl http://localhost:3000/api/list

blog-rust's People

Contributors

mohamed-said avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.