# Basic setup on project

Create eventrix store

{% code title="/eventrix/index.js" %}
```jsx
import { Eventrix } from 'eventrix';
import receiversList from './receivers';

const initialState = {
    users: [],
};

const eventrixStore = new Eventrix(initialState, receiversList);

export default eventrixStore;
```
{% endcode %}

Create receivers to fetch data.

{% code title="/eventrix/receivers.js" %}
```jsx
import axios from 'axios';
import { EventsReceiver } from 'eventrix';

const fetchUsersReceiver = new EventsReceiver('fetchUsers', (eventName, eventData, stateManager) => {
    return axios.get('https://myDomain.com/users').then(({ data: usersList }) => {
        stateManager.setState('users', usersList);
    });
});

const receiversList = [fetchUsersReceiver];

export default receiversList;
```
{% endcode %}

Use **EventrixProvider** in main component of your app.

{% code title="/App.jsx" %}
```jsx
import { StrictMode } from "react";
import ReactDOM from "react-dom";
import { EventrixProvider } from 'eventrix';
import eventrixStore from './eventrix';
import UsersList from './components/UsersList';

const rootElement = document.getElementById("root");
ReactDOM.render(
    <StrictMode>
      <EventrixProvider eventrix={eventrixStore}>
        <UsersList />
      </EventrixProvider>
    </StrictMode>,
    rootElement
);
```
{% endcode %}

After that you can use hooks and hocs in your react app.
