This guide will help you set up Appwrite for this project
- An Appwrite Account - #100Devs Sign Up Link (use our link for free pro credit)
- A project created in Appwrite Cloud or self-hosted instance
- Go to Appwrite Cloud or your self-hosted instance
- Create a new project
- Note down your Project ID from the project settings
- In your Appwrite project dashboard, go to Auth → Settings
- Enable Email/Password & Magic Link authentication method
- Configure your allowed domains under Security → Domains
- For development: add
localhost:3000 - For production: add your domain
- For development: add
-
Change
.env.exampleto.env.localin your project root -
Replace:
NEXT_PUBLIC_APPWRITE_PROJECT_IDwith your actual Appwrite project IDNEXT_PUBLIC_APPWRITE_ENDPOINTwith your actual Appwrite endpoint that looks like "https://city.cloud.appwrite.io/v1"
The login page includes:
- User Registration: Create new accounts with email, password, and name
- User Login: Sign in with existing credentials
- User Logout: End user sessions
- Error Handling: Display helpful error messages
- Loading States: Show loading indicators during operations
- Form Validation: Basic client-side validation
- Responsive Design: Works on all screen sizes
- Navigate to
/loginin your application - Use the "Sign in" button to log in with existing credentials
- Use the "Create new account" button to register a new user
- After successful login, users will see a welcome message with logout option
- "Project ID not found": Make sure you've updated the project ID in
.env.local - CORS errors: Ensure your domain is added to the allowed domains in Appwrite settings
- Authentication failed: Check that email/password auth is enabled in your Appwrite project