This is a full-stack web application using Django (backend) and React (frontend). The backend provides a REST API, and the frontend consumes it to offer a user-friendly interface.
pip install django
pip install djangorestframework
pip install django-cors-headers
pip install djangorestframework-simplejwt
pip install django-environ
#install according to the DB you are using
pip install psycopg2-binary # PostgreSQL
pip install mysqlclient # MySQL/MariaDB
pip install oracledb # Oracle
First setup an external database and a user that can change it - process depends on the DB. Depending on the DB that you want to use change .env file next to manage.py to include DATABASE_URL for your desired DB. Examples:
DATABASE_URL=postgres://USER:PASS@localhost:5432/your_db
DATABASE_URL=mysql://USER:PASS@localhost:3306/your_db
DATABASE_URL=oracle://USER:PASS@localhost:1521/your_dbIf no DATABASE_URL is provided in .env file default behaviour is to use SQLite DB.
-
Dump data from current DB
python manage.py dumpdata \ --natural-foreign --natural-primary \ --exclude contenttypes --exclude auth.permission \ --indent 2 > data.json -
Update your
.envDATABASE_URLto point at the new DBDATABASE_URL=postgres://your_user:your_pass@localhost:5432/your_db -
Apply the schema
python manage.py migrate
-
Load your data dump
python manage.py loaddata data.json
python manage.py migrate
python manage.py runservernpm install
npm install react-bootstrap bootstrapnpm start-
models.py
Defines the data models used in the application. -
serializers.py
Converts Django models to JSON format and vice versa for REST API interaction. -
views.py
Contains CRUD logic and endpoints for API routes. Also all the backend checks that needed for input getting done in here.TO DO: Right now checked things are below. PLS ADD ANY ELSE IF YOU FIND
- For task --> Users must be users of WP, can connected with only 1 WP, start/end week must not exceed that of WP
-
urls.py
Connects view logic to specific URL endpoints.
-
Navigator.js
Main navigation bar or sidebar for switching between pages. -
User.js / WorkPackage.js / Task.js
Pages for listing and interacting with each model's data. -
AddUserModal.js / EditUserModal.js (for each page similar 2 files)
Modal components for adding and editing model entries (similar files exist for other models like WorkPackage and Task).
- PLS check for urls in backend part before adding smth related with it
- CORS must be properly configured in Django for frontend-backend communication.
- Customize this README as your project grows.