A modern full-stack application demonstrating React 19, Redux Toolkit, TypeScript, Vite, and Express with MongoDB.
- React 19 with functional components and hooks
- Redux Toolkit for state management
- React Router 7 for routing
- TypeScript for type safety
- Vite 6 for fast development and building
- Vitest + React Testing Library for testing
- SCSS for styling
- Express 5 with TypeScript
- Mongoose 8 for MongoDB ODM
- JWT for authentication
- Environment-based configuration
- GitHub Actions for CI/CD
- Docker Compose for local development
- ESLint 9 for code quality
- Node.js 20+ (use
nvm useif you have nvm installed) - MongoDB 7+ (or use Docker)
- npm 10+
# Start all services (MongoDB, API, Client)
docker-compose up
# Access the app at http://localhost:8080# If you have MongoDB installed locally
mongod
# Or run just MongoDB via Docker
docker run -d -p 27017:27017 --name mongodb mongo:7cd api
cp .env.example .env # Configure environment variables
npm install
npm run devcd client
npm install
npm run devOpen http://localhost:8080 in your browser.
Username: example
Password: password
βββ .github/
β βββ workflows/
β βββ ci.yml # GitHub Actions CI workflow
βββ api/
β βββ src/
β β βββ config/ # Environment configuration
β β βββ middleware/ # Express middleware (auth)
β β βββ models/ # Mongoose models
β β βββ routes/ # API routes
β β βββ server.ts # Express app entry
β βββ Dockerfile
β βββ package.json
β βββ tsconfig.json
βββ client/
β βββ src/
β β βββ components/ # React components
β β βββ features/ # Feature slices (Redux Toolkit)
β β βββ store/ # Redux store configuration
β β βββ test/ # Test utilities and tests
β β βββ App.tsx # Main app component
β β βββ main.tsx # Entry point
β βββ Dockerfile
β βββ package.json
β βββ tsconfig.json
β βββ vite.config.ts
βββ docker-compose.yml
βββ README.md
# Client tests
cd client && npm test
# API tests
cd api && npm test
# Watch mode
npm run test:watch| Method | Endpoint | Auth | Description |
|---|---|---|---|
| POST | /authenticate |
No | Login, returns JWT |
| GET | /users |
JWT | List all users |
| GET | /customer |
JWT | List all customers |
| GET | /customer/:id |
JWT | Get customer by ID |
| POST | /customer |
JWT | Create customer |
| PUT | /customer/:id |
JWT | Update customer |
| DELETE | /customer/:id |
JWT | Delete customer |
| GET | /health |
No | Health check |
| Script | Description |
|---|---|
npm run dev |
Start development server |
npm run build |
Build for production |
npm run preview |
Preview production build |
npm test |
Run tests |
npm run lint |
Lint code |
npm run type-check |
TypeScript type checking |
| Script | Description |
|---|---|
npm run dev |
Start development server (hot reload) |
npm run build |
Build TypeScript to JavaScript |
npm start |
Start production server |
npm test |
Run tests |
npm run lint |
Lint code |
npm run type-check |
TypeScript type checking |
NODE_ENV=development
PORT=3000
MONGODB_URI=mongodb://localhost:27017/react_redux_example_db
JWT_SECRET=your-secret-key
JWT_EXPIRES_IN=24h
CORS_ORIGINS=http://localhost:8080- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
Migrated from legacy stack (React 15, Webpack 2, Node 6) to modern tooling in 2024.