You're working on an existing code base that a bunch of other developers are working in. This is a pretty hard challenge.
- Fork over repo to personal github
cd
into thecp_backend
directory (same level asrequirements.txt
)- Install all Python packages (
pip install -r requirements.txt
) - Create a new database called
cp_alumni
- In the
seeds.sql
file, update the every instance ofALTER TABLE public.api_cohort OWNER TO taprete;
and replacetaprete
with your Mac's name. - Seed the database
psql cp_alumni < seeds.sql
(this will create all the tables and seed the database with data) - Start the server
python manage.py runserver
- Admin User Credentials: is
[email protected]
passwordCodePlatoon1@
- All users have the password of
CodePlatoon1@
cd
into thecp-frontend
directory (same level aspackage.json
)- Install all Node dependencies (
npm install
) - Start the React application
npm start
Django comes with a built in Admin Dashboard but most applications need their own Admin Dashboard. Your job is to create an Admin Dashboard that only users who have the is_staff
value set to True
have access to. The Admin Dashboard should display all the users in the application in a Table. From the list of users you should be able to change the user's is_staff
attribute, is_active
attribute, and is_verified
attribute boolean values and update the users in the database.
The table should show the following information about each user
- First Name
- Last Name
- Staff status (attribute that can be changed)
- Active status (attribute that can be changed)
- Verified status (attribute that can be changed)
Please utilize Material-UI library for the front-end. It's already installed as a dependency.
Read through the code base and try to understand where the data is flowing from the Djagno backend to the React frontend.
Reminder: Coding is 80% reading, 20% coding.
Create an AdminPage.js
component and Route to /admin
on the front end. When you land on this page (/admin
) it should make an api request to the Django Backend to retreive all the users. Look in the UserAPI.js
to see if that API method was already created for you. Before you move on ensure you're able to successfully serve all the users to the frontend.
Please utilize Material-UI Table component to display all the users in the application with a checkbox or switch to toggle a user's Staff status, Verified status, and Active status.