Code Monkey home page Code Monkey logo

habits-server's Introduction

Habits

This project is a web application built with Rust using the Actix framework. It leverages various libraries for web development, authentication, and database interaction.

Table of Contents

Prerequisites

Ensure you have the following installed on your system:

  • Rust (stable version)
  • Cargo (Rust's package manager)
  • Git (for cloning the repository)

Installation

  1. Navigate to the Project Directory

    Change your current directory to the project directory:

    cd server

  2. Install Dependencies

    Run the following command to install the project dependencies:

    cargo build

    This command will download and compile all the dependencies listed in Cargo.toml.

    Running the Application

    To run the application, use the following command:

    cargo run

    This command will compile and run your application. By default, the application will start on http://localhost:8080.

Development Mode

To run the application in development mode, use the following command:

cargo watch -x run

Sutup Database

  1. Login to supabase npx supabase login

  2. Link the project npx supabase link --project-ref $PROJECT_ID

  3. Run docker desktop app

  4. Start the database npx supabase start

Push changes to database

  1. Create new migration npx supabase migration new $MIGRATION_NAME

  2. Put your changes into created migration file in supabase/migrations folder

  3. Apply the new migration to your local database npx supabase db up Or reset db and apply new migration npx supabase db reset

  4. Push changes to the remote database npx supabase db push

  5. Update diesel schemas diesel print-schema > src/schema.rs

  6. Update autogenerated models diesel_ext --model > src/models.rs -s src/schema.rs

  • Note: If you have an issue with utf-8 characters, you can try this command in powershell: $PSDefaultParameterValues['Out-File:Encoding'] = 'utf8'

Pull changes from database

npx supabase db pull

habits-server's People

Contributors

nborzunov avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.