A full-stack web application template with React frontend, Express.js backend, and Supabase authentication.
- Frontend: React 18 with Vite for fast development
- Backend: Express.js with RESTful API
- Authentication: Supabase integration with email/password and OAuth
- Styling: Tailwind CSS for modern UI
- State Management: React Context for authentication
- Routing: React Router for client-side navigation
- Development: Hot reload for both client and server
web-app/
βββ client/ # React frontend
β βββ src/
β β βββ components/ # Reusable components
β β βββ contexts/ # React contexts
β β βββ lib/ # Utilities and configurations
β β βββ pages/ # Page components
β β βββ services/ # API services
β βββ .env.example # Environment variables template
β βββ package.json
βββ server/ # Express.js backend
β βββ server.js # Main server file
β βββ .env.example # Environment variables template
β βββ package.json
βββ .gitignore
βββ package.json # Root package.json with scripts
- Node.js 20.19+ or 22.12+
- npm or yarn
- Git
git clone <your-repo-url>
cd web-app# Install all dependencies (client + server)
npm run install:all
# Or install separately
npm install # Root dependencies
cd client && npm install # Client dependencies
cd ../server && npm install # Server dependenciesCopy the example environment file and configure it:
cp client/.env.example client/.env.localEdit client/.env.local:
# Supabase Configuration
VITE_SUPABASE_URL=https://your-project-id.supabase.co
VITE_SUPABASE_ANON_KEY=your-supabase-anon-key
# API Configuration
VITE_API_URL=http://localhost:3001cp server/.env.example server/.envEdit server/.env:
PORT=3001- Create a new project at supabase.com
- Go to Settings β API
- Copy your project URL and anon key
- Update your
client/.env.localfile with these values - Enable authentication providers in Supabase dashboard:
- Email/Password authentication
- OAuth providers (Google, Microsoft, etc.)
# Start both client and server
npm run dev
# Or start separately
npm run client:dev # Client only (port 5173)
npm run server:dev # Server only (port 3001)npm run dev- Start both client and servernpm run install:all- Install all dependenciesnpm run build- Build for production
npm run client:dev- Start Vite development servernpm run client:build- Build client for production
npm run server:dev- Start server with nodemonnpm run server:start- Start server normally
GET /api/health- Server health status
GET /api/items- Get all itemsPOST /api/items- Create new itemPUT /api/items/:id- Update itemDELETE /api/items/:id- Delete item
POST /api/auth/register- Register new userPOST /api/auth/login- Login userGET /api/auth/me- Get current user
- SignIn: Email/password login with OAuth options
- SignUp: User registration with validation
- AuthContext: Global authentication state management
- Dashboard: Main application dashboard
- Profile: User profile management
- Settings: Application settings
- Supabase First: Primary authentication through Supabase
- Backend Fallback: Falls back to backend API if Supabase fails
- OAuth Support: Google and Microsoft OAuth integration
- Session Management: Automatic token refresh and session handling
cd client
npm run build
# Deploy the 'dist' folder to your hosting servicecd server
npm start
# Deploy to your server platform (Heroku, Railway, etc.)- Environment variable protection
- CORS configuration
- Input validation
- Secure authentication flow
- Protected API routes
- Hot Reload: Both client and server support hot reload
- Environment Variables: Use
.env.localfor client,.envfor server - API Communication: Client communicates with server via REST API
- Error Handling: Comprehensive error handling throughout the app
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
This project is open source and available under the MIT License.
If you encounter any issues:
- Check the console for errors
- Verify environment variables are set correctly
- Ensure Supabase project is properly configured
- Check that all dependencies are installed
For more help, please open an issue in the repository.