Conduit is the backend for a messaging application. This project is developed in Rust using the Rust web framework and SQLx for database management. Conduit provides an API that handles message exchanges and user management, designed to be scalable and efficient.
- Rust: Programming language used for the backend.
- Axum: Rust web framework used for backend development.
- SQLx: Asynchronous library to interact with SQL databases.
- Docker: Containerization tools for packaging the application.
- PostgreSQL: SQL database to store application data.
- Rust: Make sure you have Rust installed on your machine. If not, you can install it from rust-lang.org.
- Docker: You need to have Docker and Docker Compose installed. For installation instructions, visit docker.com.
Follow these steps to set up the project locally:
-
Rename the
.env.template
file to.env
:mv .env.template .env
-
Configure the
.env
file:- Add the database URL in the
.env
file. For example:
DATABASE_URL=postgres://user:password@localhost:5432/conduit_db
- Set the path to the RSA256 keys:
RSA_KEY_PATH=/path/to/rsa256/key
- Add the database URL in the
-
Run the database migrations to set up the database:
sqlx migrate run
-
Run the environment preparation:
sqlx prepare
-
Start the application containers:
docker-compose up -d
The backend will start listening on port 8080.
Once the project is up and running, the API will be available at http://localhost:8080
.
In the tests
folder, there are http
files that you can use with JetBrains IDEs to test the API endpoints. These files contain sample HTTP requests and can be run directly from the IDE to interact with the API.