MCPcopy Index your code
hub / github.com/DreadedHippy/axum-cms

github.com/DreadedHippy/axum-cms @v2.0.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v2.0.0 ↗ · + Follow
186 symbols 374 edges 40 files 47 documented · 25%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

axum-cms

A simple production-ready backend server template for Content Management Systems built with Rust using Axum. !!! Go through the Critical Information 🚨🚨🚨 section below before getting started !!!

Tools

Features

  • Authors (Authors of posts)
  • Posts (The actual content to be managed)
  • EditSuggestion (Edits on posts suggested by self or other authors)
  • Redis Caching (Discontinued, may be re-implemented in the future)
  • WebSocket Draft Saves (Coming Soon, perhaps)
  • Google sign-up/sign-in (Coming soon, perhaps)
  • Refactored for even quicker development 🚀🚀🚀. Happy coding 💫

Critical Information 🚨🚨🚨

  • Make sure to set the correct config information in the config file.
  • For production, Make sure to comment out _dev_utils::init_dev().await? in the main() function as this is for dev only.
  • For development, In all .sql files, individual database statements should end with ;--#, failure to do this may break dev database initialization
  • If you have a field with a database enum, I advise avoiding base's generic update method. This breaks with postgres at the moment, you would have to manually cast the enum fields to a database enum using sea_query. See the update method at edit.rs for a detailed example.

Routes

See here for the code implementation of all the routes

Auth

  • POST /signup: Sign up with name, email, and password
  • POST /login: Login with email and password

Author

  • GET /author: get all authors
  • GET /author/:id: Get specific author.

Post

  • GET /post: Get all posts
  • GET /post/:id: Get specific post
  • PATCH /post/:id: Update specific post
  • DELETE /post/:id: Delete specific post

Edit

  • GET /edit: List edits by/for an author's posts
  • GET /edit/incoming: List all incoming edits
  • GET /edit/outgoing: List all outgoing edits
  • GET /edit/:id: Get edit
  • PATCH /edit/:id: Update edit
  • DELETE /edit/:id: Delete edit
  • POST /edit/accept/:id Accept edit
  • POST /edit/reject/:id Reject edit

Testing

Unit Tests

You must have cargo-watch installed for these to work

# Run tests
cargo watch -q -c -x "test -- -- nocapture"

# Specific test with filter
cargo watch -q -c -x "test models::author::tests::test_create_ok"

# Run quick_dev exampl while developing
cargo watch -q -c -w examples/ -x "run --example quick_dev"

# Run any example while developing
cargo watch -q -c -w examples/ -x "run --example {FILE_NAME}"` # where `FILE_NAME` is the name of the file containing the test

Extension points exported contracts — how you extend this code

DbBmc (Interface)
Trait for Backend Model Controllers that are DB-related [3 implementers]
src/models/base.rs
AuthorBy (Interface)
Marker trait [3 implementers]
src/models/author.rs

Core symbols most depended-on inside this repo

get
called by 32
src/models/base.rs
user_id
called by 13
src/ctx/mod.rs
db
called by 13
src/models/mod.rs
get
called by 11
src/models/post.rs
list
called by 10
src/models/base.rs
init_test
called by 8
src/_dev_utils/mod.rs
update
called by 8
src/models/base.rs
config
called by 7
src/config.rs

Shape

Function 86
Method 46
Class 36
Enum 16
Interface 2

Languages

Rust100%

Modules by API surface

src/models/edit.rs21 symbols
src/models/author.rs20 symbols
src/models/post.rs15 symbols
src/models/base.rs11 symbols
src/crypt/token.rs11 symbols
src/web/handlers/edit.rs9 symbols
src/web/error.rs7 symbols
src/web/routes_login.rs6 symbols
src/utils/mod.rs6 symbols
src/config.rs6 symbols
src/web/routes/mod.rs5 symbols
src/web/middlewares/auth.rs5 symbols

Datastores touched

app_dbDatabase · 1 repos
axum_cmsDatabase · 1 repos

For agents

$ claude mcp add axum-cms \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact