Angular web application for user authentication and AI-powered chat, consuming an API hosted on Azure. Includes login and signup screens, chat list, message exchange, and dark mode. Project deployed on Vercel.
- Email: front@email.com
- Password: frontdomina
- Angular 20 (standalone components)
- TypeScript 5.8
- Angular Router (routes +
CanActivateguard) - Reactive Forms (login/sign-up)
- HttpClient + Interceptor (401 handling)
- RxJS 7.8
- Tests: Jasmine + Karma
- Deploy: Vercel (frontend) | Azure App Service (backend)
- Authentication with token stored in
localStorage(meuToken,meuId). - Route protection for
/chatvia guard (src/app/auth.guard.ts). - Chat with conversation list and messages persisted through the API.
- Calls to
/chat-completionto fetch AI responses (Gemini model via backend). - Dark mode with preference saved in
localStorage.
Base URL: https://senai-gpt-api.azurewebsites.net
POST /login– authenticationPOST /users– user registrationGET /chats,POST /chats,DELETE /chats/:idGET /messages?chatId=...,POST /messages,DELETE /messages/:idPOST /chat-completion– AI response
- Node.js 18.19+ (20.x recommended)
- npm 9+
- Install dependencies:
npm install
- Start the development server:
npm run start
- Open
http://localhost:4200/.
Tips:
- Create a user at
/new-userand log in at/loginto access/chat. - The token is automatically stored in
localStorageafter login.
npm run build
Artifacts will be generated in dist/ according to angular.json.
npm start–ng serve(dev)npm run build– production buildnpm run watch– watch modenpm test– unit tests (Karma + Jasmine)
src/app/app.routes.ts– route definitionssrc/app/auth.guard.ts– auth guardsrc/app/user-module/login-screen/– login screensrc/app/user-module/new-user-screen/– sign-up screensrc/app/chat-module/chat-screen/– chat screen +chat-service.tssrc/app/interfaces/gemini-response.ts– AI response types
- The API URL is hardcoded in
chat-service.tsand login logic; adjust if using multiple environments. - The interceptor redirects to
/loginon401and clearslocalStorage.