This project was developed for the "Programming Challenge" step of the full-stack developer application process at Delta Global Services and Technology Co. It's a CRUD system for managing student information.
Meeting the specified technical requirements, the system was developed:
- Using React library for the front-end 1, CodeIgniter 4 framework for the back-end, and MySQL database management system.
- Implementing a RESTful architecture for communication between the front-end and back-end.
- Implementing a user authentication system using username and password to access the system.
Due to not having a well-configured local development environment, I opted to use GitHub Codespaces as the development environment.
The project is structured as follows:
./
├─ app/
│ ├─ mysql-db/
│ │ ├─ Dockerfile
│ │ ├─ .env
│ │ └─ ...
│ ├─ php-backend/
│ │ ├─ .env
│ │ └─ ...
│ ├─ react-frontend/
│ │ ├─ (.env.local)
│ │ └─ ...
│ └─ docker-compose.yml
├─ .gitignore
├─ README.en-US.md
└─ README.pt-BR.md
The app/
directory consists of the following subdirectories:
mysql-db/
, responsible for the database service.php-backend/
, responsible for the back-end service.react-frontend/
, responsible for the front-end service.
mysql-db/
├─ .env
├─ Dockerfile
├─ init.sql
└─ my.cnf
php-backend/
├─ public/
├─ app/
│ ├─ Config/
│ │ ├─ ...
│ │ ├─ Database.php
│ │ ├─ Filters.php
│ │ └─ Routes.php
│ ├─ Controller/
│ │ ├─ Home.php
│ │ ├─ Students.php
│ │ ├─ StudentsPortraits.php
│ │ └─ Users.php
│ ├─ Filters/
│ │ └─ Cors.php
│ ├─ Models/
│ │ ├─ StudentsModel.php
│ │ ├─ StudentsPortraitsModel.php
│ │ └─ UsersModel.php
│ └─ ...
├─ .env
├─ builds
├─ composer.json
├─ composer.lock
└─ ...
react-frontend/
├─ public/
├─ src/
│ ├─ api/
│ ├─ auth/
│ ├─ components/
│ ├─ routes/
│ │ ├─ pages/
│ │ │ ├─ Home.tsx
│ │ │ ├─ SignIn.tsx
│ │ │ ├─ SignUp.tsx
│ │ │ └─ Start.tsx
│ │ └─ Root.tsx
│ ├─ theme/
│ ├─ App.tsx
│ └─ index.tsx
├─ .env.local
├─ builds
├─ package-lock.json
├─ package.json
├─ tsconfig.json
└─ ...
I advise using the same configurations used for development:
- Node.js 20.8.1
- npm 10.1.0
- PHP 7.4
- Composer 2.6.5
- Modules:
- MySQL: pdo, pdo_mysql, mysqli, mysqlnd
- XML: xml, xmlreader, xmlwriter, simplexml, xsl
- Image Manipulation: gd
- Other CI4 required files: intl, json, mbstring, curl
If you plan using different versions for the above items, ensure that they are compatible.
- Download the repository to your local environment.
- Configure back-end dependencies by accessing the
php-backend/
directory and running thecomposer install
command. - Configure front-end dependencies by accessing the
react-frontend/
directory and running thenpm install
command.2
Run each service layer separately, following this order:
- Database service: access the
app/
directory and run thedocker-compose up --build
command. The service will be available on port3306
. - Back-end: access the
php-backend/
directory and run thephp spark serve
command. The service will be available on port8080
.34 - Front-end: access the
react-frontend/
directory and run thenpm start
command. The service will be available on port3000
.
Some improvements that could be implemented:
- Better user interface;
- Improved exception handling;
- Enhanced input validation;
- Authentication session caching.
Footnotes
-
For front-end development, besides the React library, I opted to use "Create React App", React Router, TypeScript, and the MUI (Material UI) component library. ↩
-
If opting to use GitHub Codespaces, add a
.env.local
file in thereact-frontend/
directory, adding your codespace domain to theREACT_APP_BASE_URL
environment variable. ↩ -
Make necessary changes if using an Apache or NGINX server. ↩
-
If using GitHub Codespaces, due to platform limitations, it will be necessary to change the visibility of the back-end server. ↩