A React application with Express backend and MongoDB integration for user authentication.
- Node.js installed
- MongoDB running (either locally or connection string)
npm installMake sure MongoDB is running. The app will connect to:
- Default:
mongodb://localhost:27017/uottahack - Or set
MONGODB_URIin.envfile
You need to run both the frontend and backend servers:
Terminal 1 - Backend Server:
npm run serverThis starts the Express server on http://localhost:3001
Terminal 2 - Frontend Development Server:
npm run devThis starts the Vite dev server (typically http://localhost:5173)
npm run buildnpm run preview- Homepage - Click "Get Started" button
- Role Selection - Choose between "Educator" or "Student"
- Authentication - Sign up or login with username and password
- Dashboard - View user information after successful authentication
src/- Frontend React source filescomponents/- React components (Homepage, RoleSelection, AuthForm, Dashboard)main.jsx- Application entry pointApp.jsx- Main App component with routing
server/- Backend Express serverindex.js- Server entry pointmodels/User.js- MongoDB User modelroutes/userRoutes.js- API routes for authentication
public/- Static assetsindex.html- HTML templatevite.config.js- Vite configuration with API proxy
POST /api/users/signup- Create new user accountPOST /api/users/login- Authenticate existing user
username- Unique usernamepassword- Hashed password (bcrypt)role- Either "educator" or "student"createdAt- Timestamp of account creation