This project is a business directory website using Svelte for the frontend and Rust for the backend API. It allows users to view and search for business listings, as well as register and login.
The project is divided into two main parts:
The frontend is located in the frontend directory. It's built using Svelte and SvelteKit for routing.
To run the frontend:
frontend directorynpm installnpm run devThe frontend will be available at http://localhost:5000.
The backend is located in the backend directory. It's built using Rust with the Axum framework and SeaORM for database operations.
To run the backend:
backend directorycargo runThe backend API will be available at http://localhost:8000.
/api/businesses: Fetch all businesses/api/businesses/search?q={query}: Search for businesses/api/businesses/{id}: Fetch a specific business by ID/api/users/register: Register a new user/api/users/login: Login a userThe project uses PostgreSQL as the database. Make sure to set up the database and update the .env file in the backend directory with the correct database credentials.
To work on this project, you'll need to have Node.js, npm, and Rust installed on your system. Follow the instructions in the respective directories to set up and run the frontend and backend components.
Make sure to set up the following environment variables:
Frontend:
API_URL: The URL of the backend API (default: "http://localhost:8000/api")Backend:
.env file)This project includes user authentication. Ensure that you're using HTTPS in production and following best practices for handling user data and authentication tokens.