A secure 3-tier architecture implementation of the AWS practice test application with React frontend, Node.js/Express backend, and PostgreSQL database.
- Client Tier: React frontend application
- Server Tier: Node.js/Express REST API with JWT authentication
- Database Tier: PostgreSQL with migrated test data
- User authentication (registration/login)
- All existing practice modes: Random Practice, Mock Test, Practice Mode
- New Study Mode with progress tracking
- Mock Test result history
- Secure API with SQL injection and XSS prevention
- Cross-device progress continuity
- Docker and Docker Compose
- Node.js 16+ (for local development)
-
Clone the repository and navigate to the project directory
-
Copy environment variables:
cp .env.example .env
-
Start all services with Docker Compose:
docker-compose up --build
-
Access the application:
- Frontend: http://localhost:3000
- Backend API: http://localhost:5000
- Database: localhost:5432
-
Set up PostgreSQL database:
createdb aws_practice
-
Install server dependencies:
cd server npm install npm run migrate npm run dev -
Install client dependencies:
cd client npm install npm start
├── client/ # React frontend
├── server/ # Node.js/Express backend
├── docker-compose.yml # Docker orchestration
├── .env # Environment variables
└── README.md # This file
POST /api/auth/register- User registrationPOST /api/auth/login- User loginPOST /api/auth/refresh- Refresh JWT token
GET /api/tests- Get all available testsGET /api/tests/:id/questions- Get questions for a test
POST /api/progress/study- Save Study Mode progressGET /api/progress/study/:testId- Get Study Mode progressPOST /api/progress/mock-test- Save Mock Test resultsGET /api/progress/mock-tests- Get Mock Test historyGET /api/progress/stats- Get user statistics
Run migrations:
cd server
npm run migrateReset database:
cd server
npm run migrate:resetSee .env.example for all available configuration options.
- bcrypt password hashing
- JWT token authentication
- SQL injection prevention via parameterized queries
- XSS attack prevention via input sanitization
- CORS configuration
- Rate limiting
- Input validation
The application is designed for AWS deployment:
- Frontend: S3 + CloudFront
- Backend: EC2
- Database: RDS PostgreSQL
MIT