Skip to content

kurraharshitha/Fullstack-Intern-Task-CodeIgniter-4-React-Vite-

Repository files navigation

Full-Stack Intern Task – CodeIgniter 4 + React (JWT)

This repo contains:

  • backend-ci4/ – CodeIgniter 4 API with JWT auth (register, login, teachers list)
  • frontend-react-vite/ – React app (Register, Login, Teachers datatable)
  • db/intern_task_mysql_dump.sql – MySQL schema dump

Backend (CodeIgniter 4)

Requirements: PHP >= 8.0, Composer, MySQL (or MariaDB)

cd backend-ci4
cp .env.example .env
# edit .env with your DB credentials and JWT secret
composer install
# Create database using the SQL dump first:
mysql -u root -p < ../db/intern_task_mysql_dump.sql
# Start API
php spark serve

Endpoints:

  • POST /api/register – creates auth_user and teachers in one request, returns JWT
    {
      "email": "a@b.com",
      "password": "Pass@123",
      "first_name": "Ada",
      "last_name": "Lovelace",
      "university_name": "Babbage Univ",
      "gender": "Female",
      "year_joined": 2020
    }
  • POST /api/login – returns JWT
  • GET /api/teachers – protected, Authorization: Bearer <token>

Frontend (React + Vite)

Requirements: Node 18+

cd frontend-react-vite
cp .env.example .env
npm install
npm run dev

Notes

  • Passwords are hashed with password_hash (bcrypt).
  • JWT via firebase/php-jwt.
  • One-to-one relation is enforced by teachers.user_id UNIQUE + FK.
  • Change VITE_API_BASE to point to your backend base URL.

About

A fullstack application with CodeIgniter 4 backend, MySQL database, and React (Vite) frontend. Includes token-based authentication, user/teacher data management, and a modern styled UI.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors