- Notifications
You must be signed in to change notification settings - Fork0
perd007/admin-project
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Build web applications using React.js for the front end and python/flask for your backend API.
- Documentation can be found here:https://start.4geeksacademy.com/starters/react-flask
- Here is a video onhow to use this template
- Integrated with Pipenv for package managing.
- Fast deployment to herokuin just a few steps here.
- Use of .env file.
- SQLAlchemy integration for database abstraction.
If you use Github Codespaces (recommended) or Gitpod this template will already come with Python, Node and the Posgres Database installed. If you are working locally make sure to install Python 3.10, Node
It is recomended to install the backend first, make sure you have Python 3.8, Pipenv and a database engine (Posgress recomended)
- Install the python packages:
$ pipenv install
- Create a .env file based on the .env.example:
$ cp .env.example .env
- Install your database engine and create your database, depending on your database you have to create a DATABASE_URL variable with one of the possible values, make sure you replace the valudes with your database information:
Engine | DATABASE_URL |
---|---|
SQLite | sqlite:////test.db |
MySQL | mysql://username:password@localhost:port/example |
Postgress | postgres://username:password@localhost:5432/example |
- Migrate the migrations:
$ pipenv run migrate
(skip if you have not made changes to the models on the./src/api/models.py
) - Run the migrations:
$ pipenv run upgrade
- Run the application:
$ pipenv run start
Note: Codespaces users can connect to psql by typing:
psql -h localhost -U gitpod example
You are also able to undo a migration by running
$ pipenv run downgrade
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!
Every Github codespace environment will haveits own database, so if you're working with more people eveyone will have a different database and different records inside it. This datawill be lost, so don't spend too much time manually creating records for testing, instead, you can automate adding records to your database by editingcommands.py
file inside/src/api
folder. Edit line 32 functioninsert_test_data
to insert the data according to your model (use the functioninsert_test_users
above as an example). Then, all you need to do is runpipenv run insert-test-data
.
- Make sure you are using node version 14+ and that you have already successfully installed and runned the backend.
- Install the packages:
$ npm install
- Start coding! start the webpack dev server
$ npm run start
This boilerplate it's 100% read to deploy with Render.com and Heroku in a matter of minutes. Please read theofficial documentation about it.
This template was built as part of the 4Geeks AcademyCoding Bootcamp byAlejandro Sanchez and many other contributors. Find out more about ourFull Stack Developer Course, andData Science Bootcamp.
You can find other templates and resources like this at theschool github page.
About
Resources
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Releases
Packages0
Languages
- JavaScript73.4%
- Python22.1%
- CSS2.3%
- HTML1.3%
- Dockerfile0.3%
- Mako0.3%
- Other0.3%