DEV Community

Cover image for React Berry Fullstack - Available for download in three versions
Sm0ke
Sm0ke

Posted on • Updated on • Originally published at blog.appseed.us

React Berry Fullstack - Available for download in three versions

Hello Coders!

This article presents full-stack versions of React Berry Dashboard, a modern and quite popular dashboard template styled with M-UI (legacy Material-UI) components library. The React template was enhanced with a simple JWT Token Authentication powered by different API servers (all free): Node JS, Flask, and Django.

Thanks for reading! - Content provided by App Generator.



Another important part is the Unified API Interface shared by all API servers and implemented by the Berry Dashboard. In other words, the transition from a Django backend API to a Node JS API is possible without code changes in the React Frontend. For more information about this concept feel free to read the documentation or contact the support team on Discord.


React Berry Dashboard - Login Page.


How to use the code

All full-stack versions of Berry can be compiled and started in a local environment using an identical workflow:

  • Download the API backend: Node JS, Flask or Django
  • Compile and start the API server
  • Download and compile Berry React frontend
  • Create users, sign in and access the private pages.

Let's build in the following section the full-stack version of React Berry using, for instance, a Django API server. The build instructions are provided by the product documentation and the README file saved on Github.


Build the Backend API Server

The API server that manages the JWT Tokens comes with a simple intuitive codebase and a few nice features: DRF library, JWT Authentication, SQLite persistence, and Docker for deployment.


Django API Server - Open-source Product.


Step #1 - Clone the sources (published on Github)

$ git clone https://github.com/app-generator/api-server-django.git
$ cd api-server-django 
Enter fullscreen mode Exit fullscreen mode

Step #2 - Create a virtual environment

$ # Virtualenv modules installation (Unix based systems)
$ virtualenv env
$ source env/bin/activate
$
$ # Virtualenv modules installation (Windows based systems)
$ # virtualenv env
$ # .\env\Scripts\activate
Enter fullscreen mode Exit fullscreen mode

Step #3 - Install dependencies using PIP

$ pip install -r requirements.txt
Enter fullscreen mode Exit fullscreen mode

Step #4 - Start the API server

$ python manage.py migrate
$ python manage.py runserver 5000 
Enter fullscreen mode Exit fullscreen mode

At this point, the Django API should be up & running and we can use POSTMAN to test the service and create users or move forward and build React Berry Frontend.


Compile and start the React UI

React Berry Dashboard is also published on Github and we can compile and start the UI by typing a few commands in the terminal window as specified in product README.

Step #1 - Clone React Berry from Github

$ git clone https://github.com/app-generator/react-berry-dashboard.git
$ cd react-berry-dashboard 
Enter fullscreen mode Exit fullscreen mode

Step #2 - Install dependencies via NPM or yarn

$ npm i
// OR
$ yarn
Enter fullscreen mode Exit fullscreen mode

Step #3 - Start in development mode

$ npm run start 
// OR
$ yarn start
Enter fullscreen mode Exit fullscreen mode

Once the product starts (this might take a while) we should be able to communicate with the API server to create users and authenticate. In case anyone needs to update the backend server address, this can be done in src/config/constant.js:

const config = {     ...
    API_SERVER: 'http://localhost:5000/api/' 
};
Enter fullscreen mode Exit fullscreen mode

React Berry Dashboard - Icons Page


In the same way, we can use Flask or Node JS (soon Laravel) as a backend API server for this amazing material-based design.


Thanks for Reading! For more resources, please access:

Top comments (2)

Collapse
 
rakesh_nakrani profile image
Rakesh S Nakrani

Thanks for this awesome post.

Collapse
 
sm0ke profile image
Sm0ke

🚀🚀