You can update the styles/index.scss
or create new .scss
files inside styles/
and import them into your current scss or js files depending on your needs.
Add more files into your ./src/js/components
or styles folder as you need them and import them into your current files as needed.
đź’ˇNote: There is an example using the Context API inside views/demo.js
;
Add more files into your ./src/js/views
and import them in ./src/js/layout.jsx
.
This boilerplate comes with a centralized general Context API. The file ./src/js/store/flux.js
has a base structure for the store, we encourage you to change it and adapt it to your needs.
React Context docs BreathCode Lesson view
The Provider
is already set. You can consume from any component using the useContext hook to get the store
and actions
from the Context. Check /views/demo.js
to see a demo.
import { Context } from "../store/appContext";
const MyComponentSuper = () => {
//here you use useContext to get store and actions
const { store, actions } = useContext(Context);
return <div>{/* you can use your actions or store inside the html */}</div>;
};
It is recomended to install the backend first, make sure you have Python 3.8, Pipenv and a database engine (Posgress recomended)
$ pipenv install
$ cp .env.example .env
Engine | DATABASE_URL |
---|---|
SQLite | sqlite:////test.db |
MySQL | mysql://username:password@localhost:port/example |
Postgress | postgres://username:password@localhost:5432/example |
$ pipenv run migrate
(skip if you have not made changes to the models on the ./src/api/models.py
)$ pipenv run upgrade
$ pipenv run start
To insert test users in the database execute the following command:
$ flask insert-test-users 5
And you will see the following message:
Creating test users
test_user1@test.com created.
test_user2@test.com created.
test_user3@test.com created.
test_user4@test.com created.
test_user5@test.com created.
Users created successfully!
To update with all yours tables you can edit the file app.py and go to the line 80 to insert the code to populate others tables
$ npm install
$ npm run start
This boilerplate it's 100% integrated with Herkou, just by pushing your changes to the heroku repository it will deploy: $ git push heroku main
// "prettier-webpack-plugin": "^1.2.0",
"dotenv-webpack": "^1.7.0", "friendly-errors-webpack-plugin": "^1.7.0",