MCPcopy Index your code
hub / github.com/dangwy/urlshorter

github.com/dangwy/urlshorter @v0.2.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.2.0 ↗ · + Follow
203 symbols 343 edges 56 files 6 documented · 3%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

🦀 urlshorter

urlshorter is a high-performance and fully functional short url service in rust, you can use it directly in the production environment.

Uses Auxm, SeaOrm and PostgreSQL, the system architecture references RUSTfulapi.

The Redis is optional, you can uncomment the code in the program if you want to use it.


Features

  • It can be transformed into a SaaS service with simple modifications
  • Provides short url CRUD functionality
  • Support labeling different URLs
  • Support JWT authentication (just need to modify it according to your business requirements)

How To Deploy

Running locally

./run
# open swagger panel
xdg-open http://127.0.0.1:8080/swagger-ui/
# manually testing your API routes with curl commands
curl -X GET http://127.0.0.1:8080/api/v1/server/health_check

Running in Docker

cd ./docker/dev/ && ./up.sh

How To Use It

Configure with toml files

settings
├── base.toml # default config file 
├── dev.toml # development config file 
├── prod.toml # production config file
└── test.toml # test config file

Switching profiles

Before running the application, export this variable:

export APP_PROFILE=prod # Switch to production profile

Migrate database

cargo run --bin migration -- up -u $DATABASE_URL

License

Licensed under either of

  • MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)

Contributing

Contributors are welcome! please fork and send pull requests, If you find a bug or have any ideas on how to improve this project please submit an issue.

See CONTRIBUTING.md.

Extension points exported contracts — how you extend this code

RedisKey (Interface)
(no doc) [3 implementers]
src/service/redis.rs
ClientBuilder (Interface)
(no doc) [2 implementers]
src/client/mod.rs
UserClaimsRequest (Interface)
(no doc) [1 implementers]
src/utils/claim.rs
AppEntity (Interface)
(no doc) [1 implementers]
src/entities/mod.rs
ToAppResult (Interface)
(no doc) [1 implementers]
src/error/mod.rs
HttpClientExt (Interface)
(no doc) [1 implementers]
src/client/http.rs
RedisClientExt (Interface)
(no doc) [1 implementers]
src/client/redis.rs
DatabaseClientExt (Interface)
(no doc) [1 implementers]
src/client/database.rs

Core symbols most depended-on inside this repo

get
called by 6
src/client/redis.rs
get
called by 6
src/service/url.rs
set
called by 5
src/client/redis.rs
exist
called by 5
src/client/redis.rs
get_project_root
called by 5
src/utils/dir.rs
ping
called by 4
src/client/redis.rs
ttl
called by 4
src/client/redis.rs
find_by_alias
called by 4
src/repo/urls.rs

Shape

Function 92
Method 59
Class 38
Interface 8
Enum 6

Languages

Rust100%

Modules by API surface

src/client/redis.rs17 symbols
src/service/redis.rs14 symbols
src/error/mod.rs14 symbols
src/utils/claim.rs9 symbols
src/dto/response.rs9 symbols
src/configure/secret.rs9 symbols
src/repo/tags.rs8 symbols
src/dto/request.rs8 symbols
src/client/database.rs8 symbols
src/repo/urls.rs6 symbols
src/configure/mod.rs6 symbols
src/client/http.rs6 symbols

For agents

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

⬇ download graph artifact

Ask about this repo answers extend the page