Entry-Server is a robust, fully-equipped backend project in Rust that's ready for use. Whether you're an independent developer or part of a small startup team looking to streamline server-side development, this project could be just what you need.
- High performance and strong security measures
- Lower machine resource usage
- A well-thought-out project setup, complete with unified response handling, and efficient database and cache usage, among other things
- A variety of business systems, including a user system, OAuth login/registration, and a license system
- Designed for easy extension, allowing you to concentrate on developing your unique business logic
- Simple deployment, with Docker Compose offering a one-click startup solution
Method | Endpoint |
---|---|
GET | /api/v1/license/:license |
POST | /api/v1/license/:license |
GET | /api/v1/user |
POST | /api/v1/user |
POST | /api/v1/user/login |
PATCH | /api/v1/user/password |
GET | /api/v1/user/oauth/:provider |
POST | /api/v1/user/oauth/:provider |
GET | /api/v1/sync |
POST | /api/v1/sync |
DELETE | /api/v1/sync |
-
Development Language: Rust
-
Web Framework: Axum
-
Database: PostgreSQL with SeaORM
-
Cache: Redis with Fred
After cloning the project
-
Prepare environment variables:
The project uses
dotenv
to initialize environment variables, which means you can create a.env
file in the project root directory to define variables.Here are some necessary environment variables, Do not use the following information in a production environment:
DATABASE_URL=postgres:https://entry_server:[email protected]:5432/entry POSTGRES_DB=entry POSTGRES_USER=entry_server POSTGRES_PASSWORD=123456 REDIS_URL=redis:https://127.0.0.1:6379 ENTRY_SERVER_ADDR=127.0.0.1:3000
There are also some unnecessary environment variables that you may need when you need some other features.
-
Prepare the database:
There is an initialization script in the
sql
directory, and you need to run it first. -
Start service dependencies:
docker compose -f docker-compose.yaml up -d
-
Run
cargo run
todo!()