-
Directories:
- mockupbackend: This is the directory for the mock backend setup. It's a Node.js project.
- null_para: This is the the primary project directory. Given the structure, it's a React-based project, created with Create React App (CRA).
-
File Structure:
- Within mockupbackend, there's an
index.js
pointing the starting point for the backend, and package-related files (package-lock.json
andpackage.json
), showing its dependencies and configurations. - Inside null_para, there's a clear separation between public assets (
public
directory) and source code (src
directory). Withinsrc
, there are separate directories forbackend
,components
,interfaces
,pages
, andutils
, a organized frontend structure.
- Within mockupbackend, there's an
- React: The primary library for building the user interface. Evident from the
react
andreact-dom
dependencies. - TypeScript: The project uses TypeScript for static typing, evident from the
.tsx
file extensions and thetypescript
dependency. - MUI (formerly Material-UI): A popular React UI framework. The project uses both MUI's core components (
@mui/material
) and icons (@mui/icons-material
). - Emotion: A library for writing CSS styles with JavaScript. This is evident from the dependencies
@emotion/react
and@emotion/styled
. - React Router: Used for routing in the React application, evident from the
react-router-dom
dependency. - Testing Libraries: The project is set up for testing with libraries such as
@testing-library/react
,@testing-library/jest-dom
, and others. - ESLint and Prettier: Tools for maintaining code quality and formatting. Evident from the
eslintConfig
inpackage.json
and the.prettier
file. - web-vitals: A library for measuring web performance.
- cross-env: A utility for setting and using environment variables across platforms. Used in the build script for setting the
BASE_URL
.
In summary, the infrastructure consists of a mock backend built with Node.js and a frontend built with React and TypeScript, incorporating MUI for UI components. The frontend is structured, separating concerns like components, pages, and utility functions, and is set up for testing and maintaining code quality.
This project was bootstrapped with Create React App.
In the project directory, you can run:
Runs the app in the development mode.\
Open http://localhost:3000 to view it in the browser.
The page will reload if you make edits.\
You will also see any lint errors in the console.
Builds the app for production to the build
folder.\
It correctly bundles React in production mode and optimizes the build for the best performance.
The build is minified and the filenames include the hashes.\
Your app is ready to be deployed!
See the section about deployment for more information.
-
Home Route:
- URL:
/
- Component:
HomeChildrenPage
- Name: "Home"
- Description: This is the default landing page for children when they access the application. The component associated with it provides the main interface or dashboard for children.
- URL:
-
Saving Route:
- URL:
/saving
- Component:
SavingChildrenPage
- Name: "Saving"
- Description: This page is dedicated to the savings-related features and tools for children, allowing them to view or manage their savings goals.
- URL:
-
Learn Route:
- URL:
/learn
- Component:
LearnPage
- Name: "Learn"
- Description: A page dedicated to educational content, perhaps offering financial literacy resources, tutorials, or lessons for children.
- URL:
-
Banking Route:
- URL:
/banking
- Component:
BankingPage
- Name: "Banking"
- Description: This page might provide banking-related features such as viewing account balances, transaction histories, or initiating transfers.
- URL:
-
Settings Route:
- URL:
/settings
- Component:
SettingsPage
- Name: "Settings"
- Description: A page where children can modify their application preferences, account details, or other configurable aspects of their user experience.
- URL:
-
Home Route for Parents:
- URL:
/eltern
- Component:
HomeParentsPage
- Name: "Home"
- Description: The main dashboard or interface for parents when they log into the application.
- URL:
-
Learn Route (similar to children):
- URL:
/learn
- Component:
LearnPage
- Name: "Learn"
- URL:
-
Banking Route (similar to children):
- URL:
/banking
- Component:
BankingPage
- Name: "Banking"
- URL:
-
Switch Child Route:
- URL:
/kindwechseln
- Component:
SettingsPage
- Name: "Kind wechseln" (Translation: "Switch Child")
- Description: This is a special settings page for parents, allowing them to switch between the accounts or profiles of multiple children.
- URL:
-
Settings Route (similar to children):
- URL:
/settings
- Component:
SettingsPage
- Name: "Settings"
- URL:
In summary, these frontend routes determine the navigation structure of the application, with separate navigational flows for children and parents. The children's flow emphasizes features like savings and learning, while the parents' flow provides management tools like switching between children's profiles.
This section provides a guide on how to set up and run the Express.js Node server for this project.
- Node.js and npm (Node Package Manager) installed on your machine.
-
Navigate to the project directory:
bashCopy code
cd path/to/your/project-directory
-
Install required dependencies:
bashCopy code
npm install
- (ToDo not implemented) User authentication with Passport.js and session-based authentication.
- (ToDo not implemented) Hashed password storage using bcryptjs.
- Basic CORS support.
- CRUD (Create, Read, Update, Delete) operations for different entities such as users, tasks, transactions, and savings goals.
1. Users:
POST /login
: To log in a user.POST /logout
: To log out a user.GET /users
: Fetch all users.POST /users
: Create a new user.PUT /users/:id
: Update a user's information based on user ID.DELETE /users/:id
: Delete a user based on user ID.
2. Tasks:
GET /tasks
: Fetch all tasks.POST /tasks
: Create a new task.PUT /tasks/:id
: Update a task's information based on task ID.DELETE /tasks/:id
: Delete a task based on task ID and perform related actions like updating the balance and adding a transaction.
3. Transactions:
GET /transactions
: Fetch all transactions.POST /transactions
: Create a new transaction.PUT /transactions/:id
: Update a transaction's information based on transaction ID.DELETE /transactions/:id
: Delete a transaction based on transaction ID.
4. Savings Goals:
GET /savingsGoals
: Fetch all savings goals.POST /savingsGoals
: Create a new savings goal.PUT /savingsGoals/:id
: Update a savings goal's information based on the goal's ID.DELETE /savingsGoals/:id
: Delete a savings goal based on its ID.
- Use the command
node <your_server_file_name>.js
to start the server. - The server will be running at
http://localhost:3002
.
- Regularly backup the dummy database (or any data storage) to prevent data loss.
- Implement data validation before handling requests to ensure data integrity.
That's it! Your Express.js Node server is up and running. Adjust and expand upon this guide as your application grows and features are added. Happy coding!