Welcome to your new neural_sense project and to the internet computer development community. By default, creating a new project adds this README and some template files to your project directory. You can edit these template files to customize your project and to include your own code to speed up the development cycle.
To get started, you might want to explore the project directory structure and the default configuration file. Working with this project in your development environment will not affect any production deployment or identity tokens.
Neural sense is a build app that handles information related to neuroprosthetics -- such as user profiles, device configuration, device settings and Research data.
The User Profile is connected to Device Configuration and then connected to Research Data which is then connected to Device setting
Represents a user's profile with associated devices.
Describes the configuration details for various neuroprosthetic devices.
Contains settings specific to neuroprosthetic devices.
Stores information related to research conducted in the field of neuroprosthetics.
-
add_user_profile(payload: UserProfilePayload) -> Result<UserProfile, Error>
:- Description: Adds a new user profile.
- Parameters:
payload
: UserProfilePayload - Details of the user profile to be added.
- Returns: Result<UserProfile, Error> - Returns the added user profile or an error.
-
update_user_profile(user_id: u64, payload: UserProfilePayload) -> Result<UserProfile, Error>
:- Description: Updates an existing user profile.
- Parameters:
user_id
: u64 - ID of the user profile to be updated.payload
: UserProfilePayload - Updated details of the user profile.
- Returns: Result<UserProfile, Error> - Returns the updated user profile or an error.
-
get_user_profile(user_id: u64) -> Result<UserProfile, Error>
:- Description: Retrieves a user profile by ID.
- Parameters:
user_id
: u64 - ID of the user profile to be retrieved.
- Returns: Result<UserProfile, Error> - Returns the requested user profile or an error.
-
delete_user_profile(user_id: u64) -> Result<(), Error>
:- Description: Deletes a user profile by ID.
- Parameters:
user_id
: u64 - ID of the user profile to be deleted.
- Returns: Result<(), Error> - Returns success or an error.
-
get_all_user_profiles() -> Vec<UserProfile>
:- Description: Retrieves all user profiles.
- Returns: Vec - Returns a vector containing all user profiles.
-
add_device_configuration(payload: DeviceConfigurationPayload) -> Result<DeviceConfiguration, Error>
:- Description: Adds a new device configuration.
- Parameters:
payload
: DeviceConfigurationPayload - Details of the device configuration to be added.
- Returns: Result<DeviceConfiguration, Error> - Returns the added device configuration or an error.
-
update_device_configuration(device_id: u64, payload: DeviceConfigurationPayload) -> Result<DeviceConfiguration, Error>
:- Description: Updates an existing device configuration.
- Parameters:
device_id
: u64 - ID of the device configuration to be updated.payload
: DeviceConfigurationPayload - Updated details of the device configuration.
- Returns: Result<DeviceConfiguration, Error> - Returns the updated device configuration or an error.
-
get_device_configuration(device_id: u64) -> Result<DeviceConfiguration, Error>
:- Description: Retrieves a device configuration by ID.
- Parameters:
device_id
: u64 - ID of the device configuration to be retrieved.
- Returns: Result<DeviceConfiguration, Error> - Returns the requested device configuration or an error.
-
delete_device_configuration(device_id: u64) -> Result<(), Error>
:- Description: Deletes a device configuration by ID.
- Parameters:
device_id
: u64 - ID of the device configuration to be deleted.
- Returns: Result<(), Error> - Returns success or an error.
-
get_all_device_configurations() -> Vec<DeviceConfiguration>
:- Description: Retrieves all device configurations.
- Returns: Vec - Returns a vector containing all device configurations.
-
add_research_data(payload: ResearchDataPayload) -> Result<ResearchData, Error>
:- Description: Adds new research data.
- Parameters:
payload
: ResearchDataPayload - Details of the research data to be added. -Returns: Result<ResearchData, Error> - Returns the added research data or an error.
- Parameters:
- Description: Adds new research data.
-
update_research_data(research_id: u64, payload: ResearchDataPayload) -> Result<ResearchData, Error>
:- Description: Updates existing research data.
- Parameters:
research_id
: u64 - ID of the research data to be updated.payload
: ResearchDataPayload - Updated details of the research data. -Returns: Result<ResearchData, Error> - Returns the updated research data or an error.
- Parameters:
- Description: Updates existing research data.
-
get_research_data(research_id: u64) -> Result<ResearchData, Error>
:- Description: Retrieves research data by ID.
- Parameters:
research_id
: u64 - ID of the research data to be retrieved. -Returns: Result<ResearchData, Error> - Returns the requested research data or an error.
- Parameters:
- Description: Retrieves research data by ID.
-
delete_research_data(research_id: u64) -> Result<(), Error>
:- Description: Deletes research data by ID.
- Parameters:
research_id
: u64 - ID of the research data to be deleted. -Returns: Result<(), Error> - Returns success or an error.
- Parameters:
- Description: Deletes research data by ID.
- get_all_research_data() -> Vec<ResearchData>
:
- Description: Retrieves all research data. -Returns: Vec - Returns a vector containing all research data.-
-
add_device_settings(payload: DeviceSettingsPayload) -> Result<DeviceSettings, Error>:
- Description: Adds new device settings.
- Parameters:
payload
: DeviceSettingsPayload - Details of the device settings to be added.
- Returns: Result<DeviceSettings, Error> - Returns the added device settings or an error.
-
update_device_settings(device_settings_id: u64, payload: DeviceSettingsPayload) -> Result<DeviceSettings, Error>:
- Description: Updates existing device settings.
- Parameters:
device_settings_id
: u64 - ID of the device settings to be updated.payload
: DeviceSettingsPayload - Updated details of the device settings.
- Returns: Result<DeviceSettings, Error> - Returns the updated device settings or an error.
-
get_device_settings(device_settings_id: u64) -> Result<DeviceSettings, Error>:
- Description: Retrieves device settings by ID.
- Parameters:
device_settings_id
: u64 - ID of the device settings to be retrieved.
- Returns: Result<DeviceSettings, Error> - Returns the requested device settings or an error.
-
delete_device_settings(device_settings_id: u64) -> Result<(), Error>:
- Description: Deletes device settings by ID.
- Parameters:
device_settings_id
: u64 - ID of the device settings to be deleted.
- Returns: Result<(), Error> - Returns success or an error.
-
get_all_device_settings() -> Vec<DeviceSettings>:
- Description: Retrieves all device settings.
- Returns: Vec - Returns a vector containing all device settings.
Represents the data structure for adding/updating user profiles.
Describes the data structure for adding/updating device configurations.
Specifies the payload structure for adding/updating research data.
Represents the payload structure for adding/updating device settings. To learn more before you start working with neural_sense, see the following documentation available online:
- Quick Start
- SDK Developer Tools
- Rust Canister Development Guide
- ic-cdk
- ic-cdk-macros
- Candid Introduction
If you want to start working on your project right away, you might want to try the following commands:
cd neural_sense/
dfx help
dfx canister --help
If you want to test your project locally, you can use the following commands:
# Starts the replica, running in the background
dfx start --background
# Deploys your canisters to the replica and generates your candid interface
dfx deploy
Once the job completes, your application will be available at http:https://localhost:4943?canisterId={asset_canister_id}
.
If you have made changes to your backend canister, you can generate a new candid interface with
npm run generate
at any time. This is recommended before starting the frontend development server, and will be run automatically any time you run dfx deploy
.
If you are making frontend changes, you can start a development server with
npm start
Which will start a server at http:https://localhost:8080
, proxying API requests to the replica at port 4943.
If you are hosting frontend code somewhere without using DFX, you may need to make one of the following adjustments to ensure your project does not fetch the root key in production:
- set
DFX_NETWORK
toic
if you are using Webpack - use your own preferred method to replace
process.env.DFX_NETWORK
in the autogenerated declarations- Setting
canisters -> {asset_canister_id} -> declarations -> env_override to a string
indfx.json
will replaceprocess.env.DFX_NETWORK
with the string in the autogenerated declarations
- Setting
- Write your own
createActor
constructor